Page 1 of 1

Command for inverting encoder and motor direction

Posted: Sun Apr 28, 2019 4:49 am
by PdoubleU
Hi!

In IonStudio it is possible to revert (checkbox) the direction of each encoder as well the direction of the motor movement. I was just wondering how to do that via packet serial. Is there a command for that or do you calculate that on ion studio. If yes, could you gave a code snipped? Thanks a lot

Another point are Min/Max Pos in the Position settings. If these are set both to 0 I am not able to send a movePos command via packet serial (command 65). I have to manual connect the roboclaw to a ion studio and change min/max pos to -999999999 and 999999999 (or so) to make a command 65 possible. Is there any command to set this min max pos via packet serial. I havent found anything in the manual.

Thanks a lot!

Re: Command for inverting encoder and motor direction

Posted: Mon Apr 29, 2019 10:03 am
by Basicmicro Support
Min and Max position settings are saved to the board when you Write Settings. They cant both be 0(eg no range of motion).

The SETM#POSPID command(s) sets these values for each motor as well as the other Position PID settings values.

The SETM#ENCODERMODE commands set the encoder and motor directions as well as the encoder mode. For each encoder bit 5 sets the motor direction and bit 6 sets the encoder direction. Note this settings also sets the encoder mode,bit 0 and enables/disables enocder support when using RC/Analog control inputs.

Re: Command for inverting encoder and motor direction

Posted: Mon Apr 29, 2019 10:52 am
by PdoubleU
Thanks,

Where can I find a detailed description of what the single bits in the set encoder command stands for?

Thanks

Re: Command for inverting encoder and motor direction

Posted: Mon Apr 29, 2019 6:46 pm
by Basicmicro Support
The invert/reverse bits were added recently but the reset of the mode definition is in the Roboclaw User Manual.