
18-12-2008, 16:24
|
 |
Registered User
 FRC #3548 (RoboRavens2)
Team Role: Coach
|
|
Join Date: Sep 2004
Rookie Year: 2004
Location: Royal Oak
Posts: 406
|
|
[OCCRA]: OCCRA 2008 Drive Straight Program w/PI Control
Dear Teams,
Quote:
Originally Posted by marccenter
Dear Teams,
This is an example of a driving straight full function system with PI (proportional-integral control) based on encoder feedback to drive straight. The system uses encoders directly attached to Motor1 and Motor 2. The difference between the two encoders is used to create both a proportional and integral correction term. The proportional correction term is basically one-fourth of the encoder difference, limited to 25. The integral correction term increases or decreases by one every time through the main loop. The integral correction term is limited to plus 10 and zero. There is a base speed term used to creep forward. Motor 1 goes in the direction from 127 to zero to increase in speed. So, the final correction becomes Motor1_speed = Motor1_FwdCreep - Motor1_PropAdapt (0 to 25) - Motor1_IntegralAdapt(zero to 10). Motor2_speed is similar but goes from 127 to 254 to increase speed. The final correction becomes Motor2_speed = Motor2_Fwd_ reep + Motor2_PropAdapt (0 to 25) + Motor2_IntegralAdapt(zero to 10).
I tested the VEX robot at home on a hardwood floor with a ball transfer on the front of the robot (inverted, steel mouse ball) instead of VEX omni-wheels to enhance mechanical movement capaiblities. It drove reasonably straight on the floor for about 8 feet.
Intelitek Easy_C V2.8.0.5 licensed version was utilized.
|
__________________
Marc Center 
FIRST FRC Mentor/Coach - Team 3548 Royal Oak RoboRavens#2 - on Sabbatical 2017 season
marc.center@gmail.com
Mobile: 248-255-7377
Last edited by marccenter : 09-05-2016 at 22:11.
|