I've had some successful flights using my own platform and APv2.1.2. However I'm having some issues that perhaps someone can help with.1) under power the plane climbs above the stated height set with the config utility, I've set it to 15m however the plane will easily climb to 50 or more with no apparent correction for the overheight.The code which affects this is below:#define alt_P 2 //proportional to control the altitude hold...#define alt_error_max 10 //The maximun output in degrees to control the pitch setpoint#define alt_error_min -10 //The min output in degrees to control the pitch setpoint#define alt_pitch_p 1.5 //Altitude error, pitch setpoint#define alt_pitch_max 10 //Limits, EasyStar climb by itself, you don;t need to up the elevator...#define alt_pitch_min -10I've tried upping some of the above but am not having much success, which would give me more aggressive altitude control?-------------------------This next issue is not too bad and I have had some success with tweaking these, however I'd appreciate some ideas:2) my plane turns in a very wide arc to correct for heading errors, ie, if it misses a waypoint it flies off and makes a very large circle and then returns to try hit the waypoint again, I would like the turn to be a bit more aggressive but not so that the plane spirals too sharply or that there is too much oscillation?The code to change these settings are these:#define head_P .8 //.7 Heading error proportional (same used to move the rudder)...#define head_I .5 //.1heading error integrator Not used#define head_D 0#define head_error_max 40 //35The maximun output in degrees to control the roll setpoint#define head_error_min -40 //The min output in degrees to control the roll setpointThanks
You need to be a member of diydrones to add comments!
A further thing I saw was overshooting on a turn, possibly associated with the other problem of the wide turns, although this seemed like that it took about 3 secs to register that it was on the wrong track by which time the plane had turned quite far past the ideal track. Perhaps the 1Hz GPS refresh rate is the problem? I must also go learn more about PID loops.
@Gagarien: Nope, have done no simulation, only hands-on flying, your sim setup looks interesting though. My control authority is 100%, stabilization is also almost flawless, will try a few more flights when I get some more time. I flew at least 12 flights today.
Graham are you doing any simulation before you set out to fly, if not try my simulation set-up but not sure if it will work with APv2.1.2. This will help in tweaking the code faster, instead of wasting flights and then wonder what happend.
I also fly my own platform but had to shelf it for a while. The last flight was very good and then a take off hick-up on the next resulted in a final encounter with the shelf, hope to get it going soon to share my results.
There is a number of things to consider and my only advise is to make sure you have enough control authority on the control surfaces it self and to get the ir. stabilization trimmed just under the point where it is over correcting.
Replies
Also the plane turning more agressively now - it turned left much better left than right so changed these:
#define head_error_max 50 (from 40)
#define head_error_min -40
A further thing I saw was overshooting on a turn, possibly associated with the other problem of the wide turns, although this seemed like that it took about 3 secs to register that it was on the wrong track by which time the plane had turned quite far past the ideal track. Perhaps the 1Hz GPS refresh rate is the problem? I must also go learn more about PID loops.
@Gagarien: Nope, have done no simulation, only hands-on flying, your sim setup looks interesting though. My control authority is 100%, stabilization is also almost flawless, will try a few more flights when I get some more time. I flew at least 12 flights today.
I also fly my own platform but had to shelf it for a while. The last flight was very good and then a take off hick-up on the next resulted in a final encounter with the shelf, hope to get it going soon to share my results.
There is a number of things to consider and my only advise is to make sure you have enough control authority on the control surfaces it self and to get the ir. stabilization trimmed just under the point where it is over correcting.