Hi all
Just to give a little background, I am trying to create a camera motion system where a motor pulls a camera dolly along a track:
The motor has a worm gear and thus needs to rotate a lot. The idea is also that I can add more tracks and make the hole system much longer.
Therefore it makes sense to me to control the motor in circular position mode. I read some of the info here and here
I start with the following commands in odrivetool:
calibration
In [6]: odrv0.axis0.requested_state=4
In [7]: odrv0.axis0.requested_state=6
In [8]: odrv0.axis0.requested_state=7
In [9]: odrv0.axis0.requested_state=8
set circular mode
In [10]: odrv0.axis0.controller.config.circular_setpoints = True
First thing I notice now is that pos_estimate and pos_circular are not the same. It would be nice if this was the same because after calibration I would expect the axis to be at zero, but if I now sent a new pos_input of 0 the axis will suddenly start to move. But okay I can work around thisā¦
In [11]: odrv0.axis0.encoder.pos_estimate
Out[11]: 0.021331787109375
In [12]: odrv0.axis0.encoder.pos_circular
Out[12]: 0.7835273742675781
next I set the range and the input mode I set to input_mode_trap_traj
In [13]: odrv0.axis0.controller.config.circular_setpoint_range=1
In [14]: odrv0.axis0.controller.config.input_mode=5;
Now I try to sent some commands to keep the motor to rotate. I tried to make the input_pos higher. Sending 0.5 and next 1.5 does not create a rotation but I understand that this is normal in position mode.
In [17]: odrv0.axis0.controller.input_pos=0
In [18]: odrv0.axis0.controller.input_pos=0.5
In [19]: odrv0.axis0.controller.input_pos=1.5
In [20]: odrv0.axis0.controller.input_pos=1
Next I tried sending some incremental_move() commands, because I want to have the motor allways moving in the same direction, but the axis just moves back and forwardā¦
In [23]: odrv0.axis0.controller.move_incremental(0.5,True)
In [24]: odrv0.axis0.controller.move_incremental(0.5,True)
In [25]: odrv0.axis0.controller.move_incremental(0.5,True)
In [26]: odrv0.axis0.controller.move_incremental(0.5,True)
So my question: what do i need to sent to allways have the same rotation in the same direction? Iām a bit confused because I thought the hole idea of the circular pos mode is to keep the rotor spinning with the same amount of steps, and never have a problem with overflow (like the wheels of a robotā¦). But I dont really understand what I have to sent to the odrive in order to keep the motor spinning in the same directionā¦
Or does this only work with the step/direction method by sending signals to some GPIO pints?
any help appreciated