Developer

figuring out the Antenna Tracker

3691139590?profile=originalNot many people know but we have an piece of open source software for controlling an Antenna Tracker.  It's been built by Tridge (Arduplane lead developer) for use in the outback challenge.

Sadly we have no documentation and, as far as I know, nobody except Tridge has used it.  Still given Tridge's track record on building great software I suspect it works well and if it doesn't, I'm sure we can fix it.  So to not let this piece of code go to waste, I'd like some help from people who are interested to give it a try and help me figure out how it works.

Here's the little that I know:

  • It runs on any of our supported board (APM1, APM2, PX4, Pixhawk, Flymaple and perhaps VRBrain)
  • For APM1/APM2 users building the code is as easy as opening our hacked ArduinoIDE and selecting File > SketchBook > Tools > AntennaTracker and then building in the normal way.  For PX4/Pixhawk, our autobuilder doesn't automatically build a binary but I can provide one if people are interested.
  • It can control a Pan and Tilt gimbal like this or this found on servocity.com.
  • It may or may not require a GPS
  • It must somehow receive vehicle position updates from the ground station which has the telemetry radio that is connected to the vehicle. Maybe through a USB cable.  Tridge probably uses the python ground station, MAVProxy, to passthrough the vehicle position data to the AT but perhaps we can get MichaelO to build out a similar feature in Mission Planner.
  • I imagine this antenna tracker could also be used to keep a camera focused on the vehicle which might be good for easing the burden on creating videos of our vehicles.

So if you want to give it a try please do and stick any findings, questions or issues below. Alternatively Issues can go into the issues list.

I'll start sticking things into the wiki as they become clear.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

        • So basically the official firmware stays at 0 degrees all the time and my firmware stays at 45 degrees. Are there any other differences?

          My firmware is forked from official repository, so any problems with official release will affect my firmware unless fixed in my version. 0 degrees vs 45 degrees difference is caused by special initialization procedures in my firmware but it is only a side-effect, not a cause.

          My guess is that some recent changes to MAVLink make the tracker unable to read BARO messages from remote target. This is the only possible explanation, since the algorithm is quite simple:

          1. Set PITCH to 45 degrees (without moving yaw yet)

          2. When 45 degrees is reached wait for "STARTUP_DELAY" (usually set to 5 seconds)

          3. After "STARTUP_DELAY" has passed change mode from INITIALIZING to AUTO and start tracking

          After step 3 is completed YAW will move to certain point (I think it is either 0 degrees or some random value from memory, I'm not sure since it is not relevant) and the tracker will remain in this state (it will drift a little at the begining) until it receives MAVLink data.

          What I'm trying to say, is that controller for PITCH servo (YAW too) uses the last angle that was sent to it - in this case PITCH will stay at 45 degrees until it gets a new value calculated from baro and distance. If your YAW is tracking the target correctly it means, that PITCH controller is not being fed with new, updated angle.

          You can verify it via MP - enable tuning screen and display "nav_pitch" - it will show you the current value that PITCH is asked to reach. You can also switch mode to "SCAN" and see if PITCH is moving correctly.

          I will try to reproduce this behavior in my tracker and hopefully find a solution.

          • OK, we tried the same thing with both your version and the official version of the firmware.  Also, in both cases we monitored "nav_pitch" while testing.  We moved the vehicle up and down by over 3 meters while moving about.

            In both cases the antenna tracker maintained good heading no matter where the air vehicle went.  With the official firmware nav_pitch stayed constant at 0, while for your software it stayed constant at 45 degrees.

            Also in both cases we monitored the altimeter data and it was changing as we changed altitude (starting at about 1000).

            I think you're right.  Something changed in the messaging.

            • I had same problem exactly same as Andrew, I have no choice just go back to v0.4, tried back to v0.5 but can't find it.

              • Is there a way to roll back without compiling from source?  We haven't done that yet and are still on the learning curve.

                • I think you can do it via MP by selecting "Pick previous firmware". You will then see 0.4

                  • Thanks!  We rolled back to 0.4 and it's working.  Now we'll tune the PID values.

            • I am working on a version that uses GPS altitude rather than baro readings. I have a working firmware uploaded into one of my boards but I accidentally deleted sources and I am rewriting the code from memory... When I'm done it should work fine. By the time I do it you may try downgrading to 0.5 - it should work fine for you as you don't use CR servos.

              You may also try downgrading your target - I think I use Copter 3.2.1

        • Correction:  2.5:1 gear ratio on the horizontal axis.

  • At last I have completed mechanical part of my AT.

    Here is spec:

    -yaw servo is CR geared with spur belt

    -pitch is classic 90° servo

    -brain is APM 1.4 with MT GPS and external compass, loaded with AT 0.7.2 build from Jakub Oller

    Servo type set via MissionPlanner to ContinuousRotation, Yaw Range of Movement set to 360°.

    Pitch Range of Movement set to 70°.

    I attached all params too.

     

    All initial actions performed (accels and compass callibrattion)

    Now  when I switch on the tracker, pitch servo moves to 45° possition and after few seconds it moves to around -5° or 0°

    but then nothing else happen except the yaw servo moves veeeeery slowly in one direction, it's almost invisible movement and then it stops completely. 

    I also tried to reverse yaw servo but then after moving pitch servo from 45 to 0 yaw servo start to move in one direction swiftly and after cca 45° it starts move erratic forth and back.

    OK now when in AUTO mode I switch mode to servo_test  yaw servo is reflecting the slider movement in range cca +-110°.

    Tilt servo reflects slider movement very erratic and when going to point stright up it overmoves up and down in divergent loop 

    - perhaps wrong PID params for pitch servo?

    Any idea where I can start to fix it?

    AT.param

    AT.jpg

    • Palo,

      This firmware is very experimental and I have never tried running AT on APM1.4. The very fact that it actually does something is comforting. Although it may be a firmware issue I would start with the basics. At first read through the comments that are inside the code:

      // Need to configure your servo so that increasing servo_out causes increase in pitch/elevation (ie pointing higher into the sky,

      // above the horizon. On my antenna tracker this requires the pitch/elevation servo to be reversed
      // param set RC2_REV -1
      //
      // The pitch servo (RC channel 2) is configured for servo_out of -9000-0-9000 servo_out,
      // which will drive the servo from RC2_MIN to RC2_MAX usec pulse width.
      // Therefore, you must set RC2_MIN and RC2_MAX so that your servo drives the antenna altitude between -90 to 90 exactly
      // To drive my HS-645MG servos through their full 180 degrees of rotational range, I have to set:
      // param set RC2_MAX 2540
      // param set RC2_MIN 640
      //
      // You will also need to tune the pitch PID to suit your antenna and servos. I use:
      // PITCH2SRV_P 0.100000
      // PITCH2SRV_I 0.020000
      // PITCH2SRV_D 0.000000
      // PITCH2SRV_IMAX 4000.000000

      I have never used classic servos in AT but I would start with simple steps:

      1. Find the correct direction and MIN/MAX values for your pitch servo - to do that you should connect an RC Reveiver or a servo tester to APM's input ports (just like you would with plane or copter firmware). When you have it up and running (you should see some values in MP - rc1_in, rc2_in etc.). You should disconnect YAW servo, since it will behave erratically during pitch setup. When you are sure that your RC transmitter (or servo tester) is working fine you can change mode to "MANUAL". You can do it via MP. In MANUAL mode APM will simply copy input PWM to servo outputs and you will be able to control your PITCH manually. If it works (you can move PITCH manually via transmitter or servo tester) you can now begin calibration.

      Step 1: Move your stick (or servo tester) to middle position. Ideally it would be 1500us PWM (you can verify it in MP). If your PITCH axis is not horizontal (0 degrees) you should move it mechanically (adjust the servo itself) to make it as close to 0 degrees as possible. If you are unable to move it to exact position (but close) adjust your transmitter or servo tester. If your PITCH is horizontal look into MP rc2_in and write down the value (it should be close to 1500).

      Step 2: Move your transmitter stick all the way until PITCH points exactly up (90 degrees up). If it doesn't reach +90 degrees you may need to increase RC2_MIN and RC2_MAX, as well as increase the limits in your transmitter. You have RC2_MIN set to 1100 and RC2_MAX set to 1900 and it may be not enough - for calibration purposes you may set it to RC2_MIN=500 and RC2_MAX=2500. When you reach +90 degrees (pointing straight up) write down the PWM value that you see on rc2_in.

      Step 3: Do the same as in step 2 but facing -90 degrees (straight down).

      Step 4: Go into your parameters. Enter the value you wrote down in step 1 into "RC2_TRIM". Now compare values from step 2 and step 3. Which one is bigger?

      If value from step 2 is bigger than value from step 3, than you should set RC2_REV to 1. This would mean, that high PWM values result in PITCH facing up and low PWM values result in PITCH facing down. In such case you should enter value from step 2 into RC2_MAX and value from step 3 into RC2_MIN.

      If value from step 2 is smaller than value from step 3 you should set RC2_REV to -1, value from step 2 into RC2_MIN and value from step 3 into RC2_MAX.

      After this your PITCH should be calibrated properly. When you go into Advanced configuration and move the sliders PITCH should go from -70 do +70 without any problems. You may need to tune your PID settings - comment in the code mentioned above suggests some PID settings - these should be a good starting point.

      2. Switch back to MANUAL mode, connect RC Receiver or servo tester to rc1_in and connect YAW servo. You should be able to operate YAW servo with the stick - The more you "deflect" the stick from center position the faster it should rotate. There is a possibility, that your yaw servo is not working as it is supposed to.

      If your YAW servo is working fine in manual mode go back into servo_test mode (move the sliders in MP). If your YAW servo starts to move erratically change RC1_REV from -1 to 1. You can also change PIDs to something like this:

      YAW2SRV_D = 0
      YAW2SRV_I = 1
      YAW2SRV_IMAX = 4000
      YAW2SRV_P,1.5

      The easiest way to debug YAW is to use sliders in MP - value from slider is translated into angle from -180 to +180 so it should rotate the tracker accordingly.

      Try the above steps and report back.

This reply was deleted.

Activity

Jose Araujo liked Jose Araujo's profile
Aug 29
spencer harvey liked spencer harvey's profile
Jul 9
More…