Hi all,
My motivation to get involved in the development team was to bring a good ACRO mode to ArduCopter. Three or four months ago Robert Lefebvre suggested that we could integrate the rate error and use it to correct the platform in the body frame. He went on to demonstrate this on Heli's. We have since learned that MultiWii use a similar approach and code was developed by Bob Dorion based on MultiWii and discussed here http://www.diydrones.com/forum/topics/flipping-arducopter.
I have taken Robert's approach and integrated it with the current ACRO trainer aids with the help of Robert and Bob. Here is the result:
This code is based on ArduCopter 3.01rc1 so if you haven't got this flying yet, don't bother with this code.
Changes:
Replace Earth Frame ACRO with Body Frame ACRO
Reduce the dead band on the roll and pitch inputs
In the same way as you could before you can disable all trainer functions by setting
ACRO_BAL_PITCH,0
ACRO_BAL_ROLL,0
ACRO_TRAINER,0
For my flight testing I have been using:
ACRO_BAL_PITCH,50
ACRO_BAL_ROLL,50
ACRO_P,4.5
ACRO_TRAINER,0
Things to discuss are:
Is the performance acceptable?
What additional features are needed? (switched trainer functions, zero throttle doesn't stop motors)
Is there a better algorithm?
Do you see any problems with the code?
How does the performance and feel compare with other systems? (please only comment if you have flown those systems and this system on a well set up copter, anything less is a waist of every bodies time)
I have spent at least 20 minutes doing nothing but flips and rolls of various combinations and mixtures and a similar amount of time doing yank and bank maneuvers. I have not found a problem or any bad habits.
I look forward to your feedback and ideas.
Comments
Hey Leonard, couple comments:
I don't think you want to use G_Dt when integrating the omega vector to calculate the angle error. If you dig around a bit, you'll find the DCM matrix is updated using "omega * ins->get_delta_time()", which may not match the G_Dt variable which is calculated from the fastloop timer for the PIDs. (unless I'm missing something....)
I also put a slow bleed on the angle error to allow it to 'forget' any angle displacement if I touched down. This one may not strictly be necessary as it can be a source of very slow drift in the air, but it is nice to have the motors stabilize after some number of seconds on touchdown.
Overall, I like this implementation better my stolen multiwii idea hack. I have two outer loops creating competing rates that get mixed - breaking both outer loops in a sense. You create a single outer error signal to target so it should perform better. Your pitch leveling using yaw and pitch movements is also the right way to go.
@Dimitri,
Yes, AC3.0 and onwards works on the PX4. You can't compile for px4 with arduino though so you should follow the instructions for building with make for px4 here.
Dimitri: I assume that it will compile for PX4 but I haven't tried to do that myself.
Martin: That is a good idea to get around the throttle problem!
My quick test this arvo.
Hi Leonard,on my radio a JR XG8 i have it set in accro mode but can have 3 flight position's,so i have my accro mode set to 100 rate 20% expo and the most important the throttle low end at 20% this helps a lot,Marty.
Excellent! Unfortunately I don't want to risk my APM quad in acro just yet, but this should compile for PX4 too, correct ?
By the way, #2 is the one that needs to be debated with some other people on the dev team. Some people just want the motors to spin, others (like you) also want it to stabilize at min throttle.
Some additional changes it improve the ACRO experience would include:
1. Separate parameter for yaw and roll/pitch to replace ACRO_P
2. Motors always spinning and stability patch enabled
3. We could add some default expo to the stick inputs.
I found a problem with the yaw controller that basically stops things from leveling using the yaw axis. Not a serious problem but here is the line that needs to be changed.
nav_yaw = (float)nav_yaw*constrain_float((1-fabsf(stick_angle/4500.0)),0,1)*cos_pitch_x;
I lost my gopro so it is a bit hard to do a video. I would need to use my phone! To be honest though, I don't think the pilot would do acro justice.
A frame mounted camera might look ok but I am not comfortable doing things too close to the ground so the ground based camera isn't going to be great.
-
8
-
9
-
10
-
11
-
12
of 12 Next