5dof with Kalman Filter gyro problem
waterlogged
Posts: 12
I'm somewhat new to all of this, so I apologize if this problem is already dealt with, or just a dumb mistake on my part.
I'm trying to get the 5dof with kalman filter object from the Object Exchange to work. I've had a couple of troubles (mostly related to my relative newness to microcontrollers), but there's one I just can't seem to fix. When I turn the IMU board a couple of degrees, then stop, I end up with a signal that spikes a a certain value, then exponentially decays back to zero over about a minute. It's a stupid question, but is this normal? It doesn't seem too useful for me, especially as I'm trying for a basic autopilot and need some rather quick and accurate sensor readings.
Thanks again,
Justin
PS: The code I'm using is attached, and all of the objects are either defaults off the object exchange, or unrelated to the sensing.
I'm trying to get the 5dof with kalman filter object from the Object Exchange to work. I've had a couple of troubles (mostly related to my relative newness to microcontrollers), but there's one I just can't seem to fix. When I turn the IMU board a couple of degrees, then stop, I end up with a signal that spikes a a certain value, then exponentially decays back to zero over about a minute. It's a stupid question, but is this normal? It doesn't seem too useful for me, especially as I'm trying for a basic autopilot and need some rather quick and accurate sensor readings.
Thanks again,
Justin
PS: The code I'm using is attached, and all of the objects are either defaults off the object exchange, or unrelated to the sensing.
spin
4K
Comments
Not sure if what you describe is exactly what I had, but it sure sounds like it. I found that one of the solder joints on the gyro wasn't properly soldered. Although it's really tiny, I took a chance and gave it a little heat with the smallest solder iron tip I could find. It's been steady ever since.
With the "XR" legend on the left, the pin I soldered was one of the ones on the botom-right of the gyro (biggest chip on the board).
HTH.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
Thank you very much for the quick reply. The setup I have is the sparkfun 5dof board... I think that's what you were talking about, but I just want to make sure. Could it instead be one of the joints on the header pins? I'm no expert with the soldering iron, and I'd believe it if one of those was off. I'll check out both when I get back to the house.
Post Edited (waterlogged) : 4/18/2010 3:01:15 AM GMT
Yup - any bad solder joint could be the problem. I discovered it by pressing various parts of the 5DOF's components (an old trick from my BBC microcomputer days!).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
I tried simonl's suggestion and soldered the connection on the gyro he said might help. No such luck. If anyone has any ideas, I'd be really grateful, as I have a presentation that would be greatly improved by having the gyros working.
I was also able to tease out one other little hint... The roll gyro and the pitch gyro tend to be almost exactly the same. They rarely differ by more than a single unit. Both respond to both axes, which I'm guessing means there must be some sort of cross talk. They also require a good jerk to get going, in fact if I rotate it gently (not all that slowly, the sensitivity is poor) I can go without it being detected.
I've also attached a sample of the signal that's coming out. The vertical red lines are approximately where I rotated it, and the blue line is the response. Notice that if I hold it at a certain angle, it'll decay back to zero. I'm guessing this is the kalman filter thinking there's some bias? It's a slow process, but will go all the way back to zero.
Thank you all very much.
I'm curious, are you taking into consideration that the rotation of the Earth could be causing your drift? 'Normal' drift would be about 1/4 of a Deg per minute (15 Deg per hour). A kalman filter and/or PID would integrate time into the equation to compensate for this amount of drift.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Any help would be greatly appreciated. The project is working as is, but the performance would be greatly improved if the gyros could also contribute.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
Not sure if you're using viewport or not, but I found it pretty helpful while diagnosing issues when I was setting up a gyro and accelerometer. The ability to see multiple variables at once was helpful.
Thanks again everyone for helping out. Hopefully this should be cleared up soon.
The red signal is the gyro, and you can see some of the problems. There are several moments where the gyros don't track the same motions the accelerometer does, and this gets reflected in the blue signal, which is the output of the Kalman filter. In fact, you can see that although the kalman filtered output shares some of the same features as the accelerometer, it misses several of the main features.
Look familiar to anyone? Do I need to tune or replace something? Maybe a filter?
The thing that I see wrong with your results is that the gyro seemed to get into progressively negative territory.·It also looks pretty noisy with big spikes, some of which are not reflected in the acceleration data. I'm fortunate that the devices I used both had digital outputs (GWS PG-03 and LIS03LV02DQ), so I didn't have to worry much about analog circuitry. As I understand the 5DOF sparkfun module that you're using has analog outputs? How are getting these analog signals into the prop, and are you sure that whatever A/D technique you're using isn't injecting this noise?
One of the more frustrating problems I had to diagnose one time was a bad filter capacitor in a circuit. Unclean supply can cause all sorts of unpredictable problems in analog circuits and is one of the last things one thinks to check.
Of course, like I said, I have no experience with the particular devices you're using so my advice may be completely wrong.
I'm starting to think there's something wrong with the code I'm using. If you look at the output of the kalman filter, the roll variable seems to really only "like" two values, which is definitely not right.
bump
I started with the 5DoF code but switched it to fixed point maths and to do 3 axis. You could try this and see if it has the same problems.