Hi there, I am able to control two odrives driving 4 motors. I can put them in closed loop control and move them, they have a lot of power in that mode. However when I send the command to home them they have absolutely NO power and move very slowly, then when they hit the limit switches they move fast again to their offset position. I assume its because it is going into a different control mode to home. What parameters should I increase to get the homing sequence to home with some force?
The issue is that the force isnt enough to get them to move steadily. they instead jerk slowly towards the homing switches. Its been a long day so apologies if i have’nt included a vital piece of information to help with this
I should add that I am using firmware version :
In : odrv0.fw_version_minor
In : odrv0.fw_version_major
In : odrv0.fw_version_revision
And the actual AXIS_STATE_HOMING command isnt recognised so i am calling axis state 11 instead.
My guess is your
vel_gain is too low. Homing works like this:
- Calibrate motor, make sure it can enter closed loop control.
- Enter closed loop control
- Enter the homing sequence / state machine
- Put the axis in
- Drive towards the
- Once the endstop is found, handle setting the offset then
- Put the axis in
- Command the axis to 0 position
Make sure your motor runs well in the velocity control mode for good homing behavior.
Ah thank you. Yes that helped. It seems the vel_gain acts differently in the two modes. So I will have to set the vel gain for the homing sequence and then back it off by a factor of 10 once it goes back into trap traj mode otherwise it vibrates after homing. I had not used the velocity control mode before - probably why i came across that issue.
Hmmm… It shouldn’t act that way. I’ll have to test it. It could be that your pos_gain is too high given your 10x vel_gain
Ah you are correct I do have a very high pos_gain value as it was the only one that gave me the power i was used to testing with my motors. perhaps i will go through the tuning stage again. I think i must have done something wrong. thanks for the reply!
i used to have 20 as the pos gain, but on my rebuild of this project I was trying to tune them better and got to 120 as the value that gave me the same force to push back against me trying to turn the motor wile in closed loop control.
Drop the pos_gain and increase the vel_gain and vel_integrator gain, you’ll get the same force.