PDA

View Full Version : APM 2.X with TBS DISCOVERY



oosnoopy
30th October 2012, 10:21 AM
I haven't seen any mention using an APM as their autopilot/stabilizer here yet (which you should consider since it's currently the most robust autopilot/stabilizer on the market, and open source!)

So if anyone is, do you have any advice for tuning the platform? Anything special required? With the stock DJI motors, I moved my Rate Kp down to .120, and Haven't touched my Stabilize Roll Kp yet.

Cpig
6th February 2013, 01:46 AM
Snoopy,
Did you ever get your tune figured out? I'm thinking about getting the same setup but not sure how APM will handle the asymetrical frame.

Blackbird
6th February 2013, 07:06 AM
Hello, I'm also interested in building a similar configuration ;)

Thank you

oosnoopy
7th February 2013, 08:15 PM
Actually I did, and I somehow missed Cpig's post. You just have to change the angles in the X config which does require compiling your own code (which isn't hard). Also, the quad will fly on the normal X config, but the controls feel a little "off".

Here's the DIYdrones thread (Actually I did, and I somehow missed Cpig's post. You just have to change the angles in the X config which does require compiling your own code (which isn't hard). Also, the quad will fly on the normal X config, but the controls feel a little "off". Here's the DIYdrones thread were we talk about all the good stuff and someone else figured out the exact angles of the TBS frame to use.) were we talk about all the good stuff and someone else figured out the exact angles of the TBS frame to use.

Here is what you edit in the file AP_MotorsQuad.cpp Let me know if you have any questions. Also, you can directly upload with the arudino tool, you don't need to make a .hex file.

Edit: I posted the old code, thanks Blackbird.

Lioon
8th February 2013, 02:12 AM
The Link doesn't work. Can you post it once more, oosnoopy?
Do you know a good documentation that explains how to compile and upload the own code to the APM?

And: Which parameters do you use for tuning?

Blackbird
8th February 2013, 04:18 AM
http://diydrones.com/profiles/blogs/arducopter-tbs-discovery-style


add_motor(AP_MOTORS_MOT_1, 55, AP_MOTORS_MATRIX_MOTOR_CCW, AP_MOTORS_MOT_2, 1);
add_motor(AP_MOTORS_MOT_2, -125, AP_MOTORS_MATRIX_MOTOR_CCW, AP_MOTORS_MOT_1, 3);
add_motor(AP_MOTORS_MOT_3, -55, AP_MOTORS_MATRIX_MOTOR_CW, AP_MOTORS_MOT_4, 4);
add_motor(AP_MOTORS_MOT_4, 125, AP_MOTORS_MATRIX_MOTOR_CW, AP_MOTORS_MOT_3, 2);

oosnoopy
15th February 2013, 10:41 AM
The Link doesn't work. Can you post it once more, oosnoopy?
Do you know a good documentation that explains how to compile and upload the own code to the APM?

And: Which parameters do you use for tuning?


Try this guide for compiling. Its no different than uploading a sketch to an arduino board.
http://code.google.com/p/arducopter/wiki/Code

I don't have any 2.9 parameter yet, I've been screwing with with the ardupilot on my trex500, and need to finish rebuilding my TBS.

oosnoopy
27th February 2013, 06:40 PM
Here are the actual correct angles. I'm doing a step-by-step write up on how edit and upload the custom code that I'll post soon.


// X frame set-up
add_motor(AP_MOTORS_MOT_1, 62, AP_MOTORS_MATRIX_MOTOR_CCW, 1);
add_motor(AP_MOTORS_MOT_2, -133, AP_MOTORS_MATRIX_MOTOR_CCW, 3);
add_motor(AP_MOTORS_MOT_3, -62, AP_MOTORS_MATRIX_MOTOR_CW, 4);
add_motor(AP_MOTORS_MOT_4, 133, AP_MOTORS_MATRIX_MOTOR_CW, 2);


http://i.imgur.com/dCQAhgD.jpg

gvickers
28th February 2013, 02:01 PM
Does the quad feel better flying when you change the motor angles? Have you done a before/after test? I have it on stock settings working alright

oosnoopy
28th February 2013, 03:35 PM
Does the quad feel better flying when you change the motor angles? Have you done a before/after test? I have it on stock settings working alright

Yes it does, and what I noticed is mostly "control/feel based".

For example on the default X config, pushing the pitch/roll (right stick) to full top right, doesn't feel like the copter moves exactly like that. With the update config, control inputs seems to better correspond the way the quad behaves in the air.

I'm sure there are other things, but they would probably have to be measured. This is just what really stood out to me when flying.

WillM
28th February 2013, 05:36 PM
That's awesome about the AMP2.5. First I've heard of an fc which can be configured for arm placement (not that I know a lot about many of the fc options out there).

Do you have experience with any other fc's on the disco? How does the APM2.5 stack up, relative to manual and 'stability' modes on the disco, compared to other fc's?

Lioon
1st March 2013, 01:59 AM
Here are the actual correct angles....

// X frame set-up
add_motor(AP_MOTORS_MOT_1, 62, AP_MOTORS_MATRIX_MOTOR_CCW, 1);
add_motor(AP_MOTORS_MOT_2, -133, AP_MOTORS_MATRIX_MOTOR_CCW, 3);
add_motor(AP_MOTORS_MOT_3, -62, AP_MOTORS_MATRIX_MOTOR_CW, 4);
add_motor(AP_MOTORS_MOT_4, 133, AP_MOTORS_MATRIX_MOTOR_CW, 2);
Thanks! But I'm wondering if there are different TBS Disco frames on the market because I get slight different angles: I cannot measure it super accurate (for the lack of real tools) but I get around 70 and around 129 (iPad measurement :()


I'm doing a step-by-step write up on how edit and upload the custom code that I'll post soon.
That's great!

oosnoopy
1st March 2013, 10:26 AM
That's awesome about the AMP2.5. First I've heard of an fc which can be configured for arm placement (not that I know a lot about many of the fc options out there).

Do you have experience with any other fc's on the disco? How does the APM2.5 stack up, relative to manual and 'stability' modes on the disco, compared to other fc's?

Generally speaking, the Naza works better in terms of flying out of the box, requires less tuning, and feels more like a heli, however the APM is open source, and is constantly getting better, for no cost. The latest roll out with 2.9 has a Z axis based alt-hold which is just awesome.

You won't get a better Naza unless you pony up and buy their new model (but increased competition might force them to lower their outlandish prices.)

I've never played with the open copter, or KK board myself.



Thanks! But I'm wondering if there are different TBS Disco frames on the market because I get slight different angles: I cannot measure it super accurate (for the lack of real tools) but I get around 70 and around 129 (iPad measurement :()


I didn't make that measurement, someone else on the diydrones forms did, but I think it's close enough to feel right. If you get can a more accurate measurement, please share!

Lioon
1st March 2013, 03:08 PM
I didn't make that measurement, someone else on the diydrones forms did, but I think it's close enough to feel right. If you get can a more accurate measurement, please share!
I am an idiot: I measured the angles between the arms and the longitudinal axis. This is obviously wrong... I guess the correct angle is between motor mount and CoG?


Generally speaking, the Naza works better in terms of flying out of the box, requires less tuning...
My Disco/APM combination flew really great with stock settings. Later I only changed the Rate Control P value...

oosnoopy
19th March 2013, 07:40 PM
I just wrote this: http://www.moderndrones.com/2013/03/how-to-configure-offset-frames-with.html

Give a shot and let me know if you have any trouble or find any errors.

turdsurfer
19th March 2013, 07:46 PM
Thanks. Your how-to is a little confusing in that the angles in the code screenshot are not the same as the ones in the top-view image. Which are the real angles for the Discovery?

oosnoopy
19th March 2013, 07:54 PM
Thanks. Your how-to is a little confusing in that the angles in the code screenshot are not the same as the ones in the top-view image. Which are the real angles for the Discovery?

Bah, it's confusing because I pulled the wrong angles again. The correct angles are 62 and 133. I updated the page to reflect that.

Are you on 2.8 or 2.9 now?

turdsurfer
19th March 2013, 08:00 PM
Nice. I'm on 2.9 still (I think because I don't know how to check it - the terminal just shows garbled text), but I think you meant to ask someone else.

oosnoopy
19th March 2013, 08:04 PM
Nice. I'm on 2.9 still (I think because I don't know how to check it - the terminal just shows garbled text), but I think you meant to ask someone else.

2.9 has the rate Z acceleration for alt hold and loiter which requires some vibration dampening. I just started tuning mine and wanted to know what values you had.

turdsurfer
19th March 2013, 08:09 PM
2.9 has the rate Z acceleration for alt hold and loiter which requires some vibration dampening. I just started tuning mine and wanted to know what values you had.
Ah ok. Well I'm not using a Discovery but a Goliath instead (which also is an imperfect X), so unfortunately I can't help you there. I just used the bench method to tune mine more or less, and use tune P using a pot in flight.

Blackbird
22nd March 2013, 05:04 AM
Hi, I just made my first flights with my TBS and APM 2.9.1 with your angle values.

I didn't try with stock firmware but it seems ok except my TBS flies a little backward cause of the batterie weight (380g). Did somebody notice this kind of behaviour too ?

Here's my setup, the props are are the 8" now because I'm on 4S.

http://image.noelshack.com/fichiers/2013/12/1363685270-2013-03-19-08-17-39.jpg

oosnoopy
22nd March 2013, 05:41 PM
While I've been told you can tune out any CG issues, I gave up on that and went ahead and moved my battery forward to get a good CG. This means that two of the red support beams don't screw in on the top, but I use it more of a battery stop.

If anyone has tips for balancing it out I would love to hear how. How do the Naza guys do that?

Pixturethis
23rd March 2013, 07:13 AM
I have Naza's & APM's. Best way to take care of CG is to move things around to get the CG right, the quad will fly better with the right CG. On my TBS I like mine ahead of the CG spot marked on the bottom board, but that's me.

Marc

Blackbird
26th March 2013, 04:11 AM
And what is a right CG for the TBS exactly ? :D

rwijnhov
26th March 2013, 04:54 AM
1cm in front of the cg marking.

Blackbird
26th March 2013, 05:33 AM
Ok thanks :), and the APM has to be right above this mark ? Because with the APM size and battery it will be very difficult for me...

oosnoopy
26th March 2013, 09:51 AM
Generally speaking it's where you put the APM, but also it's the CG of the chassis in relative location to the motors. It doesn't have to be prefect, but the closer it is to prefect, the better it will fly.

Lioon
31st March 2013, 05:41 PM
I just wrote this: http://www.moderndrones.com/2013/03/how-to-configure-offset-frames-with.html

Today I finally updated my APM with the help of your manual. Thank you very much! At the moment I do not know if there is a big difference to the stock settings, I only could test it in my flat ;) Interesting: the tuning values (rate P, D and I) are nearly exact the same as before...

BTW: Is there some information or value in the Mission Planner which indicates, that your are using a "hand built" firmware with different frame angles?

oosnoopy
31st March 2013, 07:56 PM
Lioon,

No you won't see any difference in Mission planner between any custom code and stock build. Overall this shouldn't change your tuning values much, it's more in direct flying of the quad. Before I made the change full forward and right stick (top right) didn't feel like it made the quad fly exactly as such. Not that it's unflyable with the stock settings, I just feel it's a more on target like this. Also, knowing how to load your own code makes it really easy to code any custom changes or logging you want to add.

Would you mind sharing your parameters and motors/props/battery cell count? Tuning alt-hold and loiter with the new 2.9 changes are a little tricky, I want to see what others are doing. I would encourage anyone to add tuning advice for this platform (mod or not). Lets get this thing dialed in.


FYI, there is a new 2.9 patch coming up that makes things more stable in bad vibration environments.

Lioon
1st April 2013, 06:01 AM
Would you mind sharing your parameters and motors/props/battery cell count? Tuning alt-hold and loiter with the new 2.9 changes are a little tricky, I want to see what others are doing. I would encourage anyone to add tuning advice for this platform (mod or not). Lets get this thing dialed in.

Yes, let's do this! What's the best way? Upload the MP setting file? For the beginning I post a screenshot of my PID settings.

Components:

APM 2.5, Firmware 2.9.1
Motors: TBS 900kV (Tiger MT2216-11)
Props: Graupner 9x5 E-Props
Battery: Dymond 4S, 3200mAh


Till now I tuned only Rate Control P, I and D. But the copter flies quite stable also in loiter and alt-hold mode (at least with the stock X quad angles I used till yesterday. I will test the new angles today). Nevertheless I thought sometimes the copter was struggeling in loiter mode not to make a backflip when I stopped it suddenly from a speedy forward fly. Looking forward to try this with the new angles.

23656

Update: Successful test flight with the new angles. Everything went fine, but we had strong wind, so I was not able to notice a big difference to the old setting.

oosnoopy
1st April 2013, 07:47 PM
Awesome, let us know how your tuning goes (I'm probably not going to get a chance to tune until later this week). The screenshot for the basic settings (which are what we normally tune) but you can also go to mission planner and save a text file of all of your parameters.

Lioon
2nd April 2013, 01:09 AM
I used the "Dave C Tuning Guide" (http://diydrones.com/forum/topics/arducopter-tuning-guide). Interestingly, this method produced exactly the default values for rate_D and rate_I​​. Only my rate_P is significantly higher than stock setting.

Update: Video of the maiden flight with new angles: http://youtu.be/N1_pTub-H4Y

Pixturethis
5th April 2013, 07:45 AM
Awaiting my APM to arrive to put in my TBS. looking forward to the tuning.
Marc

oosnoopy
6th April 2013, 09:45 AM
Video looks good. If you're flying FPV, you might want to try learning to fly in acro mode, it's much smoother and is better on the battery for FPV flying, but still use stabilize for hovering in place. What kind of run times are you seeing? I the weather stays nice I'm going to start tuning. I'll be tuning for stock DJI motors (yeaaaaaaaaaaah) and 10" DJI props.

Also, 2.91b is out, I would recommend you upgrade to that (lots of vibration changes to avoid flyaways), and yes that means downloading the zip code again and moving those files again :) Save your current parameters so you can reference them for making more major changes. Don't overwrite the new changes because they defaulted some stuff you'll want to leave (like the main filter to 20hz from 40 hz)

Lioon
7th April 2013, 02:57 AM
Video looks good. If you're flying FPV, you might want to try learning to fly in acro mode, it's much smoother and is better on the battery for FPV flying, but still use stabilize for hovering in place. What kind of run times are you seeing?
With my 3200mAh 4S battery I can fly about 10 minutes, but as you see in the video I do not go very fast yet. So with full throttle it will last shorter... (or I use acro mode, good idea!)


Also, 2.91b is out, I would recommend you upgrade to that (lots of vibration changes to avoid flyaways), and yes that means downloading the zip code again and moving those files again :) Save your current parameters so you can reference them for making more major changes. Don't overwrite the new changes because they defaulted some stuff you'll want to leave (like the main filter to 20hz from 40 hz)
I did that update yesterday. I could only test it in the room, but it seems okay. Did you see, that the 2.9.1b has a "V frame" feature for quads ("Configuration" tab, then "Arducopter Level")? It seems to be made for frames like the Discovery, but I did not find any documentation.

oosnoopy
7th April 2013, 09:01 AM
Yep I just updated and saw that. I think someone is working on that for a new config (there is a octo V, but it's in another file). Also you should write down your key parameters, do an erase eeprom and reset on the APM, then re-upload your code (because they updated some default parameters with 2.91b you won't have if you manually update the code because it just keeps your old parameters)

Tuning wise I'm with 10" props, 3cell lipo, and stock DJI motors I'm bouncing around .10 and .12 for Rate_KP and around 3.4-4.5 for Stab_KP. Alt-hold was working nicely on stock throttle accell settings, but I've never been a big alt-hold user. Arco mode with auto-level (default) turns on flys a lot more like the Naza, I really don't like how the APM acts in sustained forwarded flight.

oosnoopy
8th April 2013, 12:08 PM
I had good luck with these settings, tuning without wind is much simpler. Loiter is awesome, alt-hold is beyond amazing. Still flying acro mode.

These are for stock DJI motors (920kv), 10" props, and a 3cell lipo.

24116

Pixturethis
8th April 2013, 12:27 PM
I have mine installed & started tuning.
Flying really great in stab mode. Having trouble in Alt. hold mode.
Here is my setup.
Fpvmanaul 900kv 2216 motors
APC 9x6 props
DJI 30 esc's flashed.
4s3000's nano-tech

The problem I'm having is the motors are surging up & down. Sounds like the APM is turning them on & off. It climbs & descends fine, just doesn't hover.
Any ideas? I'll post my setting page tonight.

Thanks Marc.

oosnoopy
8th April 2013, 03:16 PM
Marc,

In alt-hold is the quad oscillating up and down quickly? If so, I think your throttle accel settings are too high, basically it's trying to adjust with too much power and overshooting, and you'll want to adjust the Throttle Accel settings. I had to do the same on my trex 500.


The key default values for Throttle Accel are.
P: .75
I: 1.5

Note that P is double that of I. I was told to try and keep this 2:1 ratio. If you turn rate P down to say .5, adjust rate I to 1, etc etc.

Pixturethis
8th April 2013, 05:25 PM
I'll try it tonight. I've played with the 0 on channel 6. But could never get it to stop. I could get it to almost stop, but not like it is on my dji 330 with a APM on it. It's perfect on the 330. I wonder if it is the higher voltage of the 4s battery.

Marc

oosnoopy
8th April 2013, 05:29 PM
Yep most likely, the default setting is probably setting the the thrust output of the 3dr official test quad. Make sure you keep that 2:1 ratio with the P and I value.

Pixturethis
8th April 2013, 08:17 PM
Now it is at
P .125
I .250

Motors sound better. Now it hunt up & down about 6 feet. I had it at p .250, I .500. So it is in between those two settings.

Pixturethis
9th April 2013, 07:31 PM
What setting is it to decrease the max angle the apm will output. I see that mine with full stick will get to about 45 degrees, how do I limit it to about 25 degrees? Do I use my dual rates ? Or is there a setting in the mission planner?
Still having trouble with alt. hold, moved up to P .150 &I .300. Still jumping up & down. What will "D" do to the alt hold ?

Marc.

oosnoopy
15th April 2013, 09:13 AM
I'll have to check on the max angle for stabilize. You might try changing the parameter acro_P (default is 4.5, or 45 degrees).

Can you take a video of what it's doing in alt hold? Also, how kind of vibration dampening are you using? I don't know the effects of changing D in alt-hold.


I did some more tuning in the wind and had to drop my stabP a lot to make it no get crazy in the wind, but it was fine with no wind. I need spend more time tuning.

Updated. Flying much better with increased Rate_I
24468

Pixturethis
18th April 2013, 05:38 PM
I'll try changing acro_p.
Ice changed over to plush 30 esc, flashed & NTM 2830-800kv motors with APC 9x6's
It moved my throttle curve up a bit, so might help with alt hold. I checked the vibs, they seem ok, but hard to tell, haven't found any info on what is good & what isn't.
Getting ready to put a apm in my qav400.

I really like the way stab flys, much better than a naza. Only hope the next firmware will fix alt hold & loiter.

Marc

oosnoopy
18th April 2013, 06:54 PM
Normally loiter works well out of the box. What GPS are you using? If it's the Mediatech you need upgrade the GPS's firmware.


+/- 2 on accell_Z vibrations is really good, I'm around +/- 7, and you can fly OK up to +/- 15. The Qav400 should help because the chassis has built in vibration dampening.

Pixturethis
18th April 2013, 07:21 PM
I'm using the Ublox.
I think my vibes are under +- 6.

Marc.

oosnoopy
18th April 2013, 07:29 PM
Your vibes are good, but if you're still having alt-hold trouble on the QAV try and get a video. I just got a fresh 450 kit I'm building for the sparkfun AVC so I'll try and do some aggressive testing to see if I can reproduce problems and find solutions.

Pixturethis
19th April 2013, 10:53 AM
My loiter is ok, it does the toilet bowl when flying in forward flight & then letting go of the sticks. Odd but it gets there.
I don't think the apm is meant to fly in GPS mode with the sticks. It's meant for WP flying. Not like the naza that flys really well in GPS mode.
Marc

Blackbird
22nd April 2013, 02:50 AM
There's quite good improvement with Arducopter 2.9.2 pre-beta build(3.0 at release). Loiter is very smooth. With all pids to default.

http://firmware.diydrones.com/Copter/latest/

Use with care, because still a test version.

rfnoise
12th June 2013, 05:40 PM
Hey guys!

What is the best placement of the APM? I really want to put it on the lower plate like the Naza. I have heard that people have issues with current flow that disturbes the APM? Whats your opinion?

oosnoopy
13th June 2013, 11:57 AM
Hey guys!

What is the best placement of the APM? I really want to put it on the lower plate like the Naza. I have heard that people have issues with current flow that disturbes the APM? Whats your opinion?

It's fine to mount it on the bottom, you might see compass issues on the top or bottom (noise from the motors). If that's a problem you can add an extra compass to you APM and mount it farther up (or manually set the delincations).

BrittMac
13th June 2013, 08:03 PM
The APM on my hex is on the bottom plate of the included "stack". It is still exposed to light and wind but I have had no issues. The APM 2.5 in the case has a piece of foam on top of the board inside the case, so it covers the barometer. If you have one outside the case, you need to put some latex foam or as Flite Test showed, a cotton ball over it.

Otherwise, the biggest problem with the latest firmware is vibration on the z axis. You need to be sure to dampen the APM where ever you end up mounting it.

BrittMac
13th June 2013, 08:08 PM
There's quite good improvement with Arducopter 2.9.2 pre-beta build(3.0 at release). Loiter is very smooth. With all pids to default.


Hey Blackbird, that sounds great. Did they get rid of that Loiter bug with this new release?

rfnoise
15th June 2013, 07:38 AM
Ok, great. Ill let you know how it went!

lacion
16th June 2013, 10:02 AM
hey guys i'm just doing this build with stock dji motors and dji esc (flashed with blheli), and the parameters names for the motors have change a bit in 3.0



add_motor(AP_MOTORS_MOT_1, 62, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 1);
add_motor(AP_MOTORS_MOT_2, -133, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 3);
add_motor(AP_MOTORS_MOT_3, -62, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 4);
add_motor(AP_MOTORS_MOT_4, 133, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 2);

oosnoopy
17th June 2013, 10:18 AM
hey guys i'm just doing this build with stock dji motors and dji esc (flashed with blheli), and the parameters names for the motors have change a bit in 3.0

They also added a "v" frame option in 3.0. They didn't change the angles, but they did change the yaw factor. I think we should add in those yaw values.


// V frame set-up
add_motor(AP_MOTORS_MOT_1, 45, 0.7981, 1);
add_motor(AP_MOTORS_MOT_2, -135, 1.0000, 3);
add_motor(AP_MOTORS_MOT_3, -45, -0.7981, 4);
add_motor(AP_MOTORS_MOT_4, 135, -1.0000, 2);

lacion
17th June 2013, 10:42 AM
So we should use V instead of X??

Is that closer to what the tbs frame is?

Apart from the angles what changes when using the V option?

oosnoopy
17th June 2013, 10:50 AM
So we should use V instead of X??

Is that closer to what the tbs frame is?

Apart from the angles what changes when using the V option?

The new "V" option doesn't change the angles. If you want the correct angles you have to manually change the code and upload it yourself. The new "V" option does change the yaw values for a V frame, so it should yaw better.

I would recommend updating the angles, but if you're not, try the V frame and see if it yaws any better or worse than the X frame setup.

ajesq
17th June 2013, 04:30 PM
I just finished building my tbs discovery with an apm and I am having a few challenges getting it to fly stable. It definitely is not as turn key as the f450.

The main problem is tail heavy. I dont have my gopro on the copter yet but unless I put a counter weight the copter is highly unstable.

Its obvious that the battery can't sit where it is suppose to without it causing too much tail weight and/or putting too much stress on the back rotors.

Does anyone have suggestions with where to place the battery and APM to maximize stability?

Im using a 3s 5800 @ 425g.

oosnoopy
18th June 2013, 08:52 AM
Ajesq,

While you can tune out that weight imbalance, that's a real pain and too much work if you ask me. Remove the middle standoffs (the red spacers) and slide the battery forward until you get a level CoG.