View previous topic :: View next topic |
Author |
Message |
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Tue May 18, 2010 11:19 pm Post subject: Congratulations ! |
|
|
Great work Kiedro !
I have an application also using gyros and accelerometers, although not an autopilot, and your code will be a very useful starting point. I can do code, but my maths is too old and rusty to do more than follow along with what you ( and others ) have done. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
Kiedro
Joined: 08 Mar 2006 Posts: 81
|
Posted: Wed May 26, 2010 7:48 pm Post subject: |
|
|
Thanks Adrian, especially from you! Be sure that I learned from your input as well! I just felt that it is time to promote this open source type of thinking also among Bascomers like us. The code generated from the compiler really rocks, it is well done and not overdone and there is absolutely no reason to feel inferior just because it's input is Basic. Over the years one has learned to speak many languages - but it's always good to return home - stand on ground enjoying to talk mother language again, right? This is how I see it.
Greetings, Natalius |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Tue Jun 08, 2010 11:26 pm Post subject: |
|
|
Hi Natalius,
I have been playing with a Sparkfun Razor board and your code in AN177, and found a few things we could probably talk about. Maybe its better to do this by email rather than this forum, as its not really relevant to the AR7212.
My email is ajansen at internode dot on dot net
Substitute @ and . where appropriate. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
Matrixx
Joined: 30 Nov 2005 Posts: 158
|
Posted: Wed Dec 15, 2010 3:04 pm Post subject: |
|
|
Hello Kiedro,
Thanks for the amazing AN177, its really something I have been trying to do with kalman filters. But understanding kalman is still hard to me
Kiedro, I have a very important question for you. I have some years wondering if sensor fusion will help me to get acceleration values only from accelerometers, discarding the gravity. In my application, I need to measure only dynamic acceleration. I have been using accelerometers for years (in vehicles) but as the road is not plane, values alwaws are shifted over or under in a irregular way because the forces + inclinations.
There has been almost 3 years I looked to understand kalman because I guess it can be used to separate dynamic accel from gravity. That's my guess but do not have any basis tyo say it. It's great I can reach someone like you to ask if is that possible, maybe using DCM.
Actually I got a 2 axis gyro and 3 axis accelerometer to play with. I have developed an interface using Delphi (just read the 2 sensor values 50 times/second from a Atmega2560 board), to do all the math in windows first and if it works try to translate to bascom alone.
what is great surprise is that you already have all your code in bascom!
Thank you in advance, and greetz to all forum |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Wed Dec 15, 2010 10:38 pm Post subject: |
|
|
Einstein proved that gravity is indistinguishable from acceleration - the Principle of Equivalence. So there is no way of separating the two. Of course you can use gyros to measure rates of turn, and infer vehicle motion and changes, and in that way 'remove' the motion from the gravity. But without gyros, or some other means of measuring motion, you cannot ever separate acceleration from gravity. A big advantage in a road vehicle is that at least the vehicle averages parallel to the road surface. Much harder in a flying vehicle, where you do not have this constraint.
Now that the sensors are so cheap and relatively easy to use, it makes no sense to limit yourself to only one type of sensor. Of course you still have to have the maths to fuse them, which is where Kalman filters or the DCM comes in. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
Kiedro
Joined: 08 Mar 2006 Posts: 81
|
Posted: Wed Dec 15, 2010 11:52 pm Post subject: |
|
|
AdrianJ wrote: | Einstein proved that gravity is indistinguishable from acceleration - the Principle of Equivalence. |
That's right - but let us admit that we still don't understand gravity and how it links to the the other forces, which could be unified. That's the problem Lee Smolin became frustrated about and that's why the LHC at CERN is so exciting. But the solution may be simpler - I don't know, I miss background here but I'm still excited (and puzzled) about: There is a Dutch guy who came up with a fundamentally new theory how to understand gravity this year - he showed from first principles that Newton's laws, Einstein and the equivalence principle pops out from his way of treatment, based on entropy and string theory:
http://arxiv.org/abs/1001.0785
I have an idea about entropy and statistics but I'm completely ignorant about the other stuff. Still, it is remarkable that it is kind of easy to follow Verlinde's math just on the formal side. It's a wonderful xmas lecture - you will enjoy, Adrian.
Let's take a pragmatic view on the problem described by matrixX.
I agree a solution based solely on accels is not really adressable due to the reasons you said. But he has 3DOF accel and 2DOF gyro. A car with a given mass and a given engine performance cannot exceed certain acceleration limits, except in a crash situation. For a car which drives with constant speed straightforward the magnitude of the accel vector is the one of gravity. Curving can be detected from the gyro information and eliminated via centrifugal error correction. The rest is noise on a bumpy road which I guess has a large short timed Z component on accel. So when taking these things together my gutt feeling is that it is difficult but not hopeless. However, with 5DOF e.g. from Sparkfum one important gyro info (yaw rate) is missing: The major one needed for centrifugal error correction. So I think it is better to go at least 6DOF - and redundancy by whatever sensor (compass) is never bad.
Kalman: EKF just needs one more matrix function which is transposition. I left it out in Mini Matrix algebra because it just means "mirrowing" with repect to the main diagonale - so basically the exchange of indices - translated into the 1D limitation of Bascom. If there is interest I can do it at the next moment of "spare time" = Xmas.
IT IS REALLY GOOD TO HAVE THIS CHRISTMAS TIME! I CAN'T AWAIT TO BE ABLE TO RETURN TO MY HOBBY!
NK |
|
Back to top |
|
|
Kiedro
Joined: 08 Mar 2006 Posts: 81
|
Posted: Mon Dec 20, 2010 12:40 pm Post subject: |
|
|
Hello Matrixx
Matrixx wrote: |
Actually I got a 2 axis gyro and 3 axis accelerometer to play with. |
I guess it means no GPS and no compass, just a 5DOF sensor? The compass may be considered as redundant, but the GPS I guess is not. For a moving ground vehicle it gives you the bearing which is heading (unlike in the case of an aerial vehicle). So you could adopt the existing DCM with rather little changes. For a SFE 5DOF one may derive the yaw rate from the GPS heading/bearing and substitute the yaw gyro information this way. One needs to live with a deviation caused by the fact that a yaw rate by GPS is delayed compared to the gyros. But with a 4-10 Hz GPS module, this effect might be tolerable. A truck will presumably not "complain" but a low mass, low rotational momentum city car on a test parcour will.
Another option which one could try is to mount the 5DOF vertically and to forget about roll angles at all, viz. always feeding in zero roll rate to the DCM. Speed vectors may be obtained from the integration of acceleration vectors, and, as you now also have the yaw rate information, centrifugal acceleration correction is in the game as well.
Whatever you do, a vibration damping sensor mount seems to be mansatory for a car. People from CHrobotics recommend to put their IMU/AHRS sensors into a polymer matrix such as silicon rubber.
Regards,
Natalius |
|
Back to top |
|
|
Matrixx
Joined: 30 Nov 2005 Posts: 158
|
Posted: Wed May 18, 2011 1:25 pm Post subject: |
|
|
Hello Kiedro, very interesting all you say. yes it is 3 axis accel and 2 axis gyro but I forgot to mention I'm using a GPS too, rated at 5 hz.
I get the vehicle speed from gps, and the 3 forces from the accelerometer. this was the original setup but then I added the gyro in a hope to improve the accel readings. I'm still not doing anything but logging the data only, still need to apply the sensor fusion.
I have another issue about gps; in a straight highway the speed is nice and I could say accurate. But when I drive in to a 90 degrees pattern (at open sky view) the speed becomes to get inaccurate. I tested on a lap of 28 left/right turns of 90 degrees in a driving learning place. vehicle test speed is 15 mph but the gps seems to lag on the updated reported speed. say the gps output remains 15 or 16 mph when the dashboard of vehicle shows the speed has changed maybe by 3 or 4 mph.
Now I'm wondering if I can get advantage of having the 5 dof to improve the gps reported speed.
Kiedro, it would be great if you could help me to understand this concepts.
I really want to get this to work decently. I can provide data log sample if need. |
|
Back to top |
|
|
Kiedro
Joined: 08 Mar 2006 Posts: 81
|
Posted: Wed May 18, 2011 10:36 pm Post subject: |
|
|
Hello Matrixx,
let me ask some details to make sure that I understand you right. You are driving in a zig-zag pattern with rectangular left-right-left-right turns. You make 28 of these turns while keeping constant speed at 15mph. The recorded speed from the RMC message is delayed and differs from the tachometer by 3-4 mph, if speed changes.
Does it happens when you brake? Accelerate?
Is GPS speed on the average faster or slower than tachometer speed?
How long are the segments between turns?
What does the GPS bearing/heading/direction say to your 90° turns?
(I'm thinking about a sampling issue)
Natalius |
|
Back to top |
|
|
Matrixx
Joined: 30 Nov 2005 Posts: 158
|
Posted: Wed May 18, 2011 11:17 pm Post subject: |
|
|
Hello Kiedro, thank you !!
yes I'm drive into 28 corners. I have the logged data at home but tomorrow will attach it.
when I drive in a highway, the speed from gps sems to "catch" better the speed changes as I normally accelerate/or break. I see it on a display. but when I'm at the corners track the display looks more "delayed" at speed changes. Intentionally i break a little to lower to 12mph or accelerate to reach 17 mph (all this when cornering) but the display more or less shows the last speed before I just enter the corner. Yes, it updates very often when at cornering but I "feel" it's missing something, (I think maybe is for the way the gps engine computes the speed, maybe based on distance between 2 points then calculate the speed? if the points are not lineal maybe the gps engine is not resolving good the speed. but this is just my guess).
I have the lcd updated 3/second to have idea, compared with vehicle tach. is accepable as I put other data on a serial display and don't want to overhelm it.
Currently I do not monitoring bearing/headind/direction. Currently I'm saving timestamp, speed, distance, and accelerometer forces to a text file on sd card.
segments between turns are 268 feet long.
This night I will re-read your application note. : ) |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Wed May 18, 2011 11:46 pm Post subject: |
|
|
Welcome to the tricky world of GPS ! A GPS device is already a very complex measurement system, with lots of internal processing to extract the best possible looking result out of a very small amount of very noisy data. That processing almost always favours the location, and the speed and other data is somewhat secondary, particularly in an off-the-shelf commercial unit.
But certainly it is not true that the GPS measures speed by taking positions and time. All GPS units compute the speed from Doppler shifts in the satellite signals themselves. But how they present this to the outside world is very much up the the individual device software design.
High-end units like Trimble and uBlox, to name a couple, have settings to adapt to different vehicle dynamics, so you can set them for instance to 'pedestrian' or 'car' or 'aircraft'. This can radically change the behaviour when doing fast turns and other gyrations.
You dont say what type of GPS you have, but if you can set the dynamics, you will probably improve what you see. If you cannot, and its vital that you have good speed tracking for your application, then consider getting a better GPS, where some of these things can be adjusted. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
Matrixx
Joined: 30 Nov 2005 Posts: 158
|
Posted: Thu May 19, 2011 7:02 am Post subject: |
|
|
Good point Adrian, nice to hear you : ) . I remember to haved seen something published about these Ublox modes.
It will be a good idea for me to get one of these and try it. if they improves that will be really good.
Currently I'm using the FV-M8 from San jose navigation, it was the Eb-85A before.
I have set to RMC and GGA only, 5 hz.
I will check if the FV-M8 has setting for these modes. |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Fri May 20, 2011 12:14 am Post subject: |
|
|
I had a quick look at the specs of the FV-M8, it appears to use the MTK chipset. AFAIK that does not allow to set the vehicle dynamics.
MTK seem to use a lot of different software versions, and not release much details. Even their 5Hz output is a bit iffy, last time I looked, they output interpolated 5Hz data, but only from 1Hz actual GPS solutions.
I used a lot the uBlox LEA4 and now LEA5 modules in aircraft, where we needed very good speed measurement. With these, we could get velocity noise down around 5 mm/sec, at the 1G aircraft dynamics setting. The tracking we never really measured, but it seemed believable in 2-3 G turns. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
Matrixx
Joined: 30 Nov 2005 Posts: 158
|
Posted: Sat May 21, 2011 4:40 am Post subject: |
|
|
I have looked at sparkfun but seems they are not selling it. I'm googling to to find if a seller has the LEA5 with ceramic patch antenna included, no luck until now. I have founded the modue without antenna, I finally will end buying one of those.
where did you get yours..?
Natalius, I did not located my previous logs as it was some time ago but today I mounted the board again. I went to run 1 lap at cornering track, but gyro seems too noisy.. I will run again until monday.
I'm working on parsing the data according with the datasheet (I saved it as raw adc values).
Is amazing all that about UAV planes : ) |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Sat May 21, 2011 5:18 am Post subject: |
|
|
I have a few spare patch antennas, also some LEA4A modules. Note these dont have Flash to save the configuration, so you have to configure them each time you power up, using uBlox protocol messages.
Probably its better to discuss commercial stuff off the forum. Email me ajregister at internode dot on dot net
if you are interested. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|