stepRocker Open Source TMCL
1.00
|
Motor monitoring. More...
Go to the source code of this file.
Functions | |
void | SetStepDirMode (UCHAR Axis, UCHAR Mode) |
Switch to step/direction mode. More... | |
UCHAR | GetClosedLoopInitFlag (UCHAR Axis) |
Check status of closed-loop initialization. More... | |
void | StartTorqueMode (UCHAR Axis, int Torque) |
Run motor in torque mode. More... | |
void | StopTorqueMode (UCHAR Axis) |
Turn off torque mode. More... | |
int | GetTorqueModeCurrent (UCHAR Axis) |
Read actual torque mode current setting. More... | |
void | SystemControl (void) |
Motor monitoring. More... | |
Motor monitoring.
This file contains the definitions of the functions from the SysControl.c module.
Check status of closed-loop initialization.
Axis | Axis number (always 0 with the stepRocker) |
Check if the closed loop function has been initialized.
int GetTorqueModeCurrent | ( | UCHAR | Axis | ) |
Read actual torque mode current setting.
Axis | Axis number (always 0 with the stepRocker) |
Read back the actual torque mode current setting.
Switch to step/direction mode.
Axis | Axis number (always 0 with the stepRocker) |
Mode | Desired mode |
Switch to step/direction mode or back to normal ramp generator mode.
Possible Modes:
0: Ramp generator mode
1: step/direction mode, step pulse are high
2: step/direction mode, step pulse are low
3: step/direction mode, both edges of each step pulse (double speed)
Bit 2: direction signal polarity
Bit 3: indirect mode (ramp generator controlled by step pulses)
void StartTorqueMode | ( | UCHAR | Axis, |
int | Torque | ||
) |
Run motor in torque mode.
Axis | Axis number (always 0 with stepRocker) |
Torque | Torque mode direction and current (-255..+255) |
Switch on torque mode and set the torque mode current to be used. This only works in closed loop mode.
void StopTorqueMode | ( | UCHAR | Axis | ) |
Turn off torque mode.
Axis | Axis number (alwaxs 0 with the stepRocker) |
Switch off the torque mode. Afterwards the motr will be in velocity mode with velocity=0 (stopped).
void SystemControl | ( | void | ) |
Motor monitoring.
This function must be called periodically from the main loop and does some monitoring tasks, e.g. lowering the current after the motor has not been moving for some time.