Quote:
|
Originally Posted by doyler
... 2 servos, ... and something called a BEI GyroChip
... how would i hook up the rest of the stuff to the control
|
The servos plug into any PWM available on your controller. Setting the value (0-254) of the PWM will turn the servo to a particular spot. The same spot everytime you use a particular value.
The gyro plugs into an analog input on the controller (one of the first inputs based on User_Initialization() in user_routines.c). If it doesn’t already have a connector attached you’ll have to make one out of a PWM cable. You get values from it doing something like “x = Get_Analog_Value(rc_ana_in01);“ The neutral position of the gyro will be close to 512. When the gyro is twisted slowly in one direction you’ll get numbers between 0 and 512 only while you are twisting it. Do the same in the other direction and you’ll get numbers between 512 and 1023. If you keep track of these numbers you can tell if your robot is driving straight or not and correct. It can also be used to make precise turns, to say 45 degrees if you calibrated it.
This particular gyro is no longer "street legal" to use on your competition robot, but it's good to learn with. This one will be overly sensitive to turns or sudden movements that are too quick, and will more easily lose track of the original robot heading.
Do a search on “gyro” for a lot of threads on the subject.