I recently steeped down as moderator so I can address this issue and the BS about it. Over the next few day's I be going over the code and addressing the real issues and possible solutions or not possible solutions. Ones that work or don't work.
First we need to establish exactly what the APM should do in failsafe and what the safety issues really are. So lets hear the issues cause and effect and we'll get to the bottom of this one way or another. I hear talk about fixes that I don't consider fixes just work arounds. I know that one of them works for the 9x but it doesn't fully address the issue and nothing I have seen so far does.
I'll be digging out the code and finding the truth myself so lets have at it.
Tags:
Permalink Reply by Drone Savant on November 2, 2012 at 9:23am Thanks John... I only plan to do props off tests for the time being.
"Jitter is tested by using a scope to look at the generated PPM output signal"
Should I be able to use my Saleae (http://www.saleae.com/logic) to check this out? Is there a methodology to what you are looking for specifically?

You should be looking for. uhh. jitter.
Meaning that the PPM output pulse width should match the PWM inputs as closely as possible, and that the putput pulses are stable and don't have small fluctuation (around 0.5us is normal) when the input is stationary.
Permalink Reply by Drone Savant on November 2, 2012 at 10:50am "You should be looking for. uhh. jitter." - lol understood there. I guess I should have specified a bit more that I was fishing for what you considered to be an acceptable level.
"around 0.5us is normal" is what I was looking for. Thanks again John.
Permalink Reply by Boston UAV on November 2, 2012 at 6:47pm Ok, so I took a look at the Watchdog Timer and Brown-Out detection implementation on a 3DR APM 2.5 board.
3DR APM 2.5:
Since the bootloader clears the MCUSR that means we have no idea what type of reset just happened. It is possible the MCUSR value is getting cached somewhere before it is cleared... does anyone know which bootloader is used? I really think logging these two data points would help with crash analysis.
It is worth noting that I also tested a 2.5 clone board and it did not have a patched bootloader, so while the ISR worked, on WDT reset the bootloader continuously reboots until power is cycled.

As I have said many times by now. Nothing is ever as simple as it looks on paper. Writing some lines of code to enable a new feature isn't even half the job. Figuring out all the unforeseen consequences either by testing or the hard way (crashing) is where the real work begins. While we have no plans to support clones, it is a very good indicator of the type of problems you get in a system like this. Do you think earlier versions of Ardupilot hardware have the fixed boot-loader with watchdog compatibility?
Permalink Reply by Drone Savant on November 3, 2012 at 8:35am "WDT reset the bootloader continuously reboots until power is cycled" - I have some 3dr branded gear that has the same issue, so it is by no means clone specific (these conversations should be hardware agnostic). I want to say my 2560 APM1 did this when I looked at using the motors.pde patch without first updating the boot loader.
I believe the behavior was addressed in this thread http://code.google.com/p/arduino/issues/detail?id=181, and for some reason I think Optiboot handles these cases properly as well http://code.google.com/p/optiboot/
"Optiboot runs your sketches sooner, with no watchdog issues"
I've attached the bootloader that 3DR provided me with a while back for my APM2... I want to say that the MCU issue is present in this variant "bootloader for ATMega2560 chip (APM2): stk500boot_v2_mega2560_patch.txt"
More info here: http://diydrones.com/forum/topics/watchdog-friendly-bootloader-for-...
Permalink Reply by Boston UAV on November 3, 2012 at 8:52am Thanks, I'll likely submit a ticket for the bootloader and ask them to cache the MCUSR before clearing it.
Permalink Reply by Boston UAV on November 3, 2012 at 8:47am Look John, I appreciate your response but I'm just supplying further factual information.
Difficulty: I never disagreed.
Capability: Yes, I'm capable.
Clones: Don't care, just another data point.
Backward HW Compatibility: Never expected it to be, but they do support WDT ISR.

And it is much appreciated Boston. I was not talking to you specific, but more in general about the "why don't you just...<insert>" type of questions/complaints that you see a lot of.
And again the watchdog is a good example of how something that might seem simple at first glance, isn't. Sure it would not take many lines of codes turning on WDT for the APM 2.x and patch up the boot-loader. But the same code is supposed to run on older boards including APM 1.x ones already in the hands of users. How do you know if the boot-loader on your board is compatible? The average user it not expected to have a ISP programmer, so turning on WDT on an older board, would brick it (never ending resets).
Permalink Reply by 12-HAK on November 9, 2012 at 3:18am Not sure how this will go as I never really tested it in flight and now I run FrSky I dont need it but...
I added some user code to watch a "Heart Beat" from a 9X running er9x. It is simple if the heartbeat stops for 10 secs (count 100 on 10hz loop) send a RTL and I also set the LED B to come on to indicate it was triggered (for testing etc).
uservariables.h
int heart_beat,count_lost,mode;
boolean lost;
usercode
void userhook_MediumLoop()
{
if (heart_beat == g.rc_8.radio_in){
count_lost++;
}else
{
count_lost=0;
if (lost){
lost = false;
digitalWrite(B_LED_PIN, LED_OFF);
set_mode(STABILIZE); // control_mode = STABILIZE;
}
}
heart_beat = g.rc_8.radio_in;
if (count_lost>100){
lost = true;
digitalWrite(B_LED_PIN, LED_ON);
set_mode(RTL); // control_mode = RTL;
count_lost=100;
}
}
Then on the er9x set up a heart beat on CH8
as per this link http://postimage.org/image/w0fumpa9n (creds to buzz from http://9xforums.com/forum/viewtopic.php?f=35&t=1054)
I got to the point of testing the LED comes on meaning the code activates for a failsafe but never tested in the air.
Hope that helps someone and love to here is someone is brave enough to try
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.15 members
50 members
247 members
106 members
1279 members
© 2013 Created by Chris Anderson.
Powered by
