Some Flight Controller Test Flights

by Octapoo

Thursday, July 22, 2021 at 20:43:00 UTC

Return to the Summary in Ecstatic Lyrics Blog

Wind was 2-3 MPH today so I decided to go fly again and record video so that it would be more fun. It is significantly more fun with video.

(This video becomes less wobbly 12 seconds in when the motor turns off, I just wanted to show some of the horizontal flight too.)

Two more clips where the propeller wasn't running and so the video isn't wobbly:

I attempted two automatic flights, neither of which went as intended.

The first automatic flight was supposed to just climb up 1000 ft, then glide down 800 ft. I have it sending the altitude to the RC controller, and I was watching it go up and right as it was about to reach the threshold to stop, it started reading 65535 or something like that, which essentially means the data was all fucked up for some reason. I let it continue to do it's thing for a minute just to see if it was just a problem with the data relay to the ground, but it didn't show any sign of believing it had reached the correct altitude. IDK what went wrong as I've definitely done that in the simulator many times so it should have worked. Since it showed no sign of deciding to come down on it's own, I switched it into manual and flew it down.

The second automatic flight was supposed to go to and then circle a barn off in the distance and then come back. Along the way it started flying up and down and up and down, which seems like a problem with it trying too hard to keep the correct altitude and over-correcting, but I'm not sure. (I do have recorded data this time though, so I can go over it for clues.) So I aborted that and flew it back manually as well.

With two failed tests, I decided I had done enough and it was time to go home. At least they weren't complete failures the auto flight controller did keep the plane in the air, and the assisted flight modes worked fine, making it easy to fly back, so both times I didn't have to walk more than 10 feet to get the plane.

...four hours later...

So altitude is stored in the flight controller in units of meters × 54. One thing that's different about the simulator vs. real-life testing is that the GPS parsing code doesn't get used with the simulator. So what if I accidentally used a "short" data variable which can only hold values from -32768 to 32767? That would make the maximum altitude be 32767 / 54 = 606.8 meters, which is about 1990 feet. So I looked in the GPS parsing code and, sure enough, it uses a "short" integer. Looking at the logs, I see the altitude values going up with the highest one being 1991 ft, and then the next one is -1990 ft, which would have displayed as 63545 since the RC controller doesn't do negative numbers. So that explains what happened there.

I think the other problem was caused by the vibration. I've heard that vibration can cause gyroscope problems, but until this flight I'd never had the motor mounted so loosely. It also seems like the gyroscope readings drift back to being correct when the motor is turned off, so I feel like I've got all of the problems in the second flight attributed to that one problem.

Here's a video of the whole flight with a voice-over so that you all can witness my near-inability to speak.

WRT the possible other problem I mention at the end of the video, I have it programmed to find the 3 seconds during the first 15 seconds after power-on over which the gyroscope has the most consistent readings, and to assume they're the zero point. However, there's nothing to force me to remember to let the thing sit still and not fuck with it for those first 15 seconds. So it's possible that after I plugged in the power, I was moving it around a lot and so it never got a good zero point and thus, even without the vibration, it was never going to be totally correct. I need to figure out something to remind me of that. Perhaps I'll make it emit short beeps for the first few seconds after power-on, at least until it gets a reading that meets a certain threshold for stability.


If you were logged in, there would be a comment submission form here.
Creating an account is easy. You literally just type in a name and a password.
I don't want your email address, so there won't be any links in any emails to click.

Return to the Summary in Ecstatic Lyrics Blog