![]() |
Re: Picking a gyro for field-centric swerve control
Quote:
consider another hybrid solution with coarse and fine scaled gyros. Coarse is a high-max-rate-low-resolution gyro and the fine is a low-max-rate-high resolution gyro. Simply switch the heading integrator input from the fine gryo to the coarse when saturation is detected on the fine gyro. This is added complexity, but gives you the best of both worlds of precision and dynamic range. I would use the encoder heading over this if they are on the robot.....if not , this might prove cost effective. |
Re: Picking a gyro for field-centric swerve control
Quote:
|
Re: Picking a gyro for field-centric swerve control
Quote:
|
Re: Picking a gyro for field-centric swerve control
Others have reported (and it makes a lot of sense) that the compass modules they've used are very sensitive to the "natural" EMI environment around the permanent magnet motors in our bots. My own limited experience with such modules outside of a FRC environment matches their observations, so I don't have a high degree of confidence in that approach.
|
Re: Picking a gyro for field-centric swerve control
Quote:
|
Re: Picking a gyro for field-centric swerve control
Quote:
In the short term, the fine gyro could beat this for accuracy given a good initial alignment... but that's tough to do in FRC competitions. Edit: Quote:
|
Re: Picking a gyro for field-centric swerve control
Quote:
|
Re: Picking a gyro for field-centric swerve control
Quote:
I may investigate a dual-gyro approach. I tend to think that the fewer moving parts you have touching the ground the better - replacing a gyro is an easy task if it gets broken (and we've never had that happen). So here's the scheme I intend to use: ADXRS610 - 300°/s (5 volt supply) $59.95 http://www.sparkfun.com/commerce/pro...oducts_id=9058 Gyro Breakout Board - LPR5150AL Dual 1500°/s (2.7-3.3V supply) http://www.sparkfun.com/commerce/pro...oducts_id=9412 Adjustable Voltage regulator for 1500 deg/s gyro $1.95 http://www.sparkfun.com/commerce/pro...roducts_id=527 I will monitor the actual rate of the 300 deg/s gyro in code (fast loop). When the values jump within 10% of the upper range, I'll check it against the baseline of the 1500 degree per second gyro. If there is a substantial difference, I'll calculate a correction factor to apply to the 300 deg/s gyro. So here come the "electrical" type questions. Am I choosing a good voltage regulator for that 1500 dps gyro? What type of drift should I expect out of the 1500 dps gyro, and how accurate will it be over time? Should I be worried about the CRIO being able to accurately measure the .67 mV/deg/s value, or is it capable? Remember - I'm not a controls guy but I did stay in a Holiday Inn Express last night.... |
Re: Picking a gyro for field-centric swerve control
Are you sure you want a pitch and roll gyro? If you use it to track field orientation you'll have to mount it sideways and "throw away" one output (unless like Golto you have some use for an inclination angle).
If you choose to go with the LM317 you'll need more external components than you might otherwise. I'd consider using the COM-00526 that they offer instead (fixed 3.3V). Be sure to check the reference design shown on the data sheet to see what external parts (typically capacitors) you'll need in either case. Regarding drift, the only clues are in the datasheet. The "rate noise density" and "sensitivity change vs. temperature" are the parameters of interest based on your question. In theory you can predict drift vs. time based on those parameters, but as a practical matter the answers you get would only apply in laboratory settings. Even if you place very little dollar value on your time, you'll quickly have spent more in doing a formal analysis than in just buying the part and having fun with it. Analog purists who do noise analysis for fun will surely disagree. If one offers to help, by all means accept. The resolution of the cRIO NI-9201 analog module is 12 bits over a 20V span, which equates to 4.88mv/bit, so even using the 4X output you'll want to add a gain stage to the output of the module if you *really* want the lower end of the 1500 deg/sec. The downside is that any gyro output noise will also be amplified. You might choose to use a gain of about 20 (resulting in 13.4mv/deg/sec, or about 3 LSB). You'll then also need to be careful about how you prototype the circuit (proper grounding, signal routing, filtering, etc.) to minimize its susceptibility to noise pickup from external sources (like motor controllers). Before you go to the lengths of adding a non-unity gain stage, you might want to try using the 4X output directly into the NI-9201 despite the resolution mis-match, just to see if you can live without the slow rate resolution you are "throwing away". You might be surprised. For what it's worth, we've never been able to saturate even a 150 deg/sec gyro on a real robot, so 1500 deg/sec could indeed be overkill unless you are planning to do something really exotic. Hope that helps... |
Re: Picking a gyro for field-centric swerve control
I had considered the LM317, but the 'optimal' input to the gyro is 3 volts, even though it can handle 2.6-3.7 or something near that.
One of the problems we have with older gyros we have in the shop is that we don't know their gains. How to FIND those gains is a mystery to me, so we have several gyros that are really not usable because I don't know how to find the gains to put into labview to get accurate readings. I was concerned that changing the input voltage will also change the gain requirement: I believe in the datasheet I read that it would, but I might be mistaken. If it does, how do I go about find the correct gain value? Trial and error hasn't worked very well for our other gyros. You get some VERY strange readings even with just small changes in gain. I like the idea of not having to worry about resistors to get the voltage regulator to the correct voltage: if there's an easy way to find the gain I should be using that sounds like a homerun. I didn't see a gyro listed in sparkfun that was single-axis 1500 dps. I'm not really worried about that second axis, and for whatever reason the 1500 dps gyro is half the cost of the 300 dps gyro, so wasting one axis on it really wasn't much of a concern. |
Re: Picking a gyro for field-centric swerve control
Quote:
* Give the gyro an arbitrary gain. * Zero the gyro. * Rotate a large, known angle. Typically a dozen revolutions or so. * Divide actual rotation by measured rotation. * Apply this to the arbitrary gain. * Profit! Varying input voltage will usually affect gain AND offset, so be mindful. Offset error is likely to have a bigger impact. Resistors are pretty stable over time, but have large birth error. So, I hate using them to set voltages in production ( and almost always go for fixed regulators if I have the choice ), but don't mind them in one-off situations. As a reminder, you can see what choices I made for the KoP gyro by looking here: http://usfirst.org/roboticsprograms/....aspx?id=16337 To be honest, the unity gain stages are more to protect against mis-wiring than anything else. If I were to do this as a one off or for a more controlled audience, I'd probably skip the output buffering entirely. |
Re: Picking a gyro for field-centric swerve control
Quote:
The CRIO a/d's have a 5mv resolution without oversampling. For the 5150 this means about 7.5 deg/s resolution. Also, this is really a 6000 deg/s gyro with the amplified output at 4x. The noise density is .175 deg/s/(sqrt(HZ). I believe this is at 1x so with the 140 HZ BW the the 4x noise is 4*.175*sqrt(140) = 8.3 deg/s rms. So you have a total rss accuracy of about 11 deg/s. This could be reduced with oversampling and if you are running at 200 Hz loop rate, you have an averaging reduction of 1/sqrt(20) so the average bias error would be around 2 deg/s. This isn't too bad for a .1 sec interval. But what may kill you is the nonlinearity error of 1%FS= 60 deg/s. This cannot be helped with averaging, so you might be off as much as 6 deg here from the .1 sec transient so the compass is looking better. If however, you could live with the (fine,coarse) = (100 deg/s,500 deg/s) you could probably beat the compass. The adj regulator would be fine, but you could save a resistor if you just bought a 3v fixed regulator. I would also sync the long term average of the coarse gyro to the fine gyro average to mitigate the drift. This is easily done with a low pass (10 sec time constant?) on the error between the two gyros whose output corrects the coarse gyro input. Opps... this is probably a redundant reply since I didn't see Alex' reply first. |
Re: Picking a gyro for field-centric swerve control
Quote:
The quick calculations you performed are exactly where I need help. If you want gear ratios or bending moments or torques I'm your man.... but I absolutely hated system design, fourier, etc. and I'm afraid I blotted it out of my mind rather quickly after school :D A benefit of the 500 dps is that it runs on 5V and the voltage regulator could be eliminated. Just so I'm clear - the higher rate gyro is going to drift more, so you're suggesting using the lower rate gyro to correct the higher rate one. Essentially, saying that when the lower rate gyro isn't turning at a rate that's above it's maximum, you would constantly update a correction factor to minimize the high dps gyro's error from zero. Is that right? Regarding the compass: what are the rate sensors used for in the compass? Wouldn't they be knocked off-kilter just as much because of a collision? |
Re: Picking a gyro for field-centric swerve control
Here are my random thoughts on a few things brought up in this thread:
-You should probably integrate the 1500 deg/s gyro in a very fast loop (1 ms if you can) and the 300 deg/s gyro in a slower loop. Doing this will provide plenty of oversampling to gain a few bits of resolution to make it nearly as accurate as the 300 deg/s gyro at a slower sample rate. The only thing is that you'll need to guarantee a very accurate bias calculation for the 1500 deg/s gyro with a lot of samples - you may not want to use the stock bias routine. -due to noise in the angular rate signal, you'll probably want to check against the 1500 deg/s gyro when above 70% of saturation value of the 300 deg/s gyro (or thereabouts depending on the noise level). Any noise causing saturation of the output voltage will cause your calculated integral to have a permanent offset, and you really don't want that. On top of that, you can get some strange effects when internal op-amps saturate before the on-board filter. I don't want to get too deep into that but I had to do a big study on these affect in accelerometers for a past job - these issues can be pretty hard to track down, so be conservative when getting anywhere near saturation. - If the A/D converter uses the same reference voltage as the angular rate sensor (i.e. gyro), you're usually good to go. By sharing the same reference voltage, the A/D conversion will be ratiometric to the the gyro signal (i.e. as the gyro signal changes, so will the A/D conversion and the errors will cancel out). That's all I can think of for now - the commercial is almost over, so it's back to my TV show for now. |
Re: Picking a gyro for field-centric swerve control
Quote:
The pseudo code might look like this: if(abs(fine)> sat_value) // check for saturation {rate = coarse + bias;} //use corrected coarse if saturated else { bias = bias + .01*(fine - coarse -bias); // compute the bias with an exponential filter tau = 100*dt rate = fine;// use fine gyro } angle = angle + rate*dt; //Integrate rate Quote:
Having done our simple analysis, the compass solution seems more cost effective since only one cheap sensor (http://www.chiefdelphi.com/forums/sh...d=1#post956268) can be used with no added regulators. Its accuracy is adequate for the field-centric task provided a location can be found on the robot that is free from strong magnetic disturbances. Maybe someone can chime in with some real life FRC testing experience. But it would be fun to fool with the dual gyro project. |
| All times are GMT -5. The time now is 07:20. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi