This is a simulation I'm working on to improve the Altitude hold and change control laws. I have identical code from Arducopter running in Flash as OO Javascript so I can ensure the behavior is the same as the real thing. I sampled data from the barometer to introduce identical noise into each copter's solution. This allows me to test PID and other tricks side by side and see how the copter will behave. The copter itself is a simple physics equation and should be fairly accurate.
The Hover value is in your logs when you switch to Alt Hold. You should see it with the mode switch name. Mine was 495 which is the equivalent of 49.5% throttle. A lower value has a profound effect on the flight so play around with that.
The A copter is the current control solution. The B and C copters are Pi->Pi rate based solutions and are identical. You can adjust PID setting to pit the two against each other.
The scale on the left is meters. The Sonar is active and the mix is identical to the current AC2 solution.
This new code is in testing and will be available next week in 2.0.40b
Jason
Comments
Hi Jason, great programme, alt hold is the major issue I am struggling with, am I to take it that with alt hold there should be no I value, what values make this model most stable, is it possible to make the flas model perfectly stable, if so, what values do you set
That's great, thanks! Looking forward to test!
That's what I believe as well. A heavy craft may have a higher value. A powerful one will have a lower value. In the end it's the thrust vs gravity. Here is the sim code:
John: the only input you need is your hover throttle, which depends on your setup.
it includes weight, motor types and everything else you could vary
Very cool. Say, what are the parameters of your copter equation? Any provision for specifying custom weight, etc?
Really cool, hope it helps alot.
Any news on the alt hold issue in version 38, 39 and 40 were certain people get 137m as altitude and during AH at low altitude flight, seems to be using baro as reference.
Looking forward to test this, great simulation btw!
great simulation jason!
I love that it's so much like the real bahaviour