I am using the ODriveGUI to set up my odrive, and I am attempting to test the bidirectional velocity control of my motor using the ODrive. I have the motor driving in one direction, and I am able to adjust the velocity values of the motor. However, I am unable to control/change the direction of rotation, which is a requirement for my project.
Here is what I have tried so far with no luck:
-Set a negative setpoint value for odrive0.axis0.controller.vel_setpoint:
-change odrive0.axis0.motor.config.direction: from 1.0 to -1.0
-change the sign of the following values to negative
odrive0.axis0.config.calibration_lockin.vel:
odrive0.axis0.config.calibration_lockin.accel
odrive0.axis0.config.calibration_lockin.ramp_distance
Are you in closed loop control? The calibration lockin values are only for calibration, not normal operation such as velocity control. What motor and encoder are you using?
If you are in closed loop control and in the velocity control mode, you can use odrv0.axis0.controller.input_vel to control the velocity.
Do you get any errors when you try a negative velocity? Can you be more specific about what you mean by “not working” (or post a screenshot of the GUI with some plots?)
Here are some screenshots of the interface when sending different values
I also manually rotated and encoder CW and CCW to show the output from the encoder is working
When I change the number to a negative number, the motor continue to execute the previously entered command. If it is set as a CW 10 rps, then changed to CCW 5 rps, it will continue to rotate CW at 10 rps
Image 1 is rotating the encoder back and forth by hand
Image 2 is the output when sending a negative value (notice there is no setpoint change either)
Image 3 is the result sending a positive value (resulting in a CW rotation)
Image 4 is the result of sending 0 (motor stopped turning and attempted to hold 0 rps)