Mindstorms 3rd Party ROBOTC Drivers RobotC
[Home] [Download] [Submit a bug/suggestion] [ROBOTC Forums] [Blog] [Support this project]
Files | Defines | Functions | Variables

Firgelli Linear Actuator
[Other]

Files

file  firgelli-linearact.h
 

Firgelli Linear Actuator driver.


Defines

#define STALL_TIME_SLOW   1200
#define STALL_TIME_FAST   800

Functions

task _FLACcontrolTaskA ()
task _FLACcontrolTaskB ()
task _FLACcontrolTaskC ()
void _FLACcontrolTasks (tMotor _motor, int _highPower, long _encTarget)
bool isDone (tMotor _motor)
void FLACstopLA (tMotor _motor)
void FLACextendLA (tMotor _motor, int _highPower)
void FLACextendLA (tMotor _motor, int _highPower, int distance)
void FLACtretractLA (tMotor _motor, int _highPower)
void FLACtretractLA (tMotor _motor, int _highPower, int distance)
void FLACmoveLA (tMotor _motor, int highpower, int pos)
void FLACsetInverse (tMotor _motor)
bool isStalled (tMotor _motor)
void FLACretractLA (tMotor _motor, int _highPower)
void FLACsetInverse (tMotor _motor, bool invert)

Variables

long _encoderTarget [3] = {0, 0, 0}
long _motorHighPower [3] = {0, 0, 0}
bool _stalled [3] = {false, false, false}
bool _inverted [3] = {false, false, false}

Detailed Description

Firgelli Linear Actuator driver


Define Documentation

#define STALL_TIME_FAST   800

Counter to check if motor is stalled when motor speeds are >= 50

Definition at line 40 of file firgelli-linearact.h.

#define STALL_TIME_SLOW   1200

Counter to check if motor is stalled when motor speeds are < 50

Definition at line 39 of file firgelli-linearact.h.


Function Documentation

task _FLACcontrolTaskA (  )

Definition at line 67 of file firgelli-linearact.h.

task _FLACcontrolTaskB (  )

Definition at line 123 of file firgelli-linearact.h.

task _FLACcontrolTaskC (  )

Definition at line 179 of file firgelli-linearact.h.

void _FLACcontrolTasks ( tMotor  _motor,
int  _highPower,
long  _encTarget 
)

Stop and start the motor control tasks and set their parameters.

Note: this is an internal function and should not be called directly.

Parameters:
_motorthe motor to be controlled
_highPowerthe highest speed the motor should turn at
_encTargetthe target the motor should move to

Definition at line 242 of file firgelli-linearact.h.

void FLACextendLA ( tMotor  _motor,
int  _highPower,
int  distance 
)

Extend the Linear Actuator.

Parameters:
_motorthe motor to be controlled
_highPowerthe highest speed the motor should turn at
distancethe number of encoder ticks (0.5mm) the actuator should move

Definition at line 346 of file firgelli-linearact.h.

void FLACextendLA ( tMotor  _motor,
int  _highPower 
)

Extend the Linear Actuator fully until stalled.

Parameters:
_motorthe motor to be controlled
_highPowerthe highest speed the motor should turn at
Examples:
firgelli-linearact-test1.c.

Definition at line 333 of file firgelli-linearact.h.

void FLACmoveLA ( tMotor  _motor,
int  highpower,
int  pos 
)

Move the Linear Actuator to an absolute position

Parameters:
_motorthe motor to be controlled
highpowerthe highest speed the motor should turn at
posthe exact encoder count to move to

Definition at line 385 of file firgelli-linearact.h.

void FLACretractLA ( tMotor  _motor,
int  _highPower 
)

Retract the Linear Actuator fully until stalled. It is wise to reset the encoder count for that motor afterwards.

Parameters:
_motorthe motor to be controlled
_highPowerthe highest speed the motor should turn at
Examples:
firgelli-linearact-test1.c.

Definition at line 359 of file firgelli-linearact.h.

void FLACsetInverse ( tMotor  _motor,
bool  invert 
)

Invert the LA's movement

Parameters:
_motorthe motor to be inverted
invertwhether or not to invert the motor

Definition at line 395 of file firgelli-linearact.h.

void FLACsetInverse ( tMotor  _motor )
void FLACstopLA ( tMotor  _motor )

Stop the current operation

Parameters:
_motorthe motor to be stopped

Definition at line 293 of file firgelli-linearact.h.

void FLACtretractLA ( tMotor  _motor,
int  _highPower 
)
void FLACtretractLA ( tMotor  _motor,
int  _highPower,
int  distance 
)

Retract the Linear Actuator.

Parameters:
_motorthe motor to be controlled
_highPowerthe highest speed the motor should turn at
distancethe number of encoder ticks (0.5mm) the actuator should move

Definition at line 372 of file firgelli-linearact.h.

bool isDone ( tMotor  _motor )

Check if the motor is done with the current operation

Parameters:
_motorthe motor to be checked
Returns:
true if the motor is done, false if it isn't
Examples:
firgelli-linearact-test1.c.

Definition at line 308 of file firgelli-linearact.h.

bool isStalled ( tMotor  _motor )

Check if the motor stalled on the last operation

Parameters:
_motorthe motor to be checked
Returns:
true if the motor stalled, false if it hadn't.
Examples:
firgelli-linearact-test1.c.

Definition at line 323 of file firgelli-linearact.h.


Variable Documentation

long _encoderTarget[3] = {0, 0, 0}

Motor encoder targets - INTERNAL

Definition at line 42 of file firgelli-linearact.h.

bool _inverted[3] = {false, false, false}

Are we reversing the motors? - INTERNAL

Definition at line 45 of file firgelli-linearact.h.

long _motorHighPower[3] = {0, 0, 0}

High Power - top speed of the motor - INTERNAL

Definition at line 43 of file firgelli-linearact.h.

bool _stalled[3] = {false, false, false}

Are we stalling? - INTERNAL

Definition at line 44 of file firgelli-linearact.h.