255 const bool GetFreedom() {
return freedom; }
const bool GetBlocked() {
return blocked; }
const bool GetNmp() {
return nmp; }
270 void sendAPS(
const TMotAPS* _aps);
void sendTPS(
const TMotTPS* _tps);
void sendSCP(
const TMotSCP* _scp);
void sendDYL(
const TMotDYL* _dyl);
279 void recvPVP();
void recvSCP();
void recvDYL();
void recvSFW();
304 void setInitialParameters(
double angleOffset,
double angleRange,
int encodersPerCycle,
int encoderOffset,
int rotationDirection);
317 void inc(
int dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
320 void dec(
int dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
323 void mov(
int tar,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
347 void sendSpline(
short targetPosition,
short duration,
short p1,
short p2,
short p3,
short p4);
353 void sendFourSplines(
short targetPosition,
short duration, std::vector<short>& coefficients);
Abstract base class for protocol definiton.
TKatGNL gnl
katana general
CCplBase * protocol
protocol interface
void decDegrees(double dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS)
Decrements the motor specified by an index postion in degrees.
const TMotInit * GetInitialParameters()
CCplBase * protocol
protocol interface
TMotSFW sfw
slave firmware
void setSpeedCollisionLimit(int limit)
Set the collision limit.
void mov(int tar, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS)
Moves the motor specified by an index to a given target position in encoder units.
const int GetEncoderMinPos()
Returns the min Position of the Encoder.
void setPwmLimits(byte maxppwm, byte maxnpwm)
Set the PWM limits.
TMotDYL dyl
dynamic limits
void setTPSPDegrees(double tar)
void setSpeedLimits(short positiveVelocity, short negativeVelocity)
Set speed limits.
TMotENL _encoderLimits
motor limits in encoder values
void setSpeedLimit(short velocity)
void getParameterOrLimit(int subcommand, byte *R1, byte *R2, byte *R3)
Get parameters or limits.
void setTolerance(int tolerance)
bool checkEncoderInRange(int encoder)
void setControllerParameters(byte kSpeed, byte kPos, byte kI)
Set the controller parameters.
void setPositionCollisionLimit(int limit)
Set the collision limit.
void setCalibrated(bool calibrated)
TMotSCP scp
static controller parameters
void setAccelerationLimit(short acceleration)
Set the acceleration limits.
void setInitialParameters(double angleOffset, double angleRange, int encodersPerCycle, int encoderOffset, int rotationDirection)
const int GetEncoderRange()
Returns Encoder Range of the Encoder.
TMotCLB _calibrationParameters
calibration structure
bool nmp
true if new motor parameters are implemented on the firmware
void movDegrees(double tar, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS)
Moves the motor specified by an index to a given target position in degrees.
const int GetEncoderMaxPos()
Returns the max Position of the Encoder.
TMotPVP pvp
reading motor parameters
TMotGNL gnl
motor generals
void incDegrees(double dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS)
Increments the motor specified by an index postion in degrees.
void setCrashLimit(int limit)
Set the crash limit.
TMotAPS aps
actual position
bool init(CKatBase *_own, const TMotDesc _motDesc, CCplBase *protocol)
const int GetEncoderTolerance()
void sendFourSplines(short targetPosition, short duration, std::vector< short > &coefficients)
Send four splines to the motor.
bool freedom
if it is set, it will move on a parallel movement
void setTPSP(int tar)
parallel movement
void inc(int dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS)
Increments the motor specified by an index postion in encoder units.
void dec(int dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS)
Decrements the motor specified by an index postion in encoder units.
void setDYL(TMotDYL _dyl)
void sendSpline(short targetPosition, short duration, short p1, short p2, short p3, short p4)
Send one spline to the motor.
void setCrashLimitLinear(int limit_lin)
Set the crash limit linear.
bool blocked
true if the motor was blocked due to a crash of the robot
bool checkAngleInRange(double angle)
check limits in encoder values
void resetBlocked()
unblock the motor.
void setSCP(TMotSCP _scp)
TMotTPS tps
target position
TMotInit _initialParameters
void waitForMotor(int tar, int encTolerance=100, short mode=0, int waitTimeout=TM_ENDLESS)
Waits until the Motor has reached the given targen position.
void setCalibrationParameters(bool doCalibration, short order, TSearchDir direction, TMotCmdFlg motorFlagAfter, int encoderPositionAfter)
#define TM_ENDLESS
timeout symbol for 'endless' waiting
@ MCF_FREEZE
freeze the motor
@ MCF_OFF
set the motor off
@ MSF_NORMOPSTAT
trying to follow target
@ MSF_MECHSTOP
mechanical stopper reached
@ MSF_NLINMOV
non-linear movement ended
@ MSF_MAXPOS
max. position was reached
@ MSF_LINMOV
linear movement ended
@ MSF_NOTVALID
motor data not valid
@ MSF_MOTCRASHED
motor has crashed
@ MSF_MINPOS
min. position was reached
@ MSF_DESPOS
in desired position
@ DIR_POSITIVE
search direction for the meachanical stopper
[MOT] every motor's attributes
CMotBase * arr
array of motors
TMotDesc * desc
description[]
short actpos
actual position
TMotCmdFlg mcfAPS
motor command flag
Calibration structure for single motors.
TMotCmdFlg mcf
motor flag after calibration
bool enable
enable/disable
TSearchDir dir
search direction for mech. stopper
short order
order in which this motor will be calibrated. range: 0..5
short minpos
not yet active
byte maxaccel_nmp
Maximal acceleration and deceleration.
short maxnspeed_nmp
Max. allowed reverse speed.
short maxpspeed_nmp
Max. allowed forward speed.
short maxnspeed
max. allowed reverse speed; pos!
byte maxaccel
max acceleration
short maxpspeed
max. allowed forward speed
byte maxcurr_nmp
set the maximal current
byte actcurr
actual current
byte maxdecel
max deceleration
motor description (partly)
[ENL] limits in encoder values (INTERNAL STRUCTURE!)
int enc_tolerance
encoder units of tolerance to accept that a position has been reached
int enc_minpos
motor's minimum position in encoder values
int enc_range
motor's range in encoder values
int enc_per_cycle
number of encoder units needed to complete 360 degrees;
int enc_maxpos
motor's maximum position in encoder values
CKatBase * own
parent robot
Initial motor parameters.
[PVP] position, velocity, pulse width modulation
byte pwm
pulse with modulation
TMotStsFlg msf
motor status flag
[SCP] static controller parameters
byte kD_speed
Derivative factor of the speed compensator.
byte maxnpwm_nmp
Max. value for negative voltage (0 => 0%, +70 => 100%)
byte maxppwm_nmp
Max. value for positive voltage (0 => 0%, +70 => 100%)
byte kI_speed
Integral factor of the speed compensator.
byte maxnpwm
max. val for neg. voltage; pos!
byte kpos_nmp
Proportional factor of position compensator.
byte maxppwm
max. val for pos. voltage
byte kD
derivate factor of pos comp
byte kI_nmp
Integral factor (1/kI) of control output added to the final control output.
int crash_limit_nmp
Limit of error in position.
byte kP
prop. factor of pos comp
byte kspeed_nmp
Proportional factor of speed compensator.
byte kP_speed
Proportional factor of the speed compensator.
int crash_limit_lin_nmp
Limit of error in position in linear movement.
byte version
firmware version number
byte subversion
firmware subversion number
byte revision
firmware revision number
byte subtype
firmware subtype
TMotCmdFlg mcfTPS
motor command flag
short tarpos
target position