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();
296 void setTPSP(
int tar);
297 void setTPSPDegrees(
double tar);
void resetTPSP();
304 void setInitialParameters(
double angleOffset,
double angleRange,
int encodersPerCycle,
int encoderOffset,
int rotationDirection);
305 void setCalibrationParameters(
bool doCalibration,
short order,
TSearchDir direction,
TMotCmdFlg motorFlagAfter,
int encoderPositionAfter);
306 void setCalibrated(
bool calibrated);
308 void setTolerance(
int tolerance);
312 bool checkAngleInRange(
double angle);
313 bool checkEncoderInRange(
int encoder);
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);
327 void waitForMotor(
int tar,
int encTolerance = 100,
short mode = 0,
int waitTimeout =
TM_ENDLESS);
331 void incDegrees(
double dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
334 void decDegrees(
double dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
337 void movDegrees(
double 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);
358 void setSpeedLimits(
short positiveVelocity,
short negativeVelocity);
363 void setAccelerationLimit(
short acceleration );
367 void setPwmLimits(
byte maxppwm,
byte maxnpwm);
371 void setControllerParameters(
byte kSpeed,
byte kPos,
byte kI);
377 void setCrashLimitLinear(
int limit_lin);
389 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
TMotPVP pvp
reading motor parameters
byte kI_speed
Integral factor of the speed compensator.
TMotInit _initialParameters
CCplBase * protocol
protocol interface
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;
const int GetEncoderTolerance()
void setSpeedCollisionLimit(long idx, int limit)
set collision speed limits
Initial motor parameters.
non-linear movement ended
#define TM_ENDLESS
timeout symbol for 'endless' waiting
byte kD_speed
Derivative factor of the speed compensator.
CKatBase * own
parent robot
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!
bool nmp
true if new motor parameters are implemented on the firmware
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
firmware subtype
[MOT] every motor's attributes
void setSCP(TMotSCP _scp)
const int GetEncoderMaxPos()
Returns the max Position of the Encoder.
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
void setSpeedLimit(short velocity)
byte maxcurr_nmp
set the maximal current
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
CCplBase * protocol
protocol interface
const 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
void setPositionCollisionLimit(long idx, int limit)
set collision position limits
byte subversion
firmware subversion number
byte maxnpwm_nmp
Max. value for negative voltage (0 => 0%, +70 => 100%)
void setDYL(TMotDYL _dyl)
int enc_range
motor's range in encoder values
TMotCmdFlg mcfTPS
motor command flag
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.
short maxnspeed_nmp
Max. allowed reverse speed.
TMotENL _encoderLimits
motor limits in encoder values
mechanical stopper reached
byte kspeed_nmp
Proportional factor of speed compensator.
const int GetEncoderMinPos()
Returns the min Position of the Encoder.
virtual bool init(const TKatGNL _gnl, const TKatMOT _mot, const TKatSCT _sct, const TKatEFF _eff, CCplBase *_protocol)