3D Robotics

T3--Round 6: The Simulation Round!

For the last T3 round before the weather improves (in the Northern Hemisphere), we're going to do something indoors! It's a simulation round, which I previewed here.


I'll repeat the basics:


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 the contest structure:


Two sets of winners:


Both must write "DIY" (in cursive) over a place of their choosing. Example above from brakar, who, like Jesse & Jared, have jumped the gun a bit and already submitted successful entries for this round.


--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.


A special top prize will go to the person who best documents how they went about it and creates a useful tutorial for others to use afterward (judge: Gary Mortimer). The prize for that will be the notorious Raven UAV clone (unless the winner requests something else, in which case I may grant mercy and come up with something of equal or greater value).


Also, as suggested by Brian Wolfe, anyone who completes either of these rounds will get points added to their grand total: One point for open loop and four points for closed loop. Here are the current cumulative rankings after five T3 rounds:


Brian Wolfe 31
Vassilis 24
Brakar 23
Mark Griffin 18
Krzysztof Bosak 17
Andrus Kangro 12
Jesse Jared 8
IOS 6
Bill Premerlani 6
MarcS 6
Joe 6
Steve Joyce 5
Steve Westerfield 3
Chris Anderson 3
Icebear 1


Entries must include a video and KML track and a description of your simulation setup (flight sim, autopilot, other hardware). Submit your entry in the comments below by 12:00 midnight PST on Sunday, May 2nd.


E-mail me when people leave their comments –

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

Join diydrones

Comments

  • T3
    Alexandr,
    Nice setup. I'm doing something similar but am fighting the latency issue. I'm having to lower my gains by a factor of 5 to get a stable but very slugish sim running. It's taking more time to tune the loop for Flightgear than it did for the real system. Doesn't make for a usefull simulation when you have to switch gains other than to visualize the path and confirm it's roughly what you want.

    Can you describe your synchronization job that FGWrapper is doing? I've told FG to sample the input at a higher rate than I'm sending which helped some, but still having issues. Are you able to run the same gain in your aircraft that you do in the sim or are you backing off when running the simulation?

    Curt and others, any input you may have is greatly appreciated. I'm wondering if I can get the performance back up by some trickery such as running the sim at 5x or something. More experimenting tonight.
    Thanks,
    Brian
  • It is not an open source project. On autopilot board there are 5 serial ports (for sensors, modem and servos), FRAM (config etc), SD card slot (log). Used software: FreeRTOS, Chan FatFS (for SD).

    FG really helps much in debuging/tuning!
  • Developer
    Alexandr, that is cool. A nice setup, and a lovely video. Thanks for the post.

    Can you tell us more about the autopilot. I've found a development board with the same micro-controller.

    But what software are you using ? Is it open source, ?
  • Hi all!

    This is my first post here.
    I'm not a DIY guy, just could not refrain from participation in the contest. :)

    I use FlightGear 1.9.1 with custom model of our real drone (~5 m wingspan, ~90 kg weight). Visual model is ported from SolidWorks, flight model is YaSim based. Autopilot is stm32f103 based with external IMU/airdata. For simulation I use special autopilot software build that uses one of serial ports for connection to PC. Also I've got port of autopilot code to run on my desktop.

    I use UDP to get attitude/position/etc data from FlightGear and put servo output to FlightGear. Simple application called "fgwrapper" receives UDP packets from FG, converts text data to binary format and sends it via serial port to autopilot. Then fgwrapper receives response from autopilot, converts binary data to text and sends it via UDP to FG. Also fgwrapper do useful synchronization job, because FG1.9.1 reads UDP packets by specified time intervals (not by reception of UDP packets). This can lead to significant delay in control.

    Here is the result:


    video

    diy_track.kml

    ps: sorry for my english :)
  • 3D Robotics
    @Recmaster. That's an open loop simulation. There is no back channel from the autopilot servo output back to the simulator.
  • For the record, I will not claim a gift certificat for being early. Just wanted to make the post before going up in the mountains.
  • Hello all,
    is it not a comlete solution for closed loop test?
    http://diydrones.com/profiles/blogs/ardupilot-successful-flight
    May be it will be good think to rate all solutions existing at this site at one place, finished the best and
    just use it ??
This reply was deleted.