Failed to notice movemont,AS5600

Hi folks! I’m a newcomer to Simplefoc and Arduino. There is something wrong with my experiment, which is just to let the motor to rotate at a given speed by PID. Senor is AS5600 .But what I received from COM3 is :

MOT: Failed to notice movement
MOT: Init FOC failed.
,
So the motor didn’t rotate at all. I use this example, veloctiy_control, from simple foc but I didn’t know what the problem is. Did anyone met this problem before? Is there something wrong with my hardware connecting? I would appreciate if u could help me!
Here is my code:

Thanks a lot!

Welcome to SimpleFOC, @AlexandreC !

Its hard to say from just this what is wrong…

Could you give some details of your hardware setup, perhaps a wiring diagram or photo so we can see how things are connected? Which driver and which MCU are you using?

Can you try our “open loop” examples? These will let check whether the motor is connected and the PWM is working correctly. They don’t need a sensor to work.

Next, we have an example to test just the sensor - you can adapt it to your pins and make sure the sensor is working just by itself (for example when you turn the motor by hand, it should return ±6.28 = ±2*PI for one full rotation of the motor (+ or - depending on which way you turn).

Once these are working as expected, I think velocity mode will work for you too!

Thanks for your advice! !

I tried “open loop” examples and found that the motor worked correctly. Then I tried "magnetic sensor i2c " example and found datas ,always the same figure ,didn’t change when I rotated the motor. So I think maybe the unchanged dates from AS5600 led the motor didn’t work .But I can’t find the solution :face_with_spiral_eyes:

Some information about my hardware :

  • ESP32
  • BLCD driver board designed by someone I don’t know :rofl:
  • AS5600(SDA-23 ,SCL-5)

I notice there is a function:

  • MagneticSensorI2C(uint8_t _chip_address, float _cpr, uint8_t _angle_register_msb)

So how should I fix this function(the chip address?) and will it work? I use a multimeter to check all lines and they are connected well .

Hi @AlexandreC ! I’ve used the same board. Look at the example code here:

That code is from the maker of that board.