![]() |
Large amounts of gyro drift
I'm trying to use the KOP Gyro to control our orientation during auton, but the angle is drifting a lot without the robot moving.
This makes our robot drive in curves, and not in straight lines. We're not doing anything funky programming-wise, the drift is observable with barebones code Code:
from wpilib import SampleRobot, run, Gyro, Timer, SmartDashboardAny ideas? We've already checked our gyro's pwm cable. |
Re: Large amounts of gyro drift
Are you letting the gyro calibrate correctly? You need to make sure the robot does not move at all during the calibration process, which occurs when you construct the gyro object and takes 5 seconds.
|
Yep, robot is totally still for calibration.
|
Re: Large amounts of gyro drift
we had some really bad problems with this. Turned out that the signal wire to the gyro was going right by a cim, and speed controller. The RF noise was just enough to get the gyro to drift. We replaced the signal cable with a shielded one and all our problems were gone.
Hope this helps :) |
Re: Large amounts of gyro drift
Gyros drift naturally overtime. Numerous ways to deal with this: You can re-zero constantly; you can assume drift overtime and compensate in your code; you can combine data with an accelerometer and/or magnet heading.
See "Drift" here: http://www.phidgets.com/docs/Gyroscope_Primer and here: http://www.instructables.com/id/Guid...Arduino-inclu/ |
Re: Large amounts of gyro drift
I have no financial interest in AndyMark or Kauai Labs but we are using the navX MXP Robotics Navigation Sensor and we LOVE it.
I was a complete skeptic when the coding team insisted that we could do Field Centric driving using our Wild Swerve modules. But after looking into it, asking a real roboticist that I am lucky enough to work with, and, most importantly, after seeing it work on Rover (Overclocked's fall "Practice Project"), I am a complete and total fanboy. The navX MXP is amazing. If you are not using it, you should be. It takes the literal "rocket science" technology from InvenSence IMU and puts it in an beautiful and well behaved (and Open Source/Open Hardware) wrapper. IT IS AMAZING. If you are using a gyro and you're not using a navX, I think you're missing the boat. Free advice, worth every penny. Dr. Joe J. P.S. They claim 1 degree per minute drift. Again, I was skeptical but I think actually, in most cases, they do better than that. We will often practice for 20 minutes and stop because the motors are hot or the battery is dead not because we need to rezero the gyro. YMMV but that is our experience. |
Re: Large amounts of gyro drift
We're using python + KOP gyro, and it works fine for me.
I've had issues with gyros in past years drifting too much... I think it's just something that's particular to some gyros. Make sure you're actually using the same gyro that the WPILib is expecting you to use. If the volts per g parameter is wrong, then you'll get behavior similar to what you're describing. |
Re: Large amounts of gyro drift
Here is some calibration code I found here on Chielf Delphi. It basically involves adjusting the sensitivity with the gyro sitting still so that it doesn't change. It seems to help, although I don't know how accurate it was after changing the sensitivity.
Code:
void CalibrateGyro() |
Re: Large amounts of gyro drift
Quote:
|
Re: Large amounts of gyro drift
We had similar drift issues and the most important things to do are:
1) ensuring a stable, secure, level mounting of the gyro 2) making certain that the gyro is perfectly still when it's being calibrated (as was already mentioned). We were drifting around 1-3 degrees per second before mounting the gyro properly. Afterward, we had a drift of maybe 5 degrees after driving for a couple of minutes. |
Re: Large amounts of gyro drift
Quote:
Our robot for this year's game is not a huge current hog. We have 14 motors yes, but the Gripper & Pusher motors are off literally 95% of the time, the three arm motors and the lift motor are nearly perfectly counter balanced and the three wheels are never scrubbing because they are always pointed in the direction of travel with respect to the ground (thanks to the awesome programming of Paul, Michael, & Owen -- you guys are rock stars!). The motors that get hottest, believe it or not, are the three swerve motors. Don't know if that answers your question, but that's all I've got... Dr. Joe J. |
Re: Large amounts of gyro drift
Quote:
I didn't want rookie readers to be left with the impression that you drain the batteries until the robot stops working. Deep discharging is enemy #1 of lead acid batteries. |
Re: Large amounts of gyro drift
Quote:
|
Re: Large amounts of gyro drift
Triple check that the analog port you are plugged into matches what port the software is looking at. A slowly changing input value is exactly what you would see on an open-circuited analog input channel.
|
Re: Large amounts of gyro drift
Quote:
|
Re: Large amounts of gyro drift
@lark95: where do you get *shielded* PWMs? or do you make your own?
|
Re: Large amounts of gyro drift
We improved out gyro performance doing two things:
1. We re-run the calibration code from the gyro constructor at the beginning of autonomous: Code:
m_analog->InitAccumulator();I think the culprit is lack of temperature compensation. The gyro specifically has a temperature output to allow compensation and that has not been implemented. By delaying the calibration until the start of autonomous, we are allowing the gyro temperature to stabilize in the operating environment. Note: we are actually programming in LabVIEW but the calibration code is basically the same and it's easier to post the C++ version. Brad |
Re: Large amounts of gyro drift
Quote:
*Well, unless you get down to crazy low voltages, which you never should be able to. Quote:
|
Re: Large amounts of gyro drift
Quote:
|
| All times are GMT -5. The time now is 21:18. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi