Hi,

 

I've been stumbling across this issue for a pretty long time now and I think the right time has come to ask you guys for help. I've written a simple quadrotor simulation in Matlab / Simulink basing on Randal Beard's papers (a short video below - yes, the controller is unstable just now which is fine with me at the moment).

I've simulated the dynamics and kinematics, programmed a PID controller, added simulated IMU readings and am working on state estimation. As I'm generally heading for an indoor quadrotor setting, I'm not interested in GPS / Magneto readings. I've also read in many places, it should be possible to estimate roll and pitch angles of a VTOL aircraft basing just on gyroscope and accelerometer readings with an Extended Kalman Filter.

I'm using the following algorithm to drive the time update

3690855802?profile=originalwhich works just fine. I simulated the gyroscope readings as follows:

3690855768?profile=originalWith my simulated gyroscope readings I get following estimates, without any state correction just yet (angles in rad, time in seconds, estimates in green, blue are the true values). The drift due to simulated unbalanced gyro bias of 0.05 rad/s (see above).

3690855812?profile=originalUp to that point everything seems fine. My simulated accelerometer readings are (with T being the total propellers' thrust, m the quadrotor's mass):

3690855773?profile=originalWhat should my state correction equation look like, to get decent results? I've read, for a VTOL not performing aggresive manouvers, one could assume the following which should work well enough to obtain smooth pitch and roll control:

3690855825?profile=original but according to my results I'm afraid it just doesn't. I've played around with different covariance matrices for process and measurement noise, but never getting satisfactory results. The best I could obtain is around this one:

3690855782?profile=originalAny hints?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi everyone,
    I've set up an animation of a quadrotor using the Virtual Reality Animation objects, but am having trouble with viewing the orientation changes of the quad.

    To be more specific: I have a simulator going, where I calculate from rigid body dynamics the trajectory of it in time. This is, I have x, y, z, phi, theta, psi vs. time. I put these in a 'Array6DoF' structure, and associate this to the node corresponding to the quadrotor. When pressing play, I can see the translation in all three dimensions, but don't see the changes in the orientation.

    Not sure what the problem could be. Maybe I have to add one Transform in the .wrl for each of the rotational degrees of freedom, or maybe there is some Field I need to set in order to allow the node to rotate.

    Any help is most welcome.

    Thanks,
    Robbie
  • Hi Tom,

    I´m currently working on a similar project, and I´m stuck with the animation. I´m using the Virtual Reality Toolbox to animate, but the thing i´m missing is the VRML model of the quadrotor, and since I have the MacOS version of the toolboxes, I don´t have the VRML Builder to draw it myself. I´ve been searching everywhere, but can´t find a .wrl model that will work in Matlab.

     

    It would be great if you could pass me the one you have, which looks very nice.

     

    Best,

    Robbie

  • Hello Tom, 

     

    Did you use any book to assist you with the quadrotor simulator? If so, which book? 

     

    I've been looking for a simulator which allows me to use different control strategies and also simulate way point, follow a predefined path, and obstacle avoidance... but I haven found any... so I started thinking that maybe I'd have to do it myself, but honestly I have no knowledge of how to make 3D simulations in matlab nor have any idea of how you designed that quadrotor body for your simulation...

     

    So I'd like to know how and where to start.

  • One more note - if you haven't figured it out yet, your model of the accelerometer outputs will make them impossible to use for state estimation.  If ax and ay are always zero, you can't measure the attitude with the accels and your updates will be wrong.

     

    In reality, the ax and ay outputs aren't zero, but near hover without wind they are very close to zero.  In fact, the accels measure scaled versions of the body-frame velocities (weird, huh?).  If you want high accuracy, you can't assume that the accels are measuring gravity.  If accuracy doesn't matter, on the other hand, then you can probably get away with it.

  • Hey Tom,

     

    A chapter in my MS thesis deals with this very topic.  I'm one of Randy Beard's grad students at BYU.  My thesis will be published really soon - I defended it last week and will be submitting it tomorrow.  I'm not sure if there are any specific rules for distribution before it is officially published... but once it is out, I'd be happy to send it to you.

     

    In case you care to know, I think that my thesis should put to rest any debate about accelerometer-based estimation on quadrotors - there has been a long-standing debate whether they are even useful on a rotorcraft here on DIY Drones and elsewhere.

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @DanielChiaJH: @a1k0n @diyrobocars @circuitlaunch And here's the final showdown! Video courtesy of @chr1sa I think I was a little faste…
22 hours ago
DIY Robocars via Twitter
RT @DanielChiaJH: @a1k0n @armand_dpl @SmallpixelCar @diyrobocars @circuitlaunch I use @foxglovedev Foxglove Studio for my visualization nee…
22 hours ago
DIY Robocars via Twitter
22 hours ago
DIY Robocars via Twitter
RT @a1k0n: @DanielChiaJH @diyrobocars @circuitlaunch Here's my car's view of that race. About 8.4 second lap times for laps 2 and 3... both…
Monday
DIY Robocars via Twitter
RT @DanielChiaJH: Great racing against @a1k0n today at @diyrobocars! Pretty cool to both break sun-9s at the track today I think I got very…
Sunday
DIY Robocars via Twitter
Broadcasting the @circuitlaunch race live now at https://m.twitch.tv/diyrobocars Races begin around 2:00pm PT
Oct 1
DIY Robocars via Twitter
RT @a1k0n: ran a huge number of hyperparameter tuning experiments yesterday; now I can train a new policy, far with better quality, in 15 m…
Oct 1
DIY Robocars via Twitter
RT @a1k0n: Did I get rid of hand-tuned parameters? Yes. Am I still hand-tuning more parameters? Also yes. I have a few knobs to address the…
Sep 26
DIY Robocars via Twitter
RT @a1k0n: I'm not going to spoil it, but (after charging the battery) this works way better than it has any right to. The car is now faste…
Sep 26
DIY Robocars via Twitter
RT @a1k0n: Decided to just see what happens if I run the sim-trained neural net on the car, with some safety rails around max throttle slew…
Sep 26
DIY Robocars via Twitter
Sep 24
DIY Robocars via Twitter
RT @SmallpixelCar: @a1k0n @diyrobocars I learned from this. This is my speed profile. Looks like I am too conservative on the right side of…
Sep 24
DIY Robocars via Twitter
RT @a1k0n: @SmallpixelCar @diyrobocars Dot color is speed; brighter is faster. Yeah, it has less room to explore in the tighter part, and t…
Sep 24
DIY Robocars via Twitter
RT @a1k0n: I'm gonna try to do proper offline reinforcement learning for @diyrobocars and throw away all my manual parameter tuning for the…
Sep 23
DIY Robocars via Twitter
RT @circuitlaunch: DIY Robocars & Brazilian BBQ - Sat 10/1. Our track combines hairpin curves with an intersection for max danger. Take tha…
Sep 22
DIY Robocars via Twitter
RT @SmallpixelCar: Had an great test today on @RAMS_RC_Club track. However the car starts to drift at 40mph. Some experts recommended to ch…
Sep 11
More…