pltw california state conference february 19, 2015 colin smith [email protected] centennial...
TRANSCRIPT
PLTW CALIFORNIA STATE CONFERENCEFEBRUARY 19, 2015
COLIN [email protected]
CENTENNIAL HIGH SCHOOLBAKERSFIELD, CA
Advanced RobotC Programming Topics
Multi-Tasking
Limitations of Linear programming
Users must be careful with what control structures are being used.
Adding tasks to control different motors/sensors
Sensors can be shared, motors shouldn't
Implementing Multitasking
Works like function declaration
Task can be started or stopped within main() using the StartTask or StopTask functions.
continued
Finally, the task must be defined
Use of Multi-tasking
• Allows multiple actions to occur ‘simultaneously’• Materials sorter• Emergency shutoff• StopAllTasks function
Proportional Control
Use variables for iterative control of motor speeds
Sensors are required for continuous input
A target value is set and is used to control the speed of the motor(s)
Error
Inside a loop, the ‘distance’ to the target is used to determine the speed of the motor.
This distance to target is often referred to as the error
Proportionality
Instead of a 1:1 ratio between the error and the motor speed, there is often a proportionality constant used to ‘tune’ the response of the motor.
Tuning the Proportionality constant
Code – traditional motor control
Proportional Lift
Additional Resources
• www.vexforum.com• www.robotc.net/education/training/vex/• www.robotc.net/forums/• www.robotc.net/support/webhelpfiles/• www.youtube.com