A simple library to send instructions and receive data from motors Faulhaber via RS232 link. More...
#include "motors.h"
Go to the source code of this file.
Functions | |
bool | EnableLeft () |
bool | EnableRight () |
bool | DisableLeft () |
bool | DisableRight () |
bool | ResetLeft () |
bool | ResetRight () |
char | ReadBufferLeft (char *Buffer, int NbMax, long TimeOut) |
char | ReadBufferRight (char *Buffer, int NbMax, long TimeOut) |
bool | CheckOKLeft (long TimeOut_us) |
bool | CheckOKRight (long TimeOut_us) |
bool | CheckRESETLeft (long TimeOut_us) |
bool | CheckRESETRight (long TimeOut_us) |
void | ISR_TimeOut_Motors () |
bool | SetLeftSpeed (long Vit) |
bool | SetRightSpeed (long Vit) |
bool | SetLeftAbsolutePos (long Pos) |
bool | SetRightAbsolutePos (long Pos) |
bool | SetLeftRelativePos (long Pos) |
bool | SetRightRelativePos (long Pos) |
bool | SetLeftAcc (int Acc) |
bool | SetRightAcc (int Acc) |
bool | SetLeftDec (int Dec) |
bool | SetRightDec (int Dec) |
bool | SetLeftPeakCurrentLimit (int Current) |
bool | SetRightPeakCurrentLimit (int Current) |
bool | SetLeftContCurrentLimit (int Current) |
bool | SetRightContCurrentLimit (int Current) |
bool | SetLeftNotifyPosition (long Pos) |
bool | SetRightNotifyPosition (long Pos) |
bool | SetLeftNotifyPositionOff () |
bool | SetRightNotifyPositionOff () |
bool | SetLeftNotifyVelocity (long Vel) |
bool | SetRightNotifyVelocity (long Vel) |
bool | SetLeftNotifyVelocityOff () |
bool | SetRightNotifyVelocityOff () |
bool | MovingLeft () |
bool | MovingRight () |
char | GetLeftSpeed (long *Speed) |
char | GetRightSpeed (long *Speed) |
char | GetLeftPos (long *Pos) |
char | GetRightPos (long *Pos) |
char | GetLeftAcc (int *Acc) |
char | GetRightAcc (int *Acc) |
char | GetLeftDec (int *Dec) |
char | GetRightDec (int *Dec) |
char | GetLeftPeakCurrentLimit (int *Current) |
char | GetRightPeakCurrentLimit (int *Current) |
char | GetLeftContCurrentLimit (int *Current) |
char | GetRightContCurrentLimit (int *Current) |
bool | GetLeftNotifyPosition () |
bool | GetRightNotifyPosition () |
bool | GetLeftNotifyVelocity () |
bool | GetRightNotifyVelocity () |
Variables | |
bool | TimeOutFlagMotors = false |
A simple library to send instructions and receive data from motors Faulhaber via RS232 link.
See also :
motorsControl.h
The header File Reference.
Definition in file motors.cpp.
bool CheckOKLeft | ( | long | TimeOut_us = 100000 | ) |
Check if a "ok" has been received on left buffer.
TimeOut_us | Set the length of the time out (by default : 100 ms) |
Definition at line 123 of file motors.cpp.
bool CheckOKRight | ( | long | TimeOut_us = 100000 | ) |
Check if a "ok" has been received on right buffer.
TimeOut_us | Set the length of the time out (by default : 100 ms) |
Definition at line 135 of file motors.cpp.
bool CheckRESETLeft | ( | long | TimeOut_us = 100000 | ) |
Check if a "reset" has been received on left buffer.
TimeOut_us | Set the length of the time out (by default : 100 ms) |
Definition at line 148 of file motors.cpp.
bool CheckRESETRight | ( | long | TimeOut_us = 100000 | ) |
Check if a "reset" has been received on right buffer.
TimeOut_us | Set the length of the time out (by default : 100 ms) |
Definition at line 160 of file motors.cpp.
bool DisableLeft | ( | ) |
Disable left motor.
Definition at line 31 of file motors.cpp.
bool DisableRight | ( | ) |
Disable right motor.
Definition at line 38 of file motors.cpp.
bool EnableLeft | ( | ) |
Enable left motor.
Definition at line 15 of file motors.cpp.
bool EnableRight | ( | ) |
Enable right motor.
Definition at line 22 of file motors.cpp.
char GetLeftAcc | ( | int * | Acc | ) |
Get left acceleration (from 0 to 30000 r/s^2).
Definition at line 452 of file motors.cpp.
char GetLeftContCurrentLimit | ( | int * | Current | ) |
Get left continuous current limit (from 0 to 12000 mA).
Definition at line 527 of file motors.cpp.
char GetLeftDec | ( | int * | Dec | ) |
Get left deceleration (from 0 to 30000 r/s^2).
Definition at line 477 of file motors.cpp.
bool GetLeftNotifyPosition | ( | ) |
Read left buffer to see if a "notify position" packet has been received (Check SetLeftNotifyPosition for more information about this function).
Definition at line 552 of file motors.cpp.
bool GetLeftNotifyVelocity | ( | ) |
Read left buffer to see if a "notify velocity" packet has been received (Check SetLeftNotifyVelocity for more information about this function).
Definition at line 571 of file motors.cpp.
char GetLeftPeakCurrentLimit | ( | int * | Current | ) |
Get left peak current limit (from 0 to 12000 mA).
Definition at line 502 of file motors.cpp.
char GetLeftPos | ( | long * | Pos | ) |
Get left position (from -1.8*10^9 to +1.8*10^9).
Definition at line 427 of file motors.cpp.
char GetLeftSpeed | ( | long * | Speed | ) |
Set left speed (from 0 to 32767 rpm).
Definition at line 402 of file motors.cpp.
char GetRightAcc | ( | int * | Acc | ) |
Get right acceleration (from 0 to 30000 r/s^2).
Definition at line 464 of file motors.cpp.
char GetRightContCurrentLimit | ( | int * | Current | ) |
Get right continuous current limit (from 0 to 12000 mA).
Definition at line 539 of file motors.cpp.
char GetRightDec | ( | int * | Dec | ) |
Get right deceleration (from 0 to 30000 r/s^2).
Definition at line 489 of file motors.cpp.
bool GetRightNotifyPosition | ( | ) |
Read right buffer to see if a "notify position" packet has been received (Check SetRightNotifyPosition for more information about this function).
Definition at line 561 of file motors.cpp.
bool GetRightNotifyVelocity | ( | ) |
Read right buffer to see if a "notify velocity" packet has been received (Check SetRightNotifyVelocity for more information about this function).
Definition at line 580 of file motors.cpp.
char GetRightPeakCurrentLimit | ( | int * | Current | ) |
Get right peak current limit (from 0 to 12000 mA).
Definition at line 514 of file motors.cpp.
char GetRightPos | ( | long * | Pos | ) |
Get right position (from -1.8*10^9 to +1.8*10^9).
Definition at line 439 of file motors.cpp.
char GetRightSpeed | ( | long * | Speed | ) |
Set right speed (from 0 to 32767 rpm).
Definition at line 414 of file motors.cpp.
void ISR_TimeOut_Motors | ( | ) |
When reception is too long, the time out occurenced and the present function is attach to the time out. So, when it occurenced, this function sets the flag to true and stop the timer. This flag will also stop reception and return an error.
Definition at line 174 of file motors.cpp.
bool MovingLeft | ( | ) |
Start moving to the last left position load.
Definition at line 385 of file motors.cpp.
bool MovingRight | ( | ) |
Start moving to the last right position load.
Definition at line 392 of file motors.cpp.
char ReadBufferLeft | ( | char * | Buffer, |
int | NbMax, | ||
long | TimeOut | ||
) |
Read left buffer.
Buffer | To save the reception |
NbMax | Set the maximum number of characters to read |
TimeOut | Set the length of the time out |
Definition at line 63 of file motors.cpp.
char ReadBufferRight | ( | char * | Buffer, |
int | NbMax, | ||
long | TimeOut | ||
) |
Read right buffer.
Buffer | To save the reception |
NbMax | Set the maximum number of characters to read |
TimeOut | Set the length of the time out |
Definition at line 93 of file motors.cpp.
bool ResetLeft | ( | ) |
Reset left motor.
Definition at line 47 of file motors.cpp.
bool ResetRight | ( | ) |
Reset right motor.
Definition at line 54 of file motors.cpp.
bool SetLeftAbsolutePos | ( | long | Pos | ) |
Set left absolute position (from -1.8*10^9 to +1.8*10^9).
Pos | Defines the position to use |
Definition at line 207 of file motors.cpp.
bool SetLeftAcc | ( | int | Acc | ) |
Set left acceleration (from 0 to 30000 r/s^2).
Acc | Defines the acceleration to use |
Definition at line 243 of file motors.cpp.
bool SetLeftContCurrentLimit | ( | int | Current | ) |
Set left continuous current limit (from 0 to 12000 mA).
Current | Defines the current limit to use |
Definition at line 294 of file motors.cpp.
bool SetLeftDec | ( | int | Dec | ) |
Set left deceleration (from 0 to 30000 r/s^2).
Dec | Defines the deceleration to use |
Definition at line 260 of file motors.cpp.
bool SetLeftNotifyPosition | ( | long | Pos = 0 | ) |
Set left notify position (when specified position is reached send a "notify position" that could be read by GetLeftNotifyPosition.
Pos | Defines the position to reach or pass to send the packet or if 0 or nothing is given the packet will be send when nominal position will be reached. |
Definition at line 311 of file motors.cpp.
bool SetLeftNotifyPositionOff | ( | ) |
Stop sending a "notify position" packet when left position is reached.
Definition at line 338 of file motors.cpp.
bool SetLeftNotifyVelocity | ( | long | Vel | ) |
Set left notify velocity (when specified velocity is reached send a "notify position" that could be read by GetLeftNotifyVelocity.
Vel | Defines the velocity to reach or pass to send the packet. |
Definition at line 353 of file motors.cpp.
bool SetLeftNotifyVelocityOff | ( | ) |
Stop sending a "notify velocity" packet when left velocity is reached.
Definition at line 370 of file motors.cpp.
bool SetLeftPeakCurrentLimit | ( | int | Current | ) |
Set left peak current limit (from 0 to 12000 mA).
Current | Defines the current limit to use |
Definition at line 277 of file motors.cpp.
bool SetLeftRelativePos | ( | long | Pos | ) |
Set left relative position (from -2.14*10^9 to +2.14*10^9).
Pos | Defines the position to use |
Definition at line 225 of file motors.cpp.
bool SetLeftSpeed | ( | long | Vit | ) |
Set left speed (from 0 to 32727 rpm).
Vit | Defines the speed to use |
Definition at line 189 of file motors.cpp.
bool SetRightAbsolutePos | ( | long | Pos | ) |
Set right absolute position (from -1.8*10^9 to +1.8*10^9).
Pos | Defines the position to use |
Definition at line 215 of file motors.cpp.
bool SetRightAcc | ( | int | Acc | ) |
Set right acceleration (from 0 to 30000 r/s^2).
Acc | Defines the acceleration to use |
Definition at line 251 of file motors.cpp.
bool SetRightContCurrentLimit | ( | int | Current | ) |
Set right continuous current limit (from 0 to 12000 mA).
Current | Defines the current limit to use |
Definition at line 302 of file motors.cpp.
bool SetRightDec | ( | int | Dec | ) |
Set right deceleration (from 0 to 30000 r/s^2).
Dec | Defines the deceleration to use |
Definition at line 268 of file motors.cpp.
bool SetRightNotifyPosition | ( | long | Pos = 0 | ) |
Set right notify position (when specified position is reached send a "notify position" that could be read by GetRightNotifyPosition.
Pos | Defines the position to reach or pass to send the packet or if 0 or nothing is given the packet will be send when nominal position will be reached. |
Definition at line 324 of file motors.cpp.
bool SetRightNotifyPositionOff | ( | ) |
Stop sending a "notify position" packet when right position is reached.
Definition at line 345 of file motors.cpp.
bool SetRightNotifyVelocity | ( | long | Vel | ) |
Set right notify velocity (when specified velocity is reached send a "notify position" that could be read by GetRightNotifyVelocity.
Vel | Defines the velocity to reach or pass to send the packet. |
Definition at line 361 of file motors.cpp.
bool SetRightNotifyVelocityOff | ( | ) |
Stop sending a "notify velocity" packet when right velocity is reached.
Definition at line 377 of file motors.cpp.
bool SetRightPeakCurrentLimit | ( | int | Current | ) |
Set right peak current limit (from 0 to 12000 mA).
Current | Defines the current limit to use |
Definition at line 285 of file motors.cpp.
bool SetRightRelativePos | ( | long | Pos | ) |
Set right relative position (from -2.14*10^9 to +2.14*10^9).
Pos | Defines the position to use |
Definition at line 233 of file motors.cpp.
bool SetRightSpeed | ( | long | Vit | ) |
Set right speed (from 0 to 32727 rpm).
Vit | Defines the speed to use |
Definition at line 197 of file motors.cpp.