| aMotion_SetRampFlags | Index |
Definition:
Parameters:
Return Value:
Description:
This routine sets new ramp motion control flags for a motion control channel.
The first byte in the 2-byte flags parameter is a reflex enable byte. The most significant bit is the enable flag. The 7 least significant bits are the reflex ID (0-127). If enabled, a trapezoidal ramp motion will trigger the corresponding reflex when it is completed. The second byte in the 2-byte parameter is a flag byte for controlling the ramp motion. Flags can be used to enable velocity damping, synchronize dual ramp motions, retrieve final position error, and enable ramp nudging. See the cmdMO_RMPCFG documentation for details. The indices of each bit flag have a defined value.
| aMOTION_RAMPFLAG_TYPE | 0 | 0=trapezoidal ramp, 1=velocity damping |
| aMOTION_RAMPFLAG_SYNC | 1 | 0=no sync, 1=synchronize dual ramps |
| aMOTION_RAMPFLAG_ERROR | 2 | 0=normal, 1=write final position error to target distance |
| aMOTION_RAMPFLAG_NUDGE | 3 | 0=normal, 1=enable final nudge step to minimize error |
Example:
#include <aMotion.tea>
aMotion_SetRampFlags(0, 0x000A);
aMotion_SetRampFlags(1, 0xE40A);
The low byte of each parameter, 0x0A, has bits aMOTION_RAMPFLAG_NUDGE and aMOTION_RAMPFLAG_SYNC set. This would enable ramp synchronization and the nudge feature for motors 0 and 1. The high byte of the parameter for channel 1 is equivalent to 0x80 + 100. When motor 1 completes its ramp motion, it will issue reflex 100.
Related: