Thread Tools
This thread is privately moderated by FredericG, who may elect to delete unwanted replies.
May 20, 2008, 01:54 PM
Registered User
FredericG's Avatar
Thread OP

Simulator to test autopilot

I am in the process of introducing the actual return-home and heading-hold in the code for the plugon-board.
I decided to make a small simulator. The simulator runs on a PC, get servo-pulse length from the OSD and generates NMEA for the OSD. The coordinates are always the same but the simulator alters the reported heading. It is currently a very basic model of the plane, but it takes into account the latency from the GPS. While the simulator runs, it generates a logfile that can be imported in excel to draw a graph.

In the OSD, I currently have a simple proportional controller. I configured the simulator to simulate drift; when the OSD is not correcting, the plane turns left with 1 degree per second. I wanted to reproduce the issue I had with the older proportional implementation: depending on the wind the autopilot steers too much or too little. And yes, when turning in the direction of the drift, there is almost overshoot, when turning in the other direction, it takes ages.
The heading-hold shows a ripple. In the coming days I will add an integrator and see how this improves things...

Addition May 23th:
I added the integrator and it looks very good now, in the simulator at least...
The deflection of the rudder depends of the direction of the turn because the drift (or wind) facilitates of inhibits the turn.
Let's see if it behaves equally well in a real situation...
Last edited by FredericG; May 23, 2008 at 01:24 PM.
Sign up now
to remove ads between posts

Quick Reply
Thread Tools