255 bool GetFreedom() {
return freedom; }
bool GetBlocked() {
return blocked; }
268 void sendAPS(
const TMotAPS* _aps);
void sendTPS(
const TMotTPS* _tps);
273 void recvPVP();
void recvSFW();
283 void setInitialParameters(
double angleOffset,
double angleRange,
int encodersPerCycle,
int encoderOffset,
int rotationDirection);
284 void setCalibrationParameters(
bool doCalibration,
short order,
TSearchDir direction,
TMotCmdFlg motorFlagAfter,
int encoderPositionAfter);
285 void setCalibrated(
bool calibrated);
287 void setTolerance(
int tolerance);
291 bool checkAngleInRange(
double angle);
292 bool checkEncoderInRange(
int encoder);
296 void inc(
int dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
299 void dec(
int dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
302 void mov(
int tar,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
306 void waitForMotor(
int tar,
int encTolerance = 100,
short mode = 0,
int waitTimeout =
TM_ENDLESS);
310 void incDegrees(
double dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
313 void decDegrees(
double dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
316 void movDegrees(
double tar,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
326 void sendSpline(
short targetPosition,
short duration,
short p1,
short p2,
short p3,
short p4);
330 void setSpeedLimits(
short positiveVelocity,
short negativeVelocity);
339 void setPwmLimits(
byte maxppwm,
byte maxnpwm);
349 void setCrashLimitLinear(
int limit_lin);
361 void getParameterOrLimit(
int subcommand,
byte* R1,
byte* R2,
byte* R3);
short actpos
actual position
TMotCmdFlg mcf
motor flag after calibration
byte actcurr
actual current
unsigned char byte
type specification (8 bit)
TMotTPS tps
target position
[PVP] position, velocity, pulse width modulation
byte maxppwm
max. val for pos. voltage
virtual bool init(const TKatGNL _gnl, const TKatMOT _mot, const TKatSCT _sct, const TKatEFF _eff, CCplBase *_protocol)
TMotPVP pvp
reading motor parameters
byte kI_speed
Integral factor of the speed compensator.
TMotInit _initialParameters
CCplBase * protocol
protocol interface
int GetEncoderMinPos()
Returns the min Position of the Encoder.
byte kD
derivate factor of pos comp
Abstract base class for protocol definiton.
TMotGNL gnl
motor generals
bool enable
enable/disable
int enc_per_cycle
number of encoder units needed to complete 360 degrees;
motor has crashed, new: collision
void setSpeedCollisionLimit(long idx, int limit)
set collision speed limits
Initial motor parameters.
non-linear movement ended, new: poly move finished
#define TM_ENDLESS
timeout symbol for 'endless' waiting
byte kD_speed
Derivative factor of the speed compensator.
CKatBase * own
parent robot
int GetEncoderTolerance()
CMotBase * arr
array of motors
byte maxppwm_nmp
Max. value for positive voltage (0 => 0%, +70 => 100%)
byte revision
firmware revision number
[ENL] limits in encoder values (INTERNAL STRUCTURE!)
bool freedom
if it is set, it will move on a parallel movement
short maxnspeed
max. allowed reverse speed; pos!
byte maxnpwm
max. val for neg. voltage; pos!
int crash_limit_lin_nmp
Limit of error in position in linear movement.
bool blocked
true if the motor was blocked due to a crash of the robot
TMotSFW sfw
slave firmware
Calibration structure for single motors.
byte subtype
slave subtype
[MOT] every motor's attributes
setPositionCollisionLimit
void setSCP(TMotSCP _scp)
TMotAPS aps
actual position
search direction for the meachanical stopper
TMotCLB _calibrationParameters
calibration structure
byte kI_nmp
Integral factor (1/kI) of control output added to the final control output.
short maxpspeed
max. allowed forward speed
short minpos
not yet active
short tarpos
target position
[SCP] static controller parameters
TMotDesc * desc
description[]
TMotDYL dyl
dynamic limits
min. position was reached, new: calibrating
void setSpeedLimit(short velocity)
byte maxcurr_nmp
set the maximal current
linear movement ended, new: moving poly, polymb full
int enc_minpos
motor's minimum position in encoder values
int crash_limit_nmp
Limit of error in position.
TMotSCP scp
static controller parameters
const TMotInit * GetInitialParameters()
short order
order in which this motor will be calibrated. range: 0..5
int enc_maxpos
motor's maximum position in encoder values
TSearchDir dir
search direction for mech. stopper
byte kP_speed
Proportional factor of the speed compensator.
TMotStsFlg msf
motor status flag
motor description (partly)
void setCrashLimit(long idx, int limit)
set collision limits
byte maxdecel
max deceleration
max. position was reached, new: unused
int GetEncoderRange()
Returns Encoder Range of the Encoder.
TMotCmdFlg mcfAPS
motor command flag
TKatGNL gnl
katana general
byte maxaccel_nmp
Maximal acceleration and deceleration.
byte maxaccel
max acceleration
byte subversion
firmware subversion number
byte maxnpwm_nmp
Max. value for negative voltage (0 => 0%, +70 => 100%)
trying to follow target, new: moving (polymb not full)
void setDYL(TMotDYL _dyl)
int enc_range
motor's range in encoder values
TMotCmdFlg mcfTPS
motor command flag
int GetEncoderMaxPos()
Returns the max Position of the Encoder.
byte pwm
pulse with modulation
byte kP
prop. factor of pos comp
short maxpspeed_nmp
Max. allowed forward speed.
int enc_tolerance
encoder units of tolerance to accept that a position has been reached
byte version
firmware version number
byte kpos_nmp
Proportional factor of position compensator.
in desired position, new: fixed, state holding
short maxnspeed_nmp
Max. allowed reverse speed.
TMotENL _encoderLimits
motor limits in encoder values
mechanical stopper reached, new: unused (default value)
byte kspeed_nmp
Proportional factor of speed compensator.