3D Robotics

Proposed next T3 round: simulations

Gary Mortimer and I are leaning towards a simulation round for the next T3 contest, but I need some feedback about what would work best.

There are two kinds of simulations: "open loop" and "closed loop".

Open loop means that you connect the output of the simulator to the input of the autopilot. The simulation drives the autopilot with synthetic GPS coordinates and sometimes synthetic attitude data, essentially replacing the autopilot's sensors. This basically fools the autopilot into thinking that it is flying, and you can watch how it responds. This is typically done by having the simulator output data via the serial port and feed that into the autopilot.

Closed loop means that you also connect the output of the autopilot to the input of the simulator, so that the autopilot is "flying" the aircraft on screen. This usually requires a relatively complicated bit of hardware that converts the PWM servo output of the autopilot into what amount to joystick commands via USB or serial that steer the plane in the simulator. It can also be done entirely in software on the host PC, as in the case of Matlab simulations being driven by a flight simulator.

Here are some blog posts that show examples:

--Curt Olson's FlightGear demo

--Faisal Shah closes the loop, Part 1

--Faisal Shah closes the loop, Part 2

Here's a proposed contest structure:

Two sets of winners:

Both must write "DIY" (in cursive) over a place of their choosing.

--Group One: Open loop (video showing you mirroring the airplanes control surfaces with the arrow keys): First six to complete this win a $25 gift certificate to the DIY Drones store.

--Group Two: Closed loop (aircraft controls the flight simulator): First three to complete this win a $50 gift certificate.

What do you think? Is this doable?

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • Ron Jensen writes (on the flightgear-devel mailing list):

    There is a (very) rough cut of an EasyStar on gitorious:

    It can be had as a tarball from here:

    The directory must be renamed "EasyStar"

    This plane must also be started "in the air" as the
    current engine doesn't have enough power (70 watts) to overcome the
    ground drag.

    It still needs its aerodynamic coefficients tuned, too. It seems rather
  • T3
    I should also note that FlightGear seems to run relatively smooth if I'm just flying around using the mouse and keyboard. The slugishness seems to be associated with the serial coms.

  • I'm running on a 2 1/2 year old computer here. The important thing is to have decent 3d graphics hardware. I added an nvidia graphics card to my system ... the built in intel graphics chip definitely doesn't cut it. FlightGear is graphics bound, so chances are it's not your processor that is the bottle neck, but your graphics hardware or video drivers.
  • T3
    I've been working on getting PicPilot going with FlightGear. It's been a mixed bag. I finally have data going both ways via serial ports (actually using USB to serial interfaces) but spent a considerable amount of time trying to get bidirectional data going on 1 com port only to find the bidirectional feature doesn't work in FlightGear when using the serial interface (seems to work fine with file and socket transfers).
    I finally ended up with input data coming in on 1 port via the RF link and output data to PicPilot via another port using the USB interface on the PicPilot. Now the issue seems to be I can only use extremely slow update rates (on the order of 10Hz or less) or FlightGear starts throwing errors on the log screen and the plane spirals to the ground. I'm shooting for 50Hz both ways as that's what the internal loops run at.

    It was late last night when I got to that point, so I may have a bone head bug in there somewhere, but any help from the local experts would be appreciated. I'll hit some more tonight.

    I'm running a quad core with relatively new graphics card (yes, I'm a gamer) so I don't think that's the issue.

  • Moderator
    Flightgear is fab but I'm with you Ryan it always seems to need the next computer I hope to buy.
  • Since the round appears to be open, here is another simulation running in the autopilot (closed loop). This time in FlexiPilot. This is quite easily performed, so I do this as part of preparation before every flight. I am not very good with video-editing, so the explanation goes here instead of as comments in the video itself:
    - The commands to the autopilot are initially fed to the ap through HyperTerminal - which is then closed
    - UAVStation is started to show the progress of the simulatinon - then closed
    - HyperTerminal is started again; to stop sim in autopilot - then closed
    - A batch-file is started to download log from ap
    - A new batch-file is started to decode the log, (generate kml-files etc)
    - One of the KML-file is opened in GoogleEarth


  • T3
    The backwards flying helicopter helps too. But yea, give the gift certificates to the DIYers.
  • 3D Robotics
    Jesse & Jared: Well done! (I guess you're our first winner, and I haven't even officially opened the contest yet!) You're luck to have a Piccolo system, which does indeed make simulations easy. It might be more difficult for others with less expensive DIY gear. We'll see....
  • FlightGear requires 3d accelerated video hardware. If you get really bad frame rates, you might take a look to see if your video chipset manufacturer offers newer drivers you can install. If you just have a stock windows install, you might be running with generic vga drivers, or at least with something that doesn't provide good opengl support. If X-Plane runs well on your hardware then in most cases FlightGear will also run very well.
  • T3
    X-plane is another one. It has an API.
This reply was deleted.