![]() |
Best gyro for frc.
I have been looking into different gyros online for an offseason project and am not sure which one to go with. The applications will be at least as demanding as FRC if not a good bit more. This means we would like minimal drift and for it to remain accurate under high acceleration.
Anyways could any teams who use gyros in their robot tell me which gyro they used and if they recommend it. (Shoutout to 1717 and 16, you all probably have good gyros for your swerve, it would be greatly appreciated info) |
Re: Best gyro for frc.
1538 had very good results with Analog Devices gyros.
|
Re: Best gyro for frc.
I used a ADXRS453 for the NASA Sample Return Challenge this year and was impressed with the performance for the cost.
|
Re: Best gyro for frc.
I had a opportunity to test several different gyros (from two different manufacturers) on an FRC robot for a personal project and like the others, I would recommend the Analog Devices gyros. The one I am currently using is the ADXRS450 (similar to the ADXRS453 above - except without the internal temperature compensation) and it works well. If price isn't an issue, higher quality gyros are available with some excellent specs, however they typically run more than $1000.
Mike |
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
Mouser and digikey sell these. Never actually used this but I had it bookmarked to buy eventually. |
Re: Best gyro for frc.
We tried to use an MPU6050 breakout and arduino last year, but combining everything fairly difficult, so we just bought a nav6 from kauai http://www.kauailabs.com/store/index...&product_id=50
They're $70, but designed to work with a cRio out of the box, and will probably work with an rRio with a serial cable. It worked over usb to my computer, and the new rio runs linux, so it should be fairly easy to set up. We used it to make our swerve field-centric, and it only floats by a degree or two throughout the match, which is about as good as you'll get with a cheap chip gyro. If you want to make your own, arduino and an MPU6050 is a good place to start, there are several good libraries and explanations to get you up and running fairly quickly. |
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
Do keep in mind that the MPU-6050 is a 3.3V part, and isn't 5V tolerant, so you'll need to take care of that. The nav6 does that, and also allows powering directly off the 12V robot battery. One of the nice things about using the nav6 firmware, even if you assemble it yourself, is it will work w/all the WPI classes (java, C++) as well as w/the LabView VIs (these are also on the nav6 website). A few people who have the RoboRio beta systems are testing out the nav6 on the RoboRio, and although I haven't got word yet how well it's working for them we expect it should work just fine. If you have any questions, please contact me at scott@kauailabs.com. |
Re: Best gyro for frc.
Quote:
I noticed that the pin out on these gyros are different from the KOP sensor board. How would you interface these with the control system we have with FIRST. I know you have to set up a SPI connection with SCLK, CS, MOSI, MISO, I just have no background with this. EDIT: Found it. For anyone who wishes to know how to wire the ADXRS453. It is just like the accelerometer. You will take the SCLK, CS, MOSI, MISO to the DIO pins 1-4, doesn't matter really what order, and can power it from the 5V or Ground located below the DIO pin 1 location. Thanks all and hope this helps someone else out. |
Re: Best gyro for frc.
I assume you use the SPIDevice class in Java (for example)? If so, can someone with experience using the ADXRS453Z provide feedback on the correct bit order, clock polarity, clock rate, and frame modes?
Any sample code you code provide would be helpful, which could help avoid hours of troubleshooting. |
Re: Best gyro for frc.
This guy if you don't want to use SPI:
EVAL-ADXRS642Z - about $75 from mouser, digikey, etc http://www.analog.com/en/mems-sensor...s/product.html |
Re: Best gyro for frc.
Austin Schuh is really the best to answer those questions here.
Colin Wilson (254>973>254) made ours, and could also answer but he's less active on here. |
Re: Best gyro for frc.
This is on my over-booked TODO list...
We had a co-processor reading it last year. We are putting together a board right now to interface one with the roboRIO. We'll be releasing our beta test code closer to the start of the season. I expect that we should be able to interface with it over SPI. |
Re: Best gyro for frc.
Quote:
Do you expect any differences between integrating on your co-processor and integrating with the accumulator in the FPGA, in particular with integral error and drift? What was the SPI bus clock speed/integral dt on your co-processor? Do you happen to know the SPI frequency on the roboRIO? (I think I saw 4MHz in a myRIO document...) Thanks, Aren |
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
We integrated in software on our co-processor. Since the gyro is SPI, I'd recommend just doing the integration yourself in software on the roboRIO in a RT thread running at high priority. That's what we'll be doing. I like being able to audit the code, especially for something like a gyro where I've seen horrible bugs in the past. We got 2 ish degrees of error over 2 minutes with the ADXRS453. I checked our uC code, and it looks like we read the gyro at 200 hz, and ran the bus at 7.5 MHz. 200 hz is above the gyro's bandwidth, which is good. The roboRIO's maximum SPI clock rate is 500 KHz (as reported by WPILib's documentation.) The datasheet for the gyro lists the maximum clock rate to be 8 MHz, but doesn't list a minimum. This should be fine. seg9585: This is a SPI gyro (digital). The ADC is inside the gyro chip, and seems to be very accurate from what I've seen. Austin |
Re: Best gyro for frc.
|
Re: Best gyro for frc.
Quote:
Austin -- my reply was directed towards the recommendation of using the EVAL-ADXRS642Z, which appears to be an analog output. I asked my questions earlier related to the ADXRS453 for which you provided at least some of the information I need to help initialize the gyro in the SPIDevice class. So thank you -- but I do have another question: the FRC-provided Gyro class performed a calibration within its Constructor that, to my understanding, calculated the drift bias it needed to apply to its integrator. It performed the calibration by taking a seconds-long sample of "still" data and averaging the values to find an offset. Did you have to perform a similar activity in your Robot Init method? |
Re: Best gyro for frc.
Quote:
Quote:
Since the calibration will happen on the roboRIO next year for us, I'd like to improve this process by saving the last 5 seconds of gyro values, and doing the averaging the first time the robot is enabled. I learned this trick from Kiet from the Holy Cows. This lets you not worry about keeping the robot still while booting. Last time I benchmarked the Gyro class in 2011, I found a horrible lag between angle changes as measured by the encoders, and and angle changes measured by the Gyro class. I was seeing ~0.1 seconds of lag. This was destroying my phase margin and making it very hard to tune the loops. I banged my head against this for about a month before figuring out what was wrong. I've since become very cautious about gyros and how we use them. This was with the KOP gyro and WPILib Gyro class. That lead to us to use ADXRS453, and we have been very pleased since with it's performance. |
Re: Best gyro for frc.
I am very new with working with SPI and had a question. How does the startup sequence work for the ADXRS543. We are currently using Labview as our programming language, but i would assume it is the same for all languages. I have been looking at the register and memory values in the datasheet and was trying to get a bead on how to setup the gyro at open and draw the correct values during operation. I have looked over the SPI example in Labview, and have gained a lot of insight on how SPI functions even though the accelerometer has different registry and memory call values.
I would assume I need to set the rate and data format that I read from the gyro. Thanks for any help you can give. |
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
You can download 971's microcontroller code which reads the gyro. http://frc971.org/content/2014-software The file you care about is bbb_cape/src/cape/gyro.c. The functions should be reasonably well named, and together with the datasheet, you should be able to figure it out. |
Re: Best gyro for frc.
Quote:
Stiction is stiction it does not matter what type of device. I thought all laser gyros had to have some form of dithering. I don't know what you mean by the term "Zero Lock Gryo". I found some information indicating Litton had a system using this term, but didn't find anything that really explained how it worked. (just sales mumbo jumbo) Can you please explain that more or post links please? -Hugh |
Re: Best gyro for frc.
Quick update for anyone interested in using a reliable gyroscope this year:
I purchased the EVAL-ADXRS453Z from Mouser and wired it up + tested on an Arduino this weekend. Overall I got great results! There was a rate bias (0.417 deg/sec) but when I nulled this out, the bias change was minimal. I programmed 1 kHz sampling with a 50-sample smoothing which fed into my integrator to calculate heading. Results: I achieved a maximum heading drift of approx 0.35 degrees/minute. This is highly acceptable for FRC given 2-2:30 minute match lengths. A few notes: The Gyro SPI clock runs at up to 8Mhz. My Arduino is capable of 16Mhz but the roboRio can only output 4Mhz. Anyway, I verified the drift was still acceptable when running the Gyro at 4Mhz. The data is 32-bit MSB, zero polarity and requires Chip Select to be pulled low for data collection. Rate data is 16-bit and is stored in Registers 25 through 10 as two-complement, so a little bitshifting and data conversion is required. I plan to implement this with the FRC Java SPIDevice class and will let you know if it performs as well as it is with the Arduino. |
Re: Best gyro for frc.
Quote:
It sounds like you were sampling the rate at 1KHz, keeping the 50 most recent rate samples in a ring buffer, and using the average of those 50 samples every 20ms to calculate a new heading. Is that correct? |
Re: Best gyro for frc.
Quote:
The reason I had to do this is because the most accurate Timer I could find in the Arduino was only accurate to the nearest 1ms and this introduced significant heading error when calculating time delta, particularly at high rates. Happy to post my code if interested. |
Re: Best gyro for frc.
By the way, this is an inertial sensor along the z axis. Therefore I suspect some of the sensor error could be attributed to Earth's rotation.
360 degrees/rotation * 1 rotation/24 hrs * 1 hr/60 mins * sin(latitude of Los Angeles) = 0.25*.53 = 0.1325 deg/min error from Earth rotation, which accounts for 35% of the error |
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
You might also want to look into using interrupt driven timers. And while on the topic of timing and arduino, for timing dependent tasks write the code yourself. Tests I did a couple years back showed that there's a SIGNIFICANT overhead for the arduino digitalWrite compared to the comparable C code. I'd always assumed they were just macros but they actually include a fair bit of code. |
Re: Best gyro for frc.
Quote:
I'm using SPI.transfer(data), not digitalWrite. Is there a more efficient method than this one? |
Re: Best gyro for frc.
Has anyone thought about making an aftermarket board that plugs straight into the expansion port on the rRIO that includes a gyro built in as well as pwm expansion and dI/O and analog expansion?
|
Re: Best gyro for frc.
Quote:
Even if it wasn't, the chip I tried in particular is a single-axis gyro and will require more precise mounting on the robot. Many teams like to mount cRios/roboRios vertically or in a way convenient for troubleshooting or maintanence. Maybe an embedded 3-axis gyro would solve that problem, like the rRio's 3-axis accelerometer. |
Re: Best gyro for frc.
Quote:
Result: ~1 deg drift in 10 minutes. I think that'll be good enough. Photo of the setup (3D printed protective case): ![]() Serial Output: ![]() |
Re: Best gyro for frc.
Quote:
I'd be willing to bet doing the SPI write yourself would be more efficient but it's probably not a huge deal. The only reason I did any tests was I needed faster executing digital writes. It was mostly an example of how the wrapper library is pretty inefficient. Mounting the gyro near the roboRio probably won't be an issue. Every time I've run a gyro has been an analog gyro, the issue was that the signal got messed up by the magnetic fields caused by currents driving motors. Minimizing transmission distance should help you there. But this gyro talks SPI so it's less susceptible to that issue. |
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
|
Quote:
Awesome, any plans to offer official Python support? |
Re: Best gyro for frc.
Quote:
Thanks |
Re: Best gyro for frc.
Quote:
Plus an on-board 32-bit ARM microcontroller, providing motion processing and calibration algorithms for accelerometers, gyros and magnetometers. Minimal yaw drift due to filtering/fusion algorithms. UART, SPI, I2C and USB interfaces. Open source hardware and firmware. C++, Java and Labview libraries for the Roborio will be available, too. |
Re: Best gyro for frc.
Quote:
If you would like to discuss Python development, please contact me at scott@kauailabs.com. You'll need to decide if you want to interface serially (UART/USB), I2C or SPI. |
Re: Best gyro for frc.
Quote:
Available kickoff? Through andymark? |
Re: Best gyro for frc.
Quote:
|
Quote:
Cool, thanks. Out of interest what arm platform are you using (Si Labs, ST etc)? |
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
The best way to solve the interference problem is to twist the gyros signal and return cable. The two conductors act like a loop which pick up the magnetic field from your motors. Twisting these two conductors will decrease the effective loop area and greatly reduce the interference. You can prevent common mode interference with a grounded shield on the conductors. Increasing our switching frequency to 15khz makes interferences problems 15 times worse than the 1khz. |
Re: Best gyro for frc.
Quote:
Quote:
Quote:
Quote:
|
Re: Best gyro for frc.
Quote:
For higher RF frequency, you don't need to have a high permeability to block magnetic fields. I think the 15kHz frequency is in this higher range where it's easy to shield with conductive metals. Quote:
The noise that's induced to the gyro's signal through differential mode interference (meaning your gyro's cable is acting like a loop, picking up the magnetic field) is proportional to the effective loop area, the strength of the magnetic field, and the frequency of the field. Each time the motor's power switches from on to off, faraday's law says that some voltage induced in your gyro's signal. If the event happens 15 times more often per unit of time, you get 15 times more noise. For common mode interference, which is when both your return and signal are affected in the same way, a higher frequency magnetic field will provide more opportunity for parasitic capacitive coupling to ground. However, the higher frequency may be easier to shield from, but I don't think I've ever seen an FRC team use shielded cables for anything before. |
Re: Best gyro for frc.
Quote:
Thanks in advance. |
Re: Best gyro for frc.
Quote:
digikey product page |
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
The NavX is on Andymark website for $99.00. http://www.andymark.com/product-p/am-3060.htm |
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Figured I'd clear up a couple of responses in this thread.
Quote:
Quote:
The 450/453 differ from the gyros used on the AndyMark breakout board in that the Analog to Digital conversion is performed within the sensor. This makes them much less susceptible to EMI. In an ideal setting, you would want the accelerometer attached to a rigid portion of your robot, and the gyro would be located as close to the center as possible. Although the 6-axis and 9-axis sensors are cool, they are not designed for precision navigation applications. Noise levels on those sensors are orders of magnitude greater than what's available on application-specific sensors. I would strongly suggest that teams invest some time looking into the 450/453 if they want to have a solid drive system. Another caveat of systems such as the nav6 is that they are not calibrated. Each sensor is unique and will provide a slightly different response when used in different applications. In that case, an integrated IMU such as ADI's iSensor product line would be ideal. |
Re: Best gyro for frc.
Quote:
However - please be aware that the nav6 is definitely calibrated, as it features factory-calibration of accel/gyro biases, and also continually re-calibrates the gyro biases during periods of non-motion (accounting for gyro temperature changes). This behavior, implemented in the Invensense digital motion processor (DMP) silicon and the on-board microcontroller, is what enables the yaw error rate of approximately 1 degree/minute. The navX MXP features the 2nd-gen MPU-9250 w/even lower gyro noise levels - so we're seeing this technology continue to improve and mature as the MEMS noise levels decrease, and the implementation of the data fusion and calibration algorithms continue to improve. More info on the gyro/accel calibration is available at: https://code.google.com/p/navx-mxp/w...celCalibration The nav6 technology does require about 16 seconds of calibration time before a match, during which the robot must be held still. The navX MXP lessens this period, but this may be a difference between the two approaches worth noting. The nav6/navX MXP technology is cost-effective and viable for use in a field-oriented drive system. Several teams have been doing this successfully, and enjoying the ease of integration it provides. Sounds like a bake-off between a ADXRS453 and a navX MXP would be helpful to the CD community.... |
Re: Best gyro for frc.
Ok - so when wiring up this Gyro, what goes where?
Gyro Ground to Roborio SPI Ground Gyro Mosi to Roborio SPI Mosi Gyro Miso to Roborio SPI Miso Gyro PDD to Roborio SPI 5V power (datasheet says 3.3 to 5) Gyro CS to Roborio SPI CS0 Gyro Clk to Roborio SPI Clk Do I have this correct? Since my experience is with analog gyros, what type of data am I going to see over the SPI interface that I will have to use to calculate bias and integrate to angle with? |
Re: Best gyro for frc.
Our team took up writing and providing decent drivers for the MPU6050 as one of our offseason projects last year (2014) and had good results. We have very little drift (ie a couple of degrees every couple of hours, though we have yet to record exact results). We have a nice, cheap, solution that has been tested on a BBB and a raspberry pi, and we have half ported working code for the roboRIO (also working on using the MXP breakout board with it):
Links: For BBB and Raspberry PI: https://github.com/thedropbears/DropBoneImu For roboRIO (WIP, but it works): https://github.com/thedropbears/lib-4774 Documentation: http://thedropbears.org.au/wiki/index.php/DropBone_IMU Edit: Add link to documentation |
Re: Best gyro for frc.
Quote:
TIA |
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
|
Re: Best gyro for frc.
Quote:
I should also have a nice RoboRIO solution for the 345 & 453 that teams might be interested in looking at! |
| All times are GMT -5. The time now is 15:25. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi