### Full state vector from IMU

Hi guys,

I've been playing with a 9dof board I was using for some custom control work I had on and was wondering if it's possible to extend the standard attitude [pitch,roll,yaw] vector we get to have current velocities in X,Y,Z.

The obvious solution is to build up a velocity simply by multiplying the time interval by the accel's and summing them over time. This will clearly mount up with lots of error, though, and we need some way of continuously correcting this in the same way a kalman filter does for the attitude.

My thinking is that a well architected flight dynamics controller (the APM in this case) will be an event based system with the primary event consisting of this full state vector, also annotated with GPS state (gps velocity != IMU velocity and need to be kept seperate) so that any consumer nevre has to do anything with the numbers, simply compare where it is to where it wants to be (a delta on each field in the state vector) and pass the errors to the suitable PIDs for control.

With a system like that, loiter would become rock solid without GPS.

Has anyone had a go at that? I'll probably try and code it up over the next days/weeks.

Cheers,

Dave

#### Replies

• I've been looking and reading documents about sensor fusion gps/imu. Your approach about getting velocity has one problem or so I think. Imagine your flying against wind. If you measure velocity with the help of imu sensors, it will give you a "false" reading, since it's struglling against the wind, so that would only work in a non wind environment. One thing would come out good from this. Position hold inside buildings for instance, would be possible.

• I am working on just the z-accel alt-hold piece right now but I haven't written anything but test code for it, still fleshing out my ideas. I like how your thinking about how loiter should work though, using the GPS to attain a position and the IMU to hold it. I'll let you know when I get something usable, it should be relatively easy to implement into the other axi's...

### Activity

RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Nov 27
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8