Simulation, taken to the next level.

Hi guys,

I finally decided to join the community with my first post, enjoy.

My work started with great inspiration of the 6.th round of the T3 contest, where the task is to simulate a flight, writing DIY Drones. While the description of the open loop, nor the closed loop simulation did not include any real sensory inputs, I decided to setup a small test scenario on my desktop. I was not happy about how the simulation of the GPS data was performed either. From the beginning my plan has been to replace the thermopiles with a accelerometer, to reduce the price but also for simplicity. Notice that this is not the IMU board, merely an accelerometer which return the same information as the thermopiles.

The objective of my setup is to fool the autopilot into thinking it is flying for real, and not just using a simulation on the Ardupilot. For this I need to create a setup which tilts the accelerometer in a realistic manner. Create a GPS simulator for the Ardupilot, to fool it into believing that it receives real GPS data.

First on the hardware. The test setup consist of:

- An Ardupilot board
- An accelerometer
- An Arduino Deicimila
- And a servo

The accelerometer is placed on the servo. The servo is controlled by the Deicimila. The Deicimilia board receives input from the Ardupilot board, to output to the servo. The Ardupilot read the roll and pitch from the accelerometer (which simulates a roll with thermopiles).


Second I need to simulate where the plane is going by creating the appropriate GPS data. This took some time, but I succeeded by reversing the code from the Ardupilot, and reading some documentation of the Sirf Binary Protocol. The result is a small application written in Java, which reads of the roll and tilt, and produces a binary string containing latitude, longitude, altitude etc., which is sent back to the Ardupilot board. And it actually works. By running the real autopilot code the board turns on the blue LED, to indicate that it receives good GPS data.

The result is a (from my point of view) test of the real autopilot software, and I discovered some bugs in the code, which I will describe some times later. I will also create a detailed description of how to interpret the binary data of the GPS modules, if anybody is interested.

Please comment, and I will elaborate on any missing parts.
E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Niklas,

    I am looking for GPS simulator in order to simulate the pixhawk is moving to test the camera trigger distance settings, my system always miss some photos during a mission. Did you post the GPS simulator you did?

    Thanks

    Regards.

  • DOF means number of independent articulations the sim can move simultaneously, NOT the number of axes that describe the motion.
  • John,
    Your statement about 26 DOF is ridiculous, no time for detail but I can assure you a "full scale" flight simulator of the highest FAA obtainable "fideiity" rating are 6DOF. Throw in the something like the Vertical Motion simulator @NASA Ames and that's about as good as it gets.
  • Not really! That's why pilots get vertigo when trying to fly blind without reference to instruments. Using only their inner ear accelerometers can't provide the true situational awareness. A full scale B737-300 flight simulator has 26 degrees of freedom with hydraulic actuators on each to try to simulate all the G forces of actual flight while sitting on the ground. It's still not the same as real flying after spending millions, but at least it doesn't leave a carbon footprint while just training. Even Playstation can't do it. Keep trying!
  • Admin
    interesting. yes, binary data interpretation from GPS is a common interest. pls continue. thanks
This reply was deleted.