Safe
From the Team 1432 Robotics Wiki
Revision as of 20:40, 17 May 2009 by Jacob Bandes-Storch (Talk | contribs)
Safe is a LabVIEW robot control program. Safe is currently in use on Robot 6.
Contents |
About the Program
Safe supports:
- 2-motor tank drive
- 1-motor flail ball handler
- acceleration limiting (must be enabled/disabled in code)
- speed limiting (must be enabled/disabled in code)
Control Instructions
- Safe implements tank drive. Joystick 1 controls the left side motor and Joystick 2 controls the right side motor.
- The flail is controlled via the throttle on Joystick 2.
- When acceleration limiting is enabled, the throttle on Joystick 1 controls the acceleration limit, where the "down" position allows for faster acceleration. Setting the throttle to 100% (acceleration limit 0.0) will put the robot in "cruise control" where it will lock to its current speed and will not turn or slow down.
- When acceleration limiting is enabled, the trigger of Joystick 2 will override the acceleration limit, setting the motors to the raw values from the joysticks.
- When speed limiting is enabled, the trigger of Joystick 1 disabled acceleration limiting.
The Name
Safe was originally a completely default program used for testing. When Theoretical Code stopped working, Safe was used on Robot 6. It was modified to add features, and eventually became the main program for Robot 6. Safer is now used for testing.
Implementation Specifics
Acceleration Limit
In order to limit the robot's acceleration, Safe uses a LabVIEW shift register in conjunction with the acceleration limit VI to keep track of old joystick values. The acceleration limit VI follows this procedure (for the left and right joysticks separately):
- Determine whether the previous output speed is within the range of -0.39 to 0.39. These hardcoded values are the range in which a voltage applied to the motor produces practically no movement.
- If so, limit the new joystick value to [-0.4, 0.4]. This allows instantaneous acceleration from within the [-0.39, 0.39] range to the edge of that range, so that time is not wasted smoothly accelerating when there is no movement. This results in the new output value.
- If not, determine the value by which the robot is trying to accelerate by subtracting the new joystick value from the old speed
- Limit this acceleration to the range specified by the throttle on Joystick 1.
- Add this limited acceleration to the previous speed, thus accelerating in the desired direction at a maximum based on the throttle value. This results in the new output value.
To Do
- Implement buttons for toggling speed and acceleration limiting.
- Implement control of speed limit via joystick buttons.
Changelog
See Safe/Changelog.
