I've modified Phillip Anthony Smith's Mavlink Ardustation to support an inexpensive tilt/pan antenna platform. RAM is very tight in the software so this is not a laptop/ground station replacement and the original software was oriented towards APM. However, I've been flying many flights with Arducopter 2.0.x and this antenna and have gotten pretty good video performance with much less multipath interference. I still use a second Xbee on a notebook with the Mission Planner and that seems to work pretty well with the Ardustation. This link gives some more details, a demo video of the software with some explanation of the added screens, and the software itself for others to play with. The software is a little rough since it was developed quickly before the 4th of July weekend, but it is fun to watch the antenna follow the quad and I wanted to give a little back to the Arducopter community.
You need to be a member of diydrones to add comments!
Comments
Pan.attach(9,1414,1585);
is all you need to get it to surrount the 1500 usec
The Ardustation doesn't have the I2C pins hooked up, so wires would have to be soldered to pins 4 and 5 of the ATMEGA328 along with a pull up resistor to even get the I2C GPS and magentometer hooked up. The wire library could be used to talk to the chips, but the wire library has blocking io so the software would be stuck waiting for the I2C responses to be received. The servospeed library in the current code uses interrupts and the best would be to implement completion interrupts for the I2C communication so that the completion status wouldn't have to be polled.This would require some low level library work to integtrate the interrupts plus all the driver software to read the GPS and magnetometer values, parse them, and then display them as appropriate somewhere. You would also need a magnetometer calibration routine (like in the Arducopter code) to handle any local metallic devices to give a reasonably accurate compass heading - with local magnetic corrections applied.
Unfortunately this isn't trivial to do and would require soldering external wires plus a resistor for anyone using the software. Also, it isn't clear to me if there is enough RAM in the current configuration to do it.
At this point, I would have to purchase the hardware, modify my Ardustation and then write the code (plus new user interface elements/design), debug the I2C communication and interrupt stuff to get it working.
Since this requires hardware modification to even work with the Ardustation, I don't think it would be the best effort - instead this would be a natural addition to the Ardustation Mega - which I may work on in the future, but currently don't have much time. The other thing is that the Arudstation is really annoying to program/debug on since I have to pull the XBEE every time new code has to be loaded and I've already had to resolder the Xbee connector twice in the last 2 years from wearing them out with all the unplugging/plugging in.
A much better solution is the Ardustation Mega board which has the I2C port easily available. I would wait for this feature to be implemented on it. The display is much better and you could do more with it.
Unfortunately I have many demands on my time (which I actually earn income from) and currently have been reducing my open source efforts as far as the Ardustation is concerned. There may well be someone who has the hardware and could do the modifications.
This article would be very useful to do the modifications in any case:
http://playground.arduino.cc/Main/WireLibraryDetailedReference
this is the line for blocking the 3 turns at start up?
#define SERVO_MAX 2600 //Range of servos pitch and roll
#define SERVO_MIN 400
How to transform this in defining lower usecs just for the pan?
About the I2C port do you think that it can be added this I2C GPS
http://www.flytron.com/sensors/180-i2c-gps-for-multiwii-and-others....
Is ok this magnetometer ?
http://www.flytron.com/sensors/142-hmc5883l-triple-axis-magnetomete...
Can you help with some lines of integrating them? I am almost zero knowledge compiling the codes.
Maybe there are some others like me that will find this very useful.
Thank you!
Best regards
Adrian
Thanks Heino!
Steve,
Not yet - I've gotten side tracked by a event that my rocketry club is holding in St. Louis and I'm one of the organizers for Saturday (Moon landing anniversary). I'll get back to it on Sunday.
Heino, yes ArduStation Mega supports compass boards as it's I2C ports are fully exposed. Keyboard already used I2C to communicate with ASM. You also have several UART ports and software serial ports that you can use on ASM to connect for example GPS, FrSky telemetries and so on.
Heino did you get a chance to look at the code for the antenna test and other small problems? Mine is working pretty good now but I think it's accuracy might be off on pitch.
You must set the range of the pan servo so it covers the power up pulse setting. The initial pulse position happens in the low level init in the library and outputs around 1500 usecs. Your range needs to surround 1500 to avoid the problem. You only have 1 serial port so you can have a GPS
or telemetry but not both. There is also no hardware I2C which would be required for a magnetometer. The Ardustation Mega would be able to support a compass and magnetometer.
Finally the Ardustation goes in the good direction. If someone can show how to add a magnetometer and/or GPS to this old board it would be greatly appreciated.
Just played with the settings for pan servo:
http://www.hobbyking.com/hobbyking/store/__20853__SW5513_4MA_Sailwi...
Pan.attach(9,1242,1413);
My only problem is that at start up the servo goes all 2/3 turns and only when I do antenna test goes to the middle position(can tear apart my a/v wires - I only can afford 1 360 turn)
Thank you for your help in advance!
Heino thanks for the help!! Looking fwd to the new version and I'm glad I could at least be a little help to debug it :) If you can get the antenna test working then takes all the doubt about whether the range is set correctly.
I hooked up my turnigy servo tester to see what pulse value represented the 0-90° and this what I got. 1000us is 0° angle horizontal and 1892us is 90° vertical. The servo has about a 100° range if I go from 1000us to 2000us. With it set to 1000us I moved the servo arm so pitch was horizontal.
Then I changed the setting to: Tilt.attach(10,650,2400);//Tilt Elevator
I ignored the antenna test since it doesn't seem to work right. I then made sure the quad was reporting an altitude lower than the tracker. Tracker is at 256 meters and copter was at 240 meters because of a weak GPS signal. I just adjusted the 2nd parameter in Tilt.attach until it reached horizontal. I finally arrived at 650 and now it doesn't go below horizontal.
How can I make sure the 2400 figure is right? Would be great if the antenna test worked so it could be calibrated easily.