Board index FlightGear Development Aircraft Autopilot and route manager

External HW autopilot

Designing a stable autopilot is one of the hardest things. Need help?

External HW autopilot

Postby kamikaze » Wed Mar 08, 2017 3:08 pm

Hi there. I'm working on my own "hardware" autopilot that is being implemented with MicroPython and running on PyBoard. I'm using FlightGear as a simulator to develop my autopilot and then use on a real RC Jet.
VIDEO 1
VIDEO 2

UAV CODE
FGFS serial port <-> telnet adapter

I have a question about FGFS autopilot. How does it maintain the constant speed so good? I'm playing with my own PID controller and can't get same results. Any algorithms, code?
Also I have a question about engine control via telnet. Is it possible to control both engine throttle at once in a single command? Otherwise you can notice that engines are not synced.
kamikaze
 
Posts: 7
Joined: Wed Mar 08, 2017 2:44 pm

Re: External HW autopilot

Postby curt » Wed Mar 08, 2017 3:17 pm

From your video It seems like your throttle position is jumping in large step sizes and not moving smoothly.
Aerospace Engineering and Mechanics
University of Minnesota
curt
Administrator
 
Posts: 1174
Joined: Thu Jan 01, 1970 12:00 am
Location: Minneapolis, MN

Re: External HW autopilot

Postby kamikaze » Wed Mar 08, 2017 3:36 pm

curt wrote in Wed Mar 08, 2017 3:17 pm:From your video It seems like your throttle position is jumping in large step sizes and not moving smoothly.


yeah. I've watched tons of PID explanations but I don't get something. I'm calculating error (in knots, let's say 100) then multiplying with Kp doing same stuff with I and D. Resulting P+I+D is far away from throttle value range which is [0.0 .. 1.0]
I don't get how to map PID value to engine throttle so it becomes smooth :roll:
kamikaze
 
Posts: 7
Joined: Wed Mar 08, 2017 2:44 pm

Re: External HW autopilot

Postby curt » Wed Mar 08, 2017 4:07 pm

I would start with zero I and zero D, only adjust P first. You may need to make P *much* smaller to get smooth motion.

In my own UAV's I use throttle to control altitude and pitch to control airspeed. The APM and PX4 systems use something called TECS which combines kinetic energy (speed) with potential energy (altitude) and uses throttle to manage total energy and pitch to keep the balance between KE and PE. Tuning can be difficult. Sometimes it helps to plot or visualize the result. I created a post process augmented reality overlay to help see what my UAV autopilot is doing: https://www.youtube.com/watch?v=EMwsx4gyKIw (and it still needs more tuning, but I think I am seeing that my pitch gains are way too low.)
Aerospace Engineering and Mechanics
University of Minnesota
curt
Administrator
 
Posts: 1174
Joined: Thu Jan 01, 1970 12:00 am
Location: Minneapolis, MN


Return to Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 1 guest