|
RIT VEXU Core API
|
#include <flywheel.h>
Public Member Functions | |
| Flywheel (vex::motor_group &motors, Feedback &feedback, FeedForward &helper, const double ratio, Filter &filt) | |
| double | get_target () const |
| Return the current value that the target_rpm should be set to. | |
| double | getRPM () const |
| return the velocity of the flywheel | |
| vex::motor_group & | get_motors () const |
| Returns the motors. | |
| void | spin_manual (double speed, vex::directionType dir=vex::fwd) |
| void | spin_rpm (double rpm) |
| void | stop () |
| stop the RPM thread and the wheel | |
| bool | is_on_target () |
| check if the feedback controller thinks the flywheel is on target | |
| AutoCommand * | SpinRpmCmd (int rpm) |
| Creates a page displaying info about the flywheel. | |
| AutoCommand * | WaitUntilUpToSpeedCmd () |
| Creates a new auto command that will hold until the flywheel has its target as defined by its feedback controller. | |
Friends | |
| int | spinRPMTask (void *wheelPointer) |
| Runs a thread that keeps track of updating flywheel RPM and controlling it accordingly. | |
a Flywheel class that handles all control of a high inertia spinning disk It gives multiple options for what control system to use in order to control wheel velocity and functions alerting the user when the flywheel is up to speed. Flywheel is a set and forget class. Once you create it you can call spin_rpm or stop on it at any time and it will take all necessary steps to accomplish this
| Flywheel::Flywheel | ( | vex::motor_group & | motors, |
| Feedback & | feedback, | ||
| FeedForward & | helper, | ||
| const double | ratio, | ||
| Filter & | filt ) |
Create the Flywheel object using PID + feedforward for control.
| motors | pointer to the motors on the fly wheel |
| feedback | a feedback controleller |
| helper | a feedforward config (only kV is used) to help the feedback controller along |
| ratio | ratio of the gears from the motor to the flywheel just multiplies the velocity |
| filter | the filter to use to smooth noisy motor readings |
| vex::motor_group & Flywheel::get_motors | ( | ) | const |
Returns the motors.
| double Flywheel::get_target | ( | ) | const |
Return the current value that the target_rpm should be set to.
Return the target_rpm that the flywheel is currently trying to achieve
|
inline |
check if the feedback controller thinks the flywheel is on target
| void Flywheel::spin_manual | ( | double | speed, |
| vex::directionType | dir = vex::fwd ) |
Spin motors using voltage; defaults forward at 12 volts FOR USE BY OPCONTROL AND AUTONOMOUS - this only applies if the target_rpm thread is not running
| speed | - speed (between -1 and 1) to set the motor |
| dir | - direction that the motor moves in; defaults to forward |
Spin motors using voltage; defaults forward at 12 volts FOR USE BY OPCONTROL AND AUTONOMOUS - this only applies if the RPM thread is not running
| speed | - speed (between -1 and 1) to set the motor |
| dir | - direction that the motor moves in; defaults to forward |
| void Flywheel::spin_rpm | ( | double | input_rpm | ) |
starts or sets the target_rpm thread at new value what control scheme is dependent on control_style
| rpm | - the target_rpm we want to spin at |
starts or sets the RPM thread at new value what control scheme is dependent on control_style
| input_rpm | - set the current RPM |
|
inline |
Creates a page displaying info about the flywheel.
/**
Creates a new auto command to spin the flywheel at the desired velocity
| rpm | the rpm to spin at |
| void Flywheel::stop | ( | ) |
stop the RPM thread and the wheel
Stops the motors. If manually spinning, this will do nothing just call spin_mainual(0.0) to send 0 volts
|
inline |
Creates a new auto command that will hold until the flywheel has its target as defined by its feedback controller.