rec::robotino::com::Motor Class Reference

Represents a single motor. More...

#include <Motor.h>

List of all members.

Public Member Functions

void setMotorNumber (unsigned int number)
void setSpeedSetPoint (float speed)
void resetPosition ()
void setBrake (bool brake)
void setPID (unsigned char kp, unsigned char ki, unsigned char kd)
float actualVelocity () const
int actualPosition () const
float motorCurrent () const
unsigned short rawCurrentMeasurment () const

Static Public Member Functions

static unsigned int numMotors ()


Detailed Description

Represents a single motor.

Member Function Documentation

static unsigned int rec::robotino::com::Motor::numMotors (  )  [static]

Returns:
Returns the number of drive motors on Robotino
Exceptions:
nothing 

void rec::robotino::com::Motor::setMotorNumber ( unsigned int  number  ) 

Sets the number of this motor.

Parameters:
number number of this motor
Exceptions:
RobotinoException if the current communication object is invalid.

void rec::robotino::com::Motor::setSpeedSetPoint ( float  speed  ) 

Sets the setpoint speed of this motor.

Parameters:
speed Set point speed in rpm.
Exceptions:
RobotinoException if the current communication object is invalid.

void rec::robotino::com::Motor::resetPosition (  ) 

Resets the position of this motor.

Exceptions:
RobotinoException if the current communication object is invalid.

void rec::robotino::com::Motor::setBrake ( bool  brake  ) 

Controls the brakes of this motor.

Parameters:
brake If set to TRUE, the speed set-point is constantly set to 0. If set to FALSE, the speed set-point can be set by setSpeedSetPoint.
Exceptions:
RobotinoException if the current communication object is invalid.

void rec::robotino::com::Motor::setPID ( unsigned char  kp,
unsigned char  ki,
unsigned char  kd 
)

Sets the proportional, integral and differential constant of the PID controller. The range of values is from 0 to 255. These values are scaled by the microcontroller firmware to match with the PID controller implementation. If 255 is given, the microcontroller firmware uses its build in default value.

Parameters:
kp proportional constant. Typical value 200.
ki integral constant. Typical value 10.
kd differential constant. Typical value 0.
Exceptions:
RobotinoException if the current communication object is invalid.

float rec::robotino::com::Motor::actualVelocity (  )  const

Retrieves the actual speed of this motor.

Returns:
Speed in rpm.
Exceptions:
RobotinoException if the current communication object is invalid.

int rec::robotino::com::Motor::actualPosition (  )  const

Retrieves the actual position of this motor.

Returns:
actual position
Exceptions:
RobotinoException if the current communication object is invalid.

float rec::robotino::com::Motor::motorCurrent (  )  const

Retrieves the current of this motor.

Returns:
motor current in A.
Exceptions:
RobotinoException if the current communication object is invalid.

unsigned short rec::robotino::com::Motor::rawCurrentMeasurment (  )  const

The current is measured by a 10 bit adc and is not converted into A.

Returns:
The current delivered by to this motor. Range from 0 to 1023 with I/O board version 1.x. I/O board version 2 uses a 12bit ADC. Range is then [0;4098].
Exceptions:
RobotinoException if the current communication object is invalid.


The documentation for this class was generated from the following file:

Generated on Wed Jun 29 04:16:56 2011 for rec::robotino::com by  doxygen 1.5.5