5408 views|10 replies

9720

Posts

24

Resources
The OP
 

LIS2MDL array magnet displacement data acquisition for magnetic nail navigation AGV [Copy link]

 
 This post was last edited by littleshrimp on 2020-10-19 19:44

I bought the magnet on September 30th, but the seller gave me the wrong address and sent it to another city. I didn't receive it until the 17th after the re-send.

I bought a few radial magnetized ones, but when I received them, they turned out to be axial magnetized ones. The seller said the title was wrong and radial magnets were out of stock and needed to be customized.

If you can't buy radial ones, you can only temporarily use axial ones as a substitute

In order to test the sensor in different positions of the magnet, I also bought a diameter slide

First, stick the magnet to the slide, then test to get a suitable spacing. Stick the sensor array board and the slide to the table at the specified distance.

When drawing the sensor array board, only the SWD and UART interfaces were brought out. In order to drive the stepper motor to move, I reused the PA13 and PA14 of the SWD. After downloading the program, I configured them to output pulse signals.

After each motor rotation, wait for a while and measure the XYZ axis data of 10 sensors respectively.

After the host computer collects data, it displays it through a bar graph and saves the data to the hard disk for later analysis

After the measurement is completed, draw a line graph through EXCEL

The serious jitter of Z-axis data may be because the pulse interval of controlling the stepper motor movement is too short and the magnet has not stabilized.

The data on the X axis looks better.

Latest reply

Well done, it's worth learning from you.   Details Published on 2024-8-13 17:39
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 

2056

Posts

0

Resources
2
 

The OP did a good job. Did you develop the host computer yourself? QT?

Comments

The host computer is made in C#, with serial communication and bar graph display, and its functions are very simple.  Details Published on 2020-10-27 15:39
 
 

5304

Posts

454

Resources
3
 

"Original" must be added

 
 
 

9720

Posts

24

Resources
4
 
IC Crawler posted on 2020-10-19 20:17 The OP did a good job. Did you develop this host computer yourself? QT?

The host computer is made in C#, with serial communication and bar graph display, and its functions are very simple.

Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

7462

Posts

2

Resources
5
 

So much fun, I envy you

Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

4

Posts

0

Resources
6
 

LIS2MDL supports IIC and three-wire SPI by default. From your previous post, you are using four-wire SPI, and you are using hardware SPI. From the data sheet, four-wire SPI needs to configure registers. LIS2MDL+STM32F407, I used IIC to adjust it, and it is already usable. But three-wire SPI and four-wire SPI control, I can't adjust it no matter what. Although the task is completed, I still want to know how to drive it with SPI. Can you please ask the master, when you use four-wire SPI to access LIS2MDL, how did you modify the register configuration at the beginning?

Comments

First make sure that the STM32 SPI is working properly. In 4-wire mode, modify BIT2 (4WSPI) of the sensor's CFG_REG_C (62h) to use 4-wire mode.   Details Published on 2020-12-10 09:12
 
 
 

9720

Posts

24

Resources
7
 
eielixiang posted on 2020-12-9 23:10 LIS2MDL supports IIC and three-wire SPI by default. From your previous post, you are using four-wire SPI, and hardware SPI. From the data...

First make sure that the STM32 SPI is working properly. In 4-wire mode, modify BIT2 (4WSPI) of the sensor's CFG_REG_C (62h) to use 4-wire mode.

For drivers, please refer to the official Standard C driver

STMems_Standard_C_drivers-master.zip (1.43 MB, downloads: 5)

Comments

Three-wire SPI is not possible  Details Published on 2020-12-23 14:34
Three-wire SPI is not possible  Details Published on 2020-12-16 13:18
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

4

Posts

0

Resources
8
 
This post was last edited by eielixiang on 2020-12-16 13:28
littleshrimp published on 2020-12-10 09:12 First make sure that the STM32 SPI works properly. In 4-wire mode, modify BIT2 (4WSPI) of the sensor's CFG_REG_C (62h) to use 4-wire mode. ...

 
 
 

4

Posts

0

Resources
9
 
littleshrimp posted on 2020-12-10 09:12 First make sure that the STM32 SPI works properly. In 4-wire mode, modify the sensor's CFG_REG_C (62h) BIT2 (4WSPI) to use 4-wire mode. ...

I did this before, but it still didn't work. After that, I used IIC to configure the registers, and then used four-wire SPI, but it still didn't work. Oh, I'll adjust it slowly by myself

 
 
 

10

Posts

1

Resources
10
 
eielixiang posted on 2020-12-23 14:34 I did this before, but it still didn't work. After that, I configured the registers with IIC and used four-wire SPI, but it still didn't work. Alas, ...

Hi, did you tune it out using 4-wire SPI?


 
 
 

7

Posts

0

Resources
11
 

Well done, it's worth learning from you.

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list