Endstops branch: Control speed after homing?

I have the Endstop branch by @Wetmelon working, however I can’t figure out how to control the speed of the motor for the return to zero immediately after homing.

I can control the homing speed, via odrv0.axis0.controller.config.homing_speed, but once it hits the limit switch it appears that the motor runs full velocity back to zero, which is problematic in my robot application.

Is there a way to slow that down?

Hi Tom,

If you use the Razors Edge branch it uses the vel_ramp_rate during homing and then the trajectory (trap_traj) module for return-to-0 instead of just blindly commanding a position, so it gives you full control over both speed and acceleration.

1 Like

triggers the homing sequence in the RazorsEdge branch.

I can configure all the limit switches etc. but the commands don’t work.

In [39]: odrv0.axis0.requested_state=AXIS_STATE_ENCODER_INDEX_SEARCH In [40]: odrv0.axis0.requested_state=AXIS_STATE_CLOSED_LOOP_CONTROL In [41]: odrv0.axis0.requested_state=AXIS_STATE_HOMING --------------------------------------------------------------------------- NameError Traceback (most recent call last) ~\AppData\Roaming\Python\Python36\site-packages\fibre\shell.py in () ----> 1 odrv0.axis0.requested_state=AXIS_STATE_HOMING NameError: name ‘AXIS_STATE_HOMING’ is not defined In [42]: odrv0.axis0.controller.home_axis() --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ~\AppData\Roaming\Python\Python36\site-packages\fibre\shell.py in () ----> 1 odrv0.axis0.controller.home_axis() ~\AppData\Roaming\Python\Python36\site-packages\fibre\remote_object.py in getattribute(self, name) 243 return attr 244 else: --> 245 return object.getattribute(self, name) 246 #raise AttributeError(“Attribute {} not found”.format(name)) 247 AttributeError: ‘RemoteObject’ object has no attribute ‘home_axis’ In [43]: exit

if I checkout the Endstops branch and re-build and flash the firmware then the odrv0.axis0.controller.home_axis() command works…

home_axis was removed, sorry.

Because you’re not using the “development” odrivetool (which can be launched from the Odrive/tools folder), you have to use the value 11 directly instead of AXIS_STATE_HOMING