View Single Post
Old Sep 11, 2012, 02:36 PM
miru is offline
Find More Posts by miru
Registered User
Vista, CA
Joined Feb 2008
1,416 Posts
mirumod rev 0.19

Due to time constraints (going on vacation and not having enough time to spend on this project) I am releasing rev 0.19, which has quite some improvements and additions but does NOT have a working RTH function.
  • Fixed bug in start up blink sequence (thanks Pawelsky for pointing this out).
  • RX sampling routine ignores unused signals.
  • Pilot program name changed from 'pilot.arm' to 'pilotXXX.arm'. XXX stands for the revision of the mod. The name is hardcoded into the matching version of the companion program 'at2so' so there can't be any accidental mixups by design. There is also a key exchange between the companion program and the pilot to make sure both come from the same revision of the mod.
  • Accommodating GPS units that can not store a setup for baudrate, frequency and content of reports as well as users that don't want to deal with it. 'rx2atp' attempts to setup the GPS 'automagically' with the parameters it wants. It will auto-detect the baudrate (not a choice any more), send 'PMTK' instructions to change the baudrate to 38400, the update rate to 5Hz and ask for a GGA sentence on every report and for a RMC sentence every 5th report (needed for the date). All other sentences are turned off. The sentences used for setup are:
    "PMTK251,38400" to set the baudrate,
    "PMTK314,0,5,0,1,0,0,0,0" to select data and
    "PMTK220,200" for the update rate.
  • Moved interpretation of GPS data from companion program to pilot program. At this point there is no more GPS data insertion into the Navdata stream, nobody really made use of it and it costs precious code space to do it in the companion program.
  • Pilot program writes a log file to permanent storage on an external drive or the drone's /data/video directory (drone 1 or no USB stick on drone 2). The log file format is in ASCII, aka human readable.
    Pawelsky helped me a lot and wrote a wonderful piece of software that can pick up one of these log files and convert it to something Google Earth understands! This way one can display a recap of a flight on GE with all the things that happen. I hope he finds a way how to give everybody access to this very useful tool.
  • Changed EEROM magic number, added boot counter 'bid' to EEROM data structure. 'bid' gets incremented before launch of the companion program and saved in EEROM if the companion program sends the start character. FYI, the EEROM does not get erased when you load a new sketch. The 'bid' is passed to the companion program as an argument (-l #). The companion program passes it to the pilot program. The pilot program uses the number to generate the file name for the log file. It is P%d.txt. The %d is replaced by the 'bid' modulo 20 on an external drive and 'bid' modulo 5 for storage on the drone in '/data/video'. The size of a single log file is limited to 4 Mb.
  • Redesigned data exchange between companion and pilot program to reduce the amount of data transferred to a bare minimum. There are two packets, TAG 82 from companion to pilot and TAG 81 from pilot to companion. TAG 82 is sent to the pilot every time new Navdata arrives from the firmware, TAG 81 is sent back to the companion as a response to it, it carries the GPS status and the steering instructions from the pilot program if it is engaged.
  • New feature: in LAND, if you move the throttle stick all the way down, the Arduino LED will show the GPS status:
    0 blinks - no GPS data or pilot program is not running
    1 blink - no GPS fix
    2 blinks - GPS has 2D fix
    3 blinks - GPS has 3D fix
  • New feature: the pilot program has a socket one can tap into to relay 'live' log messages as long as the drone is within WiFi range. The port is datagram port 12000 on <drone IP>, you have to send it a 'lbeg' message to start receiving log entries and 'lend' once you are done. Check a stored log for the interpretation of the messages.
  • Decided pilot is not ready for prime time -> disabled for now

Note: I am still not happy with the pilot program's navigational skills, especially on a Drone 1 which has a problem reporting changes in it's heading when certain events occur. On a Drone 2 the challenge is that the heading data is referenced to magnetic North and the GPS data is referenced to 'true' North. The solution to this will have to wait until I can spend a lot more time on it, which is hard to come by at the moment. There seem to be some new GPS units out which don't use the SirF protocol, they have a way to report the magnetic heading, which would take out a lot of extra software.
miru is offline Find More Posts by miru
Last edited by miru; Sep 12, 2012 at 02:48 PM. Reason: typo
Reply With Quote