|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Usage of the gyro
Did any teams use the gyro this year for a purpose? If so, what for?
|
|
#2
|
|||||
|
|||||
|
We use the gyro as part of our autonomous mode. It is interfaced into our custom circuit board (Motorola HC08 micro) to give us position data along with a rotation sensor on one of our wheels.
|
|
#3
|
|||||
|
|||||
|
... And 111 did very well with it. I'd say using that techology and then the wilddraw interface, they have one of the best autonomous systems out there.
![]() As with many input devices, it's a little hard to get them to work a first, but once you've got it, they're awesome. |
|
#4
|
|||
|
|||
|
Our team used the gyro to detect angular changes associated with traversing up the ramp in autonomous mode. That is how our robot knows to stop at the top of the hill after it brings down the tote boxes. When the human player takes control, he is ready to reverse and knock down the remaining stacks.
|
|
#5
|
||||
|
||||
|
Team 647 used the gyro in autonomous mode to make nice, consistent turns during auto. We didn't use any other electronics or custom circuits to integrate the yaw rate for angular position. Instead, we connected the gyro output directly to one of the analog sensor inputs. By doing a little math we determine that by sampling the gyro count each program loop, and accumulating the count in a 16 bit counter, that after 5263 counts we had made a 90 degree right turn. For a left turn we initialized the counter at 10,000 and decremented the count down by the same number of counts. It works very consistently, and doesn't seem to be very noise sensitive.
After Nats I'll write up a little paper about how it works. Bruce C. Wednesday night, in Houston, looking forward to tomorrow. |
|
#6
|
||||
|
||||
|
647 - excellent - we did the same thing
I hope you also subtracted 127 from the gyro signal each time - to normalize it to zero :c) team 578 used the gyro for two things - we integrated it like 647 stated, the result is a 'compass heading' in a 16bit register. We also used the gyro signal for closed loop steering. Instead of taking the joystick X signal as the steering command to the motors, we subtracted the gyro output from the joystick X signal. This told us the difference between what the driver wants the robot to do, and what its actully Doing! We then used this 'error' signal to command the voltages to the motors. This made our robot steer like a giant servo - if you pushed the joystick slightly left, the robot turned left at a very slow and steady rate - if you pushed it hard left it turned left at the max rate of the gyro (about 75° per second) and the great part - if you are telling the robot to go straight, and something tries to nudge it off course, or a wheel slips on the ramp, then the closed loop feedback corrects the power to the wheels 40 times a second to keep the robot going exactly where the driver commands it too. We also used it in auton mode - but instead of the joystick X signal, we preprogrammed the direction. the bot stayed on course, no matter what it hit. This is the first time our team used closed loop feedback for steering - its AWESOME! |
|
#7
|
||||
|
||||
|
for those of you who only speak PBasic, here is our code for closed loop steering - it uses the one joystick code to control the motors. Yaw is the signal from the Gyro (BTW the gyro was upside down on our bot)
'---------- 1 Joystick Drive --------------------------------------------------------- '********************Gyro yaw rate closed loop steering *************************** 'compairs gyro signal to p1_x steering command to close the steering loop if p1_sw_top=0 then gyro_override 'when button is pressed then close loop AD: 'line following code jumps into here yaw_error = (((2127 + p1_x - yaw) Min 2000 Max 2254)-2000) yaw_command =(((1873 + yaw_error + yaw_error) Min 2000 Max 2254) -2000) goto gyro_end gyro_override: yaw_command=p1_x gyro_end: '************************************************* *********************** ' This code mixes the Y and X axis on Port 1 to allow one joystick drive. ' Joystick forward = Robot forward ' Joystick backward = Robot reverse ' Joystick right = Robot rotates right ' Joystick left = Robot rotates left ' Connect the left drive motors to PWM15 and/or PWM16 ' Connect the right drive motors to PWM13 and/or PWM14 'NOTE: p1_x = 0 at full right, 255 at full left drive_R = (((1873 + p1_y + yaw_command) Min 2000 Max 2254) - 2000) drive_L = (((2127 + p1_y - yaw_command) Min 2000 Max 2254) - 2000) |
|
#8
|
||||
|
||||
|
and here is the code to use the gyro as a compass heading. angle is a VAR WORD (16 bits) and it should be initialized to 32,000 or some other number in the middle of its range
'*************update auto_mode time counter and angle integration********************** auto_time=auto_time+delta_t+1 'increment loop counter, including any missed loops angle=angle+yaw-128 'add yaw sensor reading to angle integration angle1: if delta_t=0 then angle2 'add yaw againg for eact count of delta_t angle=angle+yaw-128 delta_t=delta_t-1 goto angle1 angle2: |
|
#9
|
||||
|
||||
|
The line:
yaw_command =(((1873 + yaw_error + yaw_error) Min 2000 Max 2254) -2000) contains yaw_error+yaw_error instead of yaw_error+p1_x on purpose, correct? Does it serve only to amplify the corrective measures that it takes when not turning fast enough (or too fast)? Also: Is the difference between the gyro's output and 127 a "linear interpolation" from 0 degrees/sec to ~75 degrees/sec? ALSO also: Have there been any successful implementations of an accellerometer with a FIRST robot? Last edited by Caleb Fulton : 10-04-2003 at 15:17. |
|
#10
|
||||
|
||||
|
your interpretation is correct - In technical terms, this is a proportional feedback loop with a gain of two (the errror signal is added twice = 2X gain)
i f your bot is jittery (shakey) with 2X try it with 1X gain instead. and yes, the yaw sensor is linear from -75°/sec to +75°/S with 127 (or 128) being zero (not turning) thats why you subtract 128 each time you integrate it - if the bot is not turning then 'angle' will stay the same. |
|
#11
|
||||
|
||||
|
PS - dont forget we had our sensor mounted upsidedown on the chassis - if you have the feedback backwards then the bot will go open loop on you (as soon as you tell it to turn a little, it will turn at full speed and not stop until you cross the zero point - not a good thing to do to your drive train).
|
|
#12
|
||||
|
||||
|
Thanks for the info!
I'm still not clear on how the output relates to the angular rate...Is it, in fact, linear? |
|
#13
|
|||
|
|||
|
Gyro
Team 116 also used the gyro. We intigrated it with a PBasic Stamp prossor to take load off the main prosser. It worked very well. In fact in a week or two we will be posting a white paper on the system.
|
|
#14
|
|||
|
|||
|
Gunn Robotics Team (192) used the GyroChip as part of their positioning system, I believe. They have some super-awsome custom circuit boards, and won leadership in control in Arizona. They're in Houston right now, so if you're in Houston too, be sure to stop by their pit and ask for a tour!
|
|
#15
|
||||
|
||||
|
Here's a quick little description of the method team 647 used to read the gyro and make nice consistent 90 degree turns. It's a little rough as it's pieced together from some emails here on my laptop and done here in the hotel room in Houston after practice day. I'll try to write up something a little more coherent when we get home.
We gave this explanation to our student programmer, and he ran off and started writing autonomous code, and we mentors haven't caught up with him since! Bruce C. Engineering Mentor Team 647 CyberWolves 2003 Lone Star Regional Winner |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| gyro code | odin892 | Programming | 2 | 08-04-2003 14:50 |
| Team 469 and the Gyro | archiver | 2001 | 0 | 24-06-2002 02:57 |
| This Gyro is driving me crazy! | archiver | 2001 | 2 | 23-06-2002 23:35 |
| Is any team using the gyro chip? | Ragin_Kage | Kit & Additional Hardware | 4 | 10-04-2002 12:11 |
| Have YOU used the gyro chip? | FotoPlasma | Technical Discussion | 10 | 31-01-2002 13:26 |