How do I use the TMCL command "MVP"?
The MVP (Move to Position) tells the motion controller to move a motor to a specific position. This command has 3 "types" that define how the target position is interpreted.
- Type ABS (command would be MVP ABS, <axis>, <position>) moves the motor to an absolute position. As an example, MVP ABS 0 10000 would move motor 0 to an absolute position of 10000. It doesn't matter where the motor was prior to the command, motion will stop when the motor reaches position 10000. If the motor was at position 7500 when the command is sent, the motor would end up moving a distance of 2500 to end at position 10000. Velocity and ramping is determined by Axis Parameter settings.
- Type REL (command would be MVP REL, <axis>, <offset>) behaves in a similar way but with a key difference. The MVP REL command orders the motor to move a set distance, called "offset", relative to the motor's current location. As an example, MVP REL 0 10000 would move your motor 10000 steps from its current location. If the motor was at position 7500 when the command is sent, the motor would move 10000 steps and end at position 17500. This can also be set to a negative number to rotate in the opposite direction. Velocity and ramping is determined by Axis Parameter settings.
- Type COORD (command would be MVP COORD, <axis>, <Coordinate_number>) behaves like ABS, but the position value is already stored in memory, called a "coordinate". Each motor axis has its own coordinate memory and some TMCM modules can store up to 20 coordinates per axis. Please reference the TMCL firmware manual for your device to find out how many coordinates you can store.
If using a multi-axis TMCM board, the COORD type also allows for moving multiple motors at the same time.
Please see KA-15017 for more details on MVP COORD