All,

 

I've been trying to use the in-flight leveling function in my jdrones hexacopter, but can't ever seem to get it to work. After some trial and error, I've come to the conclusion that for some reason, the in-flight leveling only seems to be activated in my APM for 13 seconds - at least the green LED only flashes for that long, and the copter seems to go back to normal flight pretty quick while trying to calibrate it. Any thoughts as to why I'm having this problem and what I might be able to do to fix it?

 

Interestingly, it does take 20 seconds to arm in-flight leveling mode...

 

I'm going to try re-installing the firmware and see if that fixes the problem

Views: 381

Reply to This

Replies to This Discussion

Nope, re-installing the firmware didn't fix the problem.....

All,

 

Still having problems getting in-flight leveling to last longer than 13 seconds in my hexacopter. From browsing the forum and the Wiki, it looks like I can set up the software to allow me to turn in-flight leveling on an off using channel 7. From the Wiki:

 

Auto Trim

#define CH7_OPTION CH7_AUTO_TRIM

Allows you to hold trim the accelerometers of the copter when this switch value is high ( > 800).

 

However, I have a few questions:

 

1. First, does this do what I think it does. Does this, in fact, enable in-flight leveling?

2. Once this in enabled in the code, I can't figure out how I would actually turn it off, since my radio doesn't generate pulse values less than about 1050. What am I missing here?

3. Would this work more or less the same as the current in-flight leveling procedure (hold arm for 20 seconds)? In other words, with channel 7 'on' and thus the copter engaged in in-flight leveling, do I simply use the sticks to try and get the copter into a level flight, during which the APM will use my stick movements to adjust the accels. Once the copter is balanced, land the copter, turn channel 7 'off', and new settings will be saved to APM. Is that all correct?

 

Any help you guys can provide would be most appreciated.

O.k. Never mind on question 2. I think I've figure that out. The software takes the pulse values and scales them. So when the Wiki reports >800 on channel 7, is required to activity auto_trim, that's not the pulse value received from the transmitter, but the scaled value interpreted at the APM. 

 

If I'm wrong in my interpretation (or even just not quite accurate), anyone please correct me!

I'm starting to feel like this is just a conversation with myself. Oh well; posting here what I've learned for posterity and future APM users. 

 

So looking at the code, it does appear that activating auto_trim in channel 7 works exactly the same as activating in-flight leveling using the arming procedure. I've made those changes to the code, but haven't had a chance to use it yet (waiting for a windless day).

 

Additionally, I found this line of code in 'motors.pde':

 

if (arming_counter > AUTO_LEVEL_DELAY) { auto_level_counter = 155; arming_counter = 0;}

 

By changing the value of 'auto_level_counter', you can influence how long the in-flight leveling procedure lasts. Because I was only getting 13 seconds out of my APM, I changed the value to 500 and now I get about 45 seconds.

 

Still not sure why the timing of my APM seems to be so fast in this loop. Everything else 'seems' to work at the proper speed.

 

 

 

When performing the in-flight trim, can one be in alt_hold mode to make it easier???

 

Well you can't arm the copter in alt_hold, but I don't see anything in the code that would prevent you from putingt it into alt_hold once airborne, even if you're in in-flight leveling mode. However, I didn't write the code and I've never tried it, so I'm not sure. Give it a shot and let us know what happens!

 

 

Reply to Discussion

RSS

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service