Antenna tracker for the MultiWii platform using MW V2.1 protocol.

Just spent a couple of hours getting my head around the MultiWii V2.1 serial protocol.  This involved looking at EOSBandi's MW-WinGUI Visual Studio c# code and adapting the essential bits I need to a simple test VB 2010 app.  The app sends the commands to get the GPS bearing and distance to home as well as the Baro altitude.  The BT module connected to the Pairs MultiWii board sends back the info I requested and shows these values in textboxes on a basic form.

That's part one out of the way.

Next phase will be adapting that code, now that I understand how it is done, to Arduino code.

The code will output PWM on two digital ports to drive two servo's to position the patch antenna.  Rather than use the short range BT module I will set the MultiWii code to use 57600 rather than 115200 and hook up my XBee Pro module.  The other XBee will be connected to the Arduino tracker.  So the tracking Arduino will be asking the Hexacopter where it is and with any luck the Hexacopter will say "here I am".

If anyone is a VB programmer I can post the important bits here if they want to roll their own PC based MultiWii ground station.  Very easy to code once you know the binary protocol.

If I get the Arduino code happening in the next few days I'll post it here.

Also, if anyone is aware of an existing tracker for the MultiWii controller which uses the V2.1 protocol (not via OSD's fitted with GPS's and telemetry sent via audio) please let me know about it.  

Views: 7203

Comment by Bradley J Carr on November 29, 2012 at 8:43am

Making antennas trackers would be so awesome.  If you could do the same on the aircraft that will always point to home and the home antenna would follow the aircraft. That would be pretty sweet.

Comment by Timo on November 29, 2012 at 1:14pm

Your antenna tracker looks amazing. What components are you using?

Comment by John Grouse on November 29, 2012 at 2:53pm

Oh dear, I knew this would happen.  I type up a blog for a work in progress so no photo's to show as yet, submit it, get an email from Chris A. saying he cannot approve it without a photo, so I find a generic antenna tracker photo and use that.  Now people think that is the tracker.  

"Photo for illustration purposes only"

Having said that, I quite like the Eagle Eyes tracker kit depicted in that photo so I may very well end up using that as the basis of the tracker - just not using their technology.

As for having an on board patch antenna always pointing to the base station, sounds great as long as the plane is not performing any wild moves (inverted etc.).  Also the heading mechanism would need to be able to have continuous rotation.  If it had to stop and wind back around when it reached its limits then you would have a moment of blackout.  It really needs to be a dual antenna setup - one directional and one like a cloverleaf design.  Personally I would keep it simple and just go with a cloverleaf antenna on the plane and a patch antenna on the tracking ground station.  The extra tracking mechanism on the plane is going to be tricky.  Guess that's why real military planes don't use them - they have a satellite network to relay data back to base. 

Also keep in mind that the XBee Pro 900 is not the cheapest option out there for data transmission.  Just so happens that I already have them.  I'm also keeping one eye on OpenLRS at the moment as an alternative.

Comment by John Grouse on November 29, 2012 at 3:10pm

Also realized that the on board OSD is already constantly sending queries to the MultiWii code via the TX port so I will need to adapt this to not make any queries from the ground, just listen to the replies relayed through the OSD board on the serial TX port.  You just cannot have two devices making queries to the MultiWii board at the same time.  Fortunately it does query for GPS bearing and distance to home as well as ALT.  Just those three packets will be needed to work out the maths for the tracker to have a bearing and vertical angle.  The hexacopter will need to be close to the tracker when it is first armed so that the home position closely reflects the antenna position.  The other approach is just to use the LAT/LNG and ALT info from the MultiWii.  That way I can have a button on the tracker's Arduino to record where the hexacopter is when sitting next to the tracker, use that as the home location, and then any coordinates sent from that point can be used for bearing and vertical angle.  Another idea I had was to take the OSD off the hexacopter and hook it into the ground video feed and the serial coms on the XBee.  That way, if I loose video I can still see all the OSD info.  So I could have a black box with the OSD board, Arduino tracker and XBee module inside it, then have input/output RCA jacks, battery connector, home pos button, LED confirmation light and two servo connectors.  Velcro that to the side of the Antenna tracker.

Comment by Copter Richie on November 30, 2012 at 5:54am

Using a Mega 2560 and the latest development code, it is possible to have multiply serial queries accessing the protocol now. Not sure about the overhead or increase cycle time however.

Comment by John Grouse on November 30, 2012 at 12:40pm
It's really not an issue in my case as the Rushduino OSD is already making all the queries I need and it has a pass through serial port. So I just hook the XBee up to that and listen to the same serial stream the MultiWii is feeding the OSD.
Comment by Copter Richie on November 30, 2012 at 1:00pm

Awesome and Rushduino is an excellent OSD in my opinion. I myself am working with Wifi-Serial but work is progressing slowly.

Comment by John Grouse on December 1, 2012 at 3:18am

Fun day of trying to write code to interpret the MSP stream coming into the serial port of my Arduino Nano.  In the end I just grabbed the following files from the Rushduino_OSD_MCE_V9 Arduino project folder -


Once referenced in my project I just had to put the SerialMSPreceive() call in the loop and that made available the following vars -





I just commented out all the other parameters I didn't need.  This was the better approach as it is just mimicking what the OSD is expecting to read.

Big thanks to Jean-Gabriel Maurice for the work he put into the Rushduino OSD code.  Not sure if there is any license involved in using his code, but I have no desire to make any money from this little project.  I just have a requirement which needs a solution. 

Using my I2C LCD03 I was able to show the values being read in.

I then took the next step of setting the two xBee's to 115200 and connected them between the FTDI pins on the Rushduino OSD and the slave module, and the master module was then hooked into the Nano.

Before too long I had the data appearing remotely on the screen of the LCD refreshing at approx 1Hz.

So tomorrow I'll throw in the maths to the code and feed this to a couple of PWM outputs.

With any luck I'll have a patch antenna following me as I walk around the yard with the hexacopter.

Wifi-Serial sounds interesting.  Wonder what the range would be with WiFi?

Comment by Copter Richie on December 1, 2012 at 5:50am

This is the modular I purchased but have not tested yet.

Serial TTL RS232 to 802.11 b/g/n Converter Embedded WiFi Module CE FCC

Comment by John Grouse on December 2, 2012 at 4:10am

Shame the ad doesn't indicate the power or range of the unit.  I like it because it opens up the capability of writing an iOS app to get serial data via WiFi.  You could write a base station app for MultiWii on the iPad.

I spent the day designing the hardware of the tracker.  

Had a load of old gears of various sizes from an old photocopier I pulled apart a year ago.  Found a couple with a ratio of 1:2.25 which allows a full 360 with just 160 of servo travel.  The tracker will be able to go 180 one way and then swing back 180 the other way.  The small 5.8GHz patch antenna allows me to keep the size down.  I'll have the XBee Pro 900MHz whip antenna sticking out one side and the video Rx velcroed to the other side.  The Arduino will sit inside between the two lower boards.  I'll use a two way switch to set the offset of rotation once it starts getting valid GPS data.  Time to get the trusty Dremel out again.


You need to be a member of DIY Drones to add comments!

Join DIY Drones

DIY Drones Monthly


Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Pylon Race, is here

© 2015   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service