Ardustation 2 - 2.0.20 Adds Servo Setup, Compatibility with 3DR OSD, Optional Baro Altitude For Pointing

This release modifies the Antenna Test screen to allow better servo setup for other antenna platforms/servos. Schedules an additional Mavlink message to support the display of some parameters on the 3DR OSD. Adds servo reverse defines. Adds an option to use VFR Hud altitude (derived from baro alt) instead of GPS altitude for antenna pointing. 

I've also added a pdf which describes how to add configure Ardustation 2 for other antenna mounts/servos.

Available here:

YouTube video demonstrating the antenna test screen:

Please be sure to download the zip file to a empty folder and to  only use the library folder contained in the distribution. Do not merge this library folder with either the ACM or APM library folders. This software should be compiled with Arduino 1.0.3 or Arduino 1.0.1.  Do not use the earlier versions as indicated in the Ardustation wiki. 

Please let me know if you have any issues with this release.

Heino R. Pull

Views: 4079


Reply to This

Replies to This Discussion

Sounds like a linearity problem with the servo. Using a small range of it's full rotation range may lead to linearity problems. I would put a hand compass on your antenna when you do the antenna test and see what it thinks the heading is for each of the test headings in the antenna test.  I'll bet you'll see that it isn't very accurate.  I saw this a little with the servos I use and I'm using the full range.  Try the other range/bearing algorithm also - I believe you hit the center key on the second flight data screen to change it.

I changed the algorithm and did a test with each setting but didn't see a difference. The way I'm testing it is using the antenna test. I start at 180° and note the position. Then I go to 270° and make sure it's pointing 90° from original point and it is. I also try 90° and make sure it's correct. With algorithm 1 or 0 I get basically the same result. Why would it be ok in this test visually but not correct in flight? I thought that was the reason for the antenna test so we can see if 90° movement really translates to a 90° movement. When I was flying today I was moving the copter left to right which should have caused about a 90° movement on the tracker but it was moving closer to 180° so it's not just a little off.

I flew the code on Saturday for 9 flights for ranges out to 1500 feet in all compass directions and things looked good with my setup. However, I'm using the default values. I'm trying to think how you could see a difference between the antenna test and during flight.

The algorithms are not used during the antenna test. They are used to convert lat/lons to range/bearing during flight which then send a value of 0 to 180 degrees to the pan servo. The antenna test computes the values of 0 to 180 degrees for the servo motion and displays this values time 2.0. When in flight, the bearing is a value from 0 to 360 degrees and is divided by 2 and sent to the servo using the same endpoint values developed during the antenna test. 

I'll try a walkaround test using your endpoint values to see if there is a difference from the antenna test determined pointing values.  What was your pan endpoints for your setup?   I'll walk around my antenna using my quad and see if the antenna points the same way as in the antenna test.

Thanks Heino! My endpoints are 1859 μsec for Pan-->0 and 2090 μsec for Pan-->360.

Ok- I'll try 1859-2090 and see what happens.

I gave it a try tonight. I used the range 1859 - 2090 (which is a very small rotation on my servo) and moved my quad around my antenna. I could not find any difference between the telemetry sent antenna pan values vs the antenna test values. I found a very useful side effect of the antenna test - if you have flight datas enabled, on each GPS update, it will command the antenna to rotate to the telemetry computed heading instead of the antenna test pan value. So you will see the antenna move back and forth between what the antenna test pan heading is versus what is computed from telemetry.  

I used the "DIR" value from the 2nd flight data screen which is the computed heading and set the antenna test to a value close to the DIR value and it did not move in pan between the GPS updates and the antenna test set value on the antenna test screen. I repeated this test for 0 degrees, 110 degrees, 250 and near 360 moving the quad to the appropriate locations and the antenna should no sign of a difference between the antenna test value and the computed heading.   

Obviously a difference is that I'm not flying and I was at the same altitude as I moved around the antenna so there is a difference there. 

At this point I can't see a code issue that would cause heading differences, but I suggest you try the same test moving your multirotor around the antenna and see if you can see the differences in pan values between the antenna test position and the computed position and note the "DIR" value for where these differences occur.  If you let me know what the DIR values are for differences, I can think about it some more. 

Thanks! I will try it today or tomorrow and let you know. I found this to try and make it a 360±° servo but I prefer to make it work without it. I don't think it's a linearity problem because when I do the antenna test, 90° corresponds to a 90° movement. I don't need extreme accuracy. I think it's another problem and will do the test you suggest to see whats up.

Heino, I've been doing some testing today and am really not sure what is going on. The antenna test works perfect. I get a full turn from 0-360 using 1859 and 2090. I'm setting my home location and altitude using this part in the code:

void RestoreHomePosition()
Latitude_Home=-22.hidden; //steve
Longitud_Home=-43.hidden; //steve
Altitude_Home=256; //steve
void clearline()
lcd_print_P(PSTR(" "));
void SetAntennaPosition()

It always worked well since I never move my tracker but today I noticed it wasn't pitching up at all, even if I went up 30 meters. So I tried setting the home location using the copter and the button on the tracker and the pitch started working but the pan was still over shooting.

Is it possible there is a problem in setting the home location like I'm doing? It always worked well with my other rmrc tracker. I get my exact GPS position using google earth.

About the panning this is what I'm doing to test. I don't have a large enough flat area to do it by walking around so I just fly out about 50 meters, engage loiter and then pick up the tracker and position it towards the copter. Then I fly to the left and right to see how the tracker tracks the 180°, keeping about 40 meters out from the tracker. With the rmrc tracker this method never gave me a problem. Also I noticed that the further I fly out, the more it over shoots. For example I can be a bit to the left where it's position is just a little overshot and as I fly straight out, it starts panning to the left the more I fly out instead of continued to point at it. I didn't try to go too far out but that is what I saw.

What I can't understand is how the antenna test can be perfect but the tracker really over shoots by a lot. In the antenna test I'm just trying to set the pan limits so it moves exactly 360° right? On the antenna test it tracks very good from 0-360 using 1859 and 2090. It seems very linear to me visually. I know you said the algorithm is not used in the antenna test. Does that mean there could be a problem in the algorithm relating to using a 360° servo?

Using vfr hud altitude for the range/bearing computation is slightly different from using GPS altitude. I'm not sure how stable the APM computed altitude is based on pressure since the barometric pressure changes from one day to another. It should be fairly close, but apparently it isn't in your location. I set my home position from the quad when I start on any given day and so far that has worked ok for me. 

The range bearing algorithm returns heading 0 to 360 and doesn't care about the servo. The servo library call wants 0 to 180 degrees, so the returned bearing is divided by 2 and sent to the the library.  None of this cares about the servo as long as the servo endpoint values (0 to 180 degrees) are calibrated correctly.  After my test last night I don't see how there is a difference between the antenna test and the received range values.  There is something up with your servo and the calibration.  I'm not sure what it is. I was testing my antenna indoors last night so that is how I check the values by moving my quad to various parts of my house.  I check the DIR value being computed and compare to the same value dialed into the antenna test.  This needs to be done some how in your setup in increments of a maximum of 30 degrees to check how the servo rotates for the computed DIR values. I don't think checking the 0, 90, 180, 270 values is enough to check how well your servo works. 

I have one additional thought - the range sent to the servo is pretty small for the 360 degree rotation. The servospeed library uses timers to figure out the pwm values and I wonder if the resolution isn't good enough for the servo you're using. At a minium there are 239 values between your endpoints and that is a resolution of 360/239 = 1.5 degrees step size. In the servo library there is some mention of a min resolution of 4 usec so that would be a step size of 6 degrees.  I thought this was only in the max/min servo rotation calculation, but it might also apply to the absolute values sent to the servo. One possibility to get better resolution would be to go back to the original servo library without the speed slewing feature.  This should be a fairly easy search/replace recompile to try. I'm also wondering if in there is enough torque with your servo setup to get accurate positioning.  Maybe you do need gearing - which would get your better resolution also. 

I'm not sure this is the issue, but using such a small range is the crux of the problem I think.  I can generate a version of the software with the old library for you to try.

If you can generate this version that would be great! I will try it tomorrow. I will also see about the gear box. What gear ratio do you think would be best on the gear box? 3:1? It will definitely help with the torque. I noticed I could hand move the pan on the tracker and it resisted very little. It seems it has very little torque but when it's panning it doesn't seem to have a problem. The pan is on lazy susan type bearings. The HS-785B has only 183 oz/inch so with the 3:1 it would be triple that. The tracker is really not heavy and only carrying a 5.8GHz and 900MHz antenna plus receiver and ardutracker.

Reply to Discussion



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

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service