|
RobotCore 1.0
WPILib port to raspberry Pi
|
Smart motor controller class. More...
Classes | |
| enum | SmartMotorType |
| Specifies the type of motor. More... | |
| enum | SmartMotorMode |
| Specifies the type of control. More... | |
Public Member Functions | |
| SmartMotor (SmartMotorType type, int pwmPin, int dirPin) | |
| SmartMotor (SmartMotorType type, int pwmPin, int dirPin, int i2cAddr) | |
| SmartMotor (int pin, int min, int zero, int max) | |
| SmartMotor (int pin, int min, int zero, int max, int i2cAddr) | |
| void | setMaxSpeed (double maxSpeed) |
| void | set (double value) |
| void | setFeedbackDevice (Encoder encoder) |
| Encoder | getFeedbackDevice () |
| void | setControlMode (SmartMotorMode mode) |
| void | setFTerm (double f) |
| void | setITerm (double i) |
| void | setPTerm (double p) |
| void | setIZone (double z) |
| void | setInverted (boolean invert) |
| void | setDTerm (double d) |
| void | setMinPower (double minPower) |
| void | setDeadZone (double deadZone) |
Smart motor controller class.
This class serves as the base class for the different types of motors It can handle advanced motor control using PID to control of the motor speed.
Definition at line 24 of file SmartMotor.java.
| robotCore.SmartMotor.SmartMotor | ( | SmartMotorType | type, |
| int | pwmPin, | ||
| int | dirPin ) |
Creates an instance of a PWM duty cycle motor using 1 or 2 pins
| type | - Specifies the type of motor |
| pwmPin | - Specifies the pin for the PWM signal |
| dirPin | - Specifies the pin for the direction control. If this value is zero then only the pwmPin is used and the motor cannot be reversed. |
Definition at line 279 of file SmartMotor.java.
| robotCore.SmartMotor.SmartMotor | ( | ) |
Definition at line 284 of file SmartMotor.java.
| robotCore.SmartMotor.SmartMotor | ( | SmartMotorType | type, |
| int | pwmPin, | ||
| int | dirPin, | ||
| int | i2cAddr ) |
Creates instance of a PWM duty cycle motor using 1 or 2 pins when the motor is connected to an auxiliary Arduino via i2c
| type | - Specifies the type of motor |
| pwmPin | - Specifies the pin for the PWM signal |
| dirPin | - Specifies the pin for the direction control. If this value is zero then only the pwmPin is used and the motor cannot be reversed. |
| i2cAddr | - Specifies the address of the i2c connected Arduino |
Definition at line 299 of file SmartMotor.java.
| robotCore.SmartMotor.SmartMotor | ( | int | pin, |
| int | min, | ||
| int | zero, | ||
| int | max ) |
Creates an instance of a servo style motor
| pin | - Specifies the pin servo signal |
| min | - Specifies the minimum (full reverse) PWM time in ms |
| zero | - Specifies the zero (stop) PWM time in ms. |
| max | - Specifies the max (full forward) PWM time in ms. |
Definition at line 311 of file SmartMotor.java.
| robotCore.SmartMotor.SmartMotor | ( | int | pin, |
| int | min, | ||
| int | zero, | ||
| int | max, | ||
| int | i2cAddr ) |
Creates instance of a servo style motor when the motor is connected to an auxiliary Arduino via i2c
| pin | - Specifies the pin servo signal |
| min | - Specifies the minimum (full reverse) PWM time in ms |
| zero | - Specifies the zero (stop) PWM time in ms. |
| max | - Specifies the max (full forward) PWM time in ms. |
| i2cAddr | - Specifies the address of the i2c connected Arduino |
Definition at line 325 of file SmartMotor.java.
| Encoder robotCore.SmartMotor.getFeedbackDevice | ( | ) |
Definition at line 415 of file SmartMotor.java.
| void robotCore.SmartMotor.set | ( | double | value | ) |
| value | - Sets either the power, speed or position depending on the current mode. If the motor is in power mode, this should be in the range -1 to +1. If the motor is in speed mode, then this should either be the desired speed in encoder units, or -1 to +1 if the maxSpeed value has been set. If the motor is in position mode, the value should be the desired position in encoder units (i.e. NOT degrees) |
Definition at line 349 of file SmartMotor.java.
| void robotCore.SmartMotor.setControlMode | ( | SmartMotorMode | mode | ) |
| mode | - Sets the current control mode. |
Definition at line 423 of file SmartMotor.java.
| void robotCore.SmartMotor.setDeadZone | ( | double | deadZone | ) |
| minDeadZone | - For positional control specifies the max error to be considered on target. This value should be in encoder units (i.e. NOT degrees) |
Definition at line 518 of file SmartMotor.java.
| void robotCore.SmartMotor.setDTerm | ( | double | d | ) |
| d | - Specifies the derivative term for the PID control. |
Definition at line 490 of file SmartMotor.java.
| void robotCore.SmartMotor.setFeedbackDevice | ( | Encoder | encoder | ) |
| encoder | - Specifies the feedback device to be used to control the speed. |
Definition at line 404 of file SmartMotor.java.
| void robotCore.SmartMotor.setFTerm | ( | double | f | ) |
| f | - Specifies the 'feed forward' term for the PID control. |
Definition at line 437 of file SmartMotor.java.
| void robotCore.SmartMotor.setInverted | ( | boolean | invert | ) |
| invert | - If true then the direction of the motor is reversed |
Definition at line 482 of file SmartMotor.java.
| void robotCore.SmartMotor.setITerm | ( | double | i | ) |
| i | - Specifies the integral term for the PID control. |
Definition at line 449 of file SmartMotor.java.
| void robotCore.SmartMotor.setIZone | ( | double | z | ) |
| z | - Specifies the I Zone term for the PID control. This is the region outside of which, the I term is ignored. |
Definition at line 474 of file SmartMotor.java.
| void robotCore.SmartMotor.setMaxSpeed | ( | double | maxSpeed | ) |
| maxSpeed | - Specifies the maximum speed of the motor. Setting this value allows control of the speed using the range -1 to +1 similar to when the motor is controlled by power. |
Definition at line 335 of file SmartMotor.java.
| void robotCore.SmartMotor.setMinPower | ( | double | minPower | ) |
| minPower | - Specifies the minimum power needed to get the motor to run |
Definition at line 508 of file SmartMotor.java.
| void robotCore.SmartMotor.setPTerm | ( | double | p | ) |
| p | - Specifies the proportional term for the PID control. |
Definition at line 461 of file SmartMotor.java.