Velocity using step/dir possible?


i was wondering if it is possible to control the velocity of the motor using step/dir pulses.


Yes it is! Well, that is to say step/dir already implies some sort of temporal element that determines the speed by adjusting the time between steps. ODrive just treats steps as incremental pos_setpoint commands

okay so if the encoder is set to 2048 CPR, i have to set my CNC controller to 491.520 “steps” for 14.400 rpm on the spindle (and tell the controller the maximum rpm is 14.400), if the encoder is on the spindle. (Motor has for example 30 teeth pulley and the spindle has 15 teeth pulley so the spindle turns twice as fast)

(2.048*14.400) /60 = 491.520

i made some rpm tests and once encountered an error (overspeed, because i held the motor by hand and let go to emulate entering and exiting a cut) but that may be because i havent really tuned the motor and/or my power supply is weak (24v 6.5a, want to buy a 48v with at least 20a power supply).

The only problem i see doing this is, it will probably try to hold the position when i command 0rpm. Would it be possible to disable the driver when no steps are seen for longer than, lets say, 0.1 seconds?

No, and that would be undesirable behaviour. Steppers don’t work like that either. There’s a pull request (or at least a normal request) for an enable/disable pin which could be used to put the driver in IDLE but it’s not implemented yet. For now you’ll have to send a command to set the driver to IDLE if you want to be able to backdrive it.

so i have changed my controller to output step/dir instead of pwm/dir and when i set the odrive to step/dir and position control it seems to work correct but if i set the odrive to velocity mode the motor doesnt spin.

Is step dir not available with velocity control?

Sorry, it only works with position control at this time.

so when approx. will i be able to use step dir for velocity?