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.