I have problem with my wheels spinning once at closed loop state. I have followed the calibration procedure at the Odrive website without any error but my wheels will not spin once I put it in close_loop_state. Please, can someone help me out. I have been trying to solve this problem for a month now without any good result.
Do you have any errors from
dump_errors(odrv0) after you try to enter closed loop?
controller.config.input_mode is set to
Have you tried torque control?
@towen thanks for your reply.
It returned no error after I entered the closed-loop control mode. I tried as well the torque control mode but same, the motor does not spin.
I also set
odrv0.axis0.controller.config.input_mode = INPUT_MODE_PASSTHROUGH before and after I enter the close-loopcontrol mode but no response.
I have tested both 47nF capacitors with the halls and 23.5nF (two 47nF in series connections since I don’t have 22nF recommended). Both worked fine with no error. However, the motors still does not spin. I am wondering what I am getting wrong.
When in torque mode, did you set ‘input_torque’ ?
odrv0.erase_configuration() - maybe you have some strange config error that is causing it.
you should run
odrivetool backup-config myconfig.json first.
@towen yes, I set the input torque to 0.1, 1 and 10 respectively and still no response. Each time I execute the
odrv0.save.configuration() function, it returns ‘Oh no ODrive has disappeared!’. I suppose this is not the problem.
I just erased all the configuration and did the calibration again with no result. It is indeed hard to figure out why it cannot enter closed-loop control mode.
No, that’s normal.
Is there any difference at all when you set input_torque to 10? Does the motor make a noise, become stiff, or get warm?
Wait a minute, maybe I see your problem.
You shouldn’t need to set pre_calibrated (at least not to just get it spinning) and if you do, it should be immediately after running calibration.
Did you run “full_calibration_sequence” without errors?
Do the position readouts look correct? If you query
encoder.pos_estimate and move the motor by hand, does it change by approximately 90 counts per rev? (since you are using Hall sensors it should be 6 * pole_pairs counts per rev)
Yes, it normally got a little bit stiff, and when I move with my hand it returns to normal.
Yes the full calibration ran without error, but whenever I try to execute the following part to run the motors, it will give no response
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.input_vel = 2
odrv0.axis0.controller.input_vel = 0
odrv0.axis0.requested_state = AXIS_STATE_IDLE
I just ran the position estimate count per revolution and here is the output:
This is my full calibration sequence. Every other part worked fine as specified at the ODrive website except from line 16 where the motor was supposed to spin.
Can you use
dump_errors(odrv0, True) instead of querying individual error fields?
And this post was the lifesaver, it saved me the heck of a month and weeks. I think the Hoverboard section of the ODrive website should be updated to accommodate this problem. It would really save people a bunch of stress.
@towen thank you for your help. I really appreciate it.
@towen @madcowswe Hello,
My ODrive M0 voltage usually drops and stops spinning the wheel after driving it for a while. It would throw the error attached in the image below.
Before the axis0 (M0) stopped spinning, I checked the voltage between each phase of the motor (M0 and M1), and it was around 14.05V for all. However, after some time of driving, M0 voltage would drop to around 1.5V and the motor will immediately stop spinning.
I am using Arduino Mega, ODrive v3.6 56V and hoverboard wheels. My Power source (battery) is 24V nominal voltage and 29.4V charging voltage.
I am wondering what could be the cause.
Could you please help me in troubleshooting it?
Thank you in advance for your time.
Illegal hall state generally means your hall sensors output the value 000 or 111, which are the illegal states. This is most commonly a noise issue. Try adding 22nF capacitors to the ABZ pins.
@Wetmelon Thanks for your reply. I actually connected two 47nF capacitors in series for each hall pin (ABZ). That gave me approximately 23.5nF equivalent capacitance. I did that because I do not have 22nF but 47nF. The calibration worked fine without error(s). That error normally occurs after spinning the wheels for some time, specifically when I try to change direction (turn the robot left or right). The M0 phase voltages will drop to about 1.4V and the axis0 motor will stop spinning. I am not sure if the errors are from my calibration parameters or not.