[Solved] Set encoder direction using SOLOPy
I am controlling a motor in POSITION mode. When sending a position command using:
I noticed that, assuming I start at encoder position = 0. If I send a negative target encoder position, my system goes up and if I send a positive target encoder position, my system goes down.
For convenience, I would like the negative direction to correspond to down and the positive direction to correspond to up.
I tried to use the Uart Write command: 0x0C in both clockwise and counter clockwise mode. The direction of rotation in POSITION mode didn't seem to change.
Is there a way to change the encoder direction using the python API? I looked through it and I couldn't find a command to do that.
Can you also confirm if the method "set_motor_direction" is only valid in SPEED/TORQUE? mode.
as you say in POSITION mode the set_position_reference already define the direction so it's not work with set_motor_direction.
You can test se same behavior in the Motion terminal too.
In any case for your application if make sense to have direction as a variable you can try to create a code implementation to reach it.
A idea can be:
my_direction is a variable similar as set_motor_direction. In this case you can assign 1 or -1
my_referemce is a variable that define how many pulses you want to move. In this case you can assign only absolute value
thanks for the feedback Francesco! 👍