|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.lejon.util.DriveParameters
Wrapper class for control parameters of a DD drive. An instance of this class describes the drive's hardware architecture and its behavior regarding the LeJOS motor and sensor control. There is an option to use a PID controller for software-based steering. This is based on the control of the wheels' velocities. If you do not need such control you should set the PID constants to (0,0,0). The 'timeBase' parameter defines the period for position update and steering. It must always be specified. The velocities vector is used to compute the motor power when driving arbitrary curves.
Constructor Summary | |
DriveParameters(int ticksNominal,
float axleLength,
float wheelDiameter,
float gearRatio,
char motorIdLeft,
char motorIdRight,
int rotSensorIdLeft,
int rotSensorIdRight,
boolean rotSensorsReverseDirection,
boolean motorsReverseDirection,
float[] pidConstants,
int timeBase,
int maxTicksPerTimeBase,
int[] velocities)
Creates a new instance of DriveParameters. |
Method Summary | |
float |
getAxleLength()
Returns the length of steering axle of the DD in centimeter. |
float |
getDiffTicksPerDegree()
Returns the DTPD constant of the DD. |
int |
getMaxTicksPerTimeBase()
Returns the MAX_TICKS_PER_TIMEBASE constant of the drive wich defines the TICKS at power level 7 measured in a period of 'timeBase' under load. |
char |
getMotorIdLeft()
Returns the RCX port id of the left motor. |
char |
getMotorIdRight()
Returns the RCX port id of the right motor. |
int |
getMotorModeDirectionBackward()
Returns the 'aMode' value used in Motor.controlMotor() to let the motor drive its wheel in backward direction. |
int |
getMotorModeDirectionForward()
Returns the 'aMode' value used in Motor.controlMotor() to let the motor drive its wheel in forward direction. |
float |
getPIDConstantKd()
Returns the damping factor for the PID controller. |
float |
getPIDConstantKi()
Returns the integral factor for the PID controller. |
float |
getPIDConstantKp()
Returns the proportional factor for the PID controller. |
int |
getRotSensorIdLeft()
Returns the RCX port id of the left rotation sensor decremented by 1. |
int |
getRotSensorIdRight()
Returns the RCX port id of the right rotation sensor in drives decremented by 1. |
int |
getRotSensorsCountDirection()
Returns the sign of the TICKS in rotation sensors when wheel rotate in forward direction of the drive. |
float |
getTicksPerCentimeter()
Returns the TPC constant of the DD. |
float |
getTicksPerDegree()
Returns the DTPD constant of the DD. |
int |
getTimeBase()
Returns the timeBase in milliseconds for periodic control and position update. |
int[] |
getVelocityMap()
Returns the velocities vector of the drive. |
boolean |
isMotorsReverseDirection()
Returns true if wheels rotate forward when motors rotate backward. |
boolean |
isRotSensorsReverseDirection()
Returns true if rotation sensors count down when wheels rotate forward. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DriveParameters(int ticksNominal, float axleLength, float wheelDiameter, float gearRatio, char motorIdLeft, char motorIdRight, int rotSensorIdLeft, int rotSensorIdRight, boolean rotSensorsReverseDirection, boolean motorsReverseDirection, float[] pidConstants, int timeBase, int maxTicksPerTimeBase, int[] velocities)
axleLength
- the length of the steering axle in centimeter. This
is the distance between the axle points of the left and right wheel.wheelDiameter
- wheel diameter in cmgearRatio
- overall ratio of wheel gear to rotation sensor gearticksNominal
- ticks of rotation sensor by one turnaround of its shaftmotorIdLeft
- port id of left motor on RCX, one of 'A','B','C'motorIdRight
- port Id of right motor on RCX, one of 'A','B','C'rotSensorIdLeft
- port id of left rotation sensor on RCX
decremented by 1, one of 0,1,2rotSensorIdRight
- port id of right rotation sensor on RCX
decremented by 1, one of 0,1,2rotSensorsReverseDirection
- true if sensors count down when wheels
rotate forwardmotorsReverseDirection
- true if wheels rotate forward when motors
rotate backwardpidConstants
- list with the 3 PID constants (Kp, Ki, Kd)
PID controllertimeBase
- period in ms for PID controller and position updatemaxTicksPerTimeBase
- TICKS per 'timeBase' at power level 7 measured
under loadvelocities
- list of velocities in TICKS at power levels 0,1,...,7
measured in a period of 'timeBase' under loadMethod Detail |
public float getTicksPerCentimeter()
public float getDiffTicksPerDegree()
public float getTicksPerDegree()
public float getAxleLength()
public char getMotorIdLeft()
public char getMotorIdRight()
public int getRotSensorIdLeft()
public int getRotSensorIdRight()
public boolean isRotSensorsReverseDirection()
public boolean isMotorsReverseDirection()
public float getPIDConstantKp()
public float getPIDConstantKi()
public float getPIDConstantKd()
public int getTimeBase()
public int getMaxTicksPerTimeBase()
public int[] getVelocityMap()
public int getMotorModeDirectionForward()
public int getMotorModeDirectionBackward()
public int getRotSensorsCountDirection()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |