PiStormsMotor: This class provides functions for motor control.
More...
PiStormsMotor: This class provides functions for motor control.
def PiStorms.PiStormsMotor.brake |
( |
|
self | ) |
|
Stop the motor abruptly with brake.
- Parameters
-
def PiStorms.PiStormsMotor.brakeSync |
( |
|
self | ) |
|
Stop both the motors of said bank at the same time.
motors are stopped with a brake. You can call this function on any motor of that bank and it will work on both motors of that bank.
- Parameters
-
def PiStorms.PiStormsMotor.float |
( |
|
self | ) |
|
Stop the motor smoothly with float.
- Parameters
-
def PiStorms.PiStormsMotor.floatSync |
( |
|
self | ) |
|
Stop both the motors of said bank at the same time.
motors are stopped smoothly with float You can call this function on any motor of that bank and it will work on both motors of that bank.
- Parameters
-
def PiStorms.PiStormsMotor.hold |
( |
|
self | ) |
|
Stop the motor abruptly and hold the current position.
- Parameters
-
def PiStorms.PiStormsMotor.isBusy |
( |
|
self | ) |
|
Check if the motor is running.
- Parameters
-
def PiStorms.PiStormsMotor.isOverloaded |
( |
|
self | ) |
|
Check if the motor is overloaded.
- Parameters
-
def PiStorms.PiStormsMotor.isStalled |
( |
|
self | ) |
|
Check if the motor is stalled.
- Parameters
-
def PiStorms.PiStormsMotor.pos |
( |
|
self | ) |
|
Returns the current encoder position of the motor.
- Parameters
-
def PiStorms.PiStormsMotor.resetPos |
( |
|
self | ) |
|
Resets the encoder position of the specified motor.
- Parameters
-
def PiStorms.PiStormsMotor.runDegs |
( |
|
self, |
|
|
|
degs, |
|
|
|
speed = 100 , |
|
|
|
brakeOnCompletion = False , |
|
|
|
holdOnCompletion = False |
|
) |
| |
Run the motor for a specific amount of degrees.
- Parameters
-
self | The object pointer. |
degs | The number of degrees to run the motor. |
speed | The speed at which to turn the motor. |
brakeOnCompletion | Choose to brake or float the motor upon completion with True (brake) or False (float). |
holdOnCompletion | Choose to hold the motor position upon completion with True (hold) or False (release). |
def PiStorms.PiStormsMotor.runSecs |
( |
|
self, |
|
|
|
secs, |
|
|
|
speed, |
|
|
|
brakeOnCompletion = False |
|
) |
| |
Run the motor for a specific time in seconds.
- Parameters
-
self | The object pointer. |
secs | The number of seconds to run the motor. |
speed | The speed at which to turn the motor. |
brakeOnCompletion | Choose to brake or float the motor upon completion with True (brake) or False (float). |
def PiStorms.PiStormsMotor.SetPerformanceParameters |
( |
|
self, |
|
|
|
Kp_tacho, |
|
|
|
Ki_tacho, |
|
|
|
Kd_tacho, |
|
|
|
Kp_speed, |
|
|
|
Ki_speed, |
|
|
|
Kd_speed, |
|
|
|
passcount, |
|
|
|
tolerance |
|
) |
| |
Set the motor PID parameters (PiStorms PID parameters are default for NXT/EV3 motors).
Only one set of PID parameters can be set per bank and will reset to default upon new power cycle
- Parameters
-
self | The object pointer. |
Kp_tacho | Proportional-gain of the encoder position of the motor. |
Ki_tacho | Integral-gain of the encoder position of the motor. |
Kd_tacho | Derivative-gain of the encoder position of the motor. |
Kp_speed | Proportional-gain of the speed of the motor. |
Ki_speed | Integral-gain of the speed of the motor. |
Kd_speed | Derivative-gain of the speed of the motor. |
passcount | The number of times the encoder reading should be within tolerance. |
tolerance | The tolerance (in ticks) for encoder positioning . |
def PiStorms.PiStormsMotor.setSpeed |
( |
|
self, |
|
|
|
speed |
|
) |
| |
Run the motor at a set speed for an unlimited duration.
- Parameters
-
self | The object pointer. |
speed | The speed at which to turn the motor. |
def PiStorms.PiStormsMotor.setSpeedSync |
( |
|
self, |
|
|
|
speed |
|
) |
| |
Run the two motors of the said bank in sync with each other.
at a set speed for an unlimited duration You can call this function on any motor of that bank and it will work on both motors of that bank.
- Parameters
-
self | The object pointer. |
speed | The speed at which to turn the motors |
def PiStorms.PiStormsMotor.waitUntilNotBusy |
( |
|
self, |
|
|
|
timeout = -1 |
|
) |
| |
Wait until the motor is no longer running.
- Parameters
-
self | The object pointer. |
timeout | The timeout value as a factor of 10ms. |
The documentation for this class was generated from the following file: