FPVLAB

image
Results 1 to 8 of 8

Thread: RSSI Antenna tracker - separate scanning and video antennas

  1. #1
    Navigator
    Join Date
    Jun 2011
    Location
    Auckland, New Zealand
    Posts
    405

    RSSI Antenna tracker - separate scanning and video antennas

    Another member made a version of this with stepper motors
    http://fpvlab.com/forums/showthread....-no-GPS-needed!

    Here is a similar sketch for use with servos instead of stepper motors


    Code:
    #include < arduino.h > //remove spaces from inside brackets
    #include < Servo.h > //remove spaces from inside brackets
    
    //Two servos on pins digital 2 and 3
    const int servoScanPin = 2;
    const int servoTrackPin = 3;
    const int rssiInput = A0;     // scan  rssi input
    
    
    Servo servoScan;  // create servo objects to control servo
    Servo servoTrack;
    
    
    int i = 90;
    int j = 0;
    int Direction = 1;
    int rssi = 0;
    float rssiFiltered = 0;
    float rssiMax = 0;
    float k = 0.01;  //filtering values between step sizes
    int rssiProfile[180];
    int posMax = 0;
    
    
    
    
    void setup() {
    Serial.begin(9600); // set up Serial library at 9600 bps
    pinMode(rssiInput, INPUT);  
    servoScan.attach(servoScanPin);  
    servoScan.write(0);
    servoTrack.attach(servoTrackPin);
    servoTrack.write(90);
    Serial.println("setup complete "); 
    }
    
    
    
    
    void loop() {            
    
    
      servoScan.write(i);   
        
      for (j=0; j<30; j++)                              {   // Sample RSSI input several times at each step
        rssi = analogRead(rssiInput);  
        rssiFiltered = k*rssi + (1-k)*rssiFiltered; }  // Low pass filter RSSI values
        
      rssiProfile[i] = rssiFiltered;                         // Enter filtered RSSI values into the array
     
      if (rssiProfile[i] > rssiMax) {    // Update maximum position as loop progresses
        rssiMax = rssiProfile[i];         // 
        posMax = i;                 }      // Tracking servo position to write corresponds to rssiMax position
    
    
      Serial.print(" Direction:"); 
      Serial.print(Direction);
    
    
      Serial.print(" RSSI:"); 
      Serial.print(rssiFiltered);
      
      Serial.print(" RSSImax:"); 
      Serial.print(rssiMax);
    
    
      Serial.print(" Step:"); 
      Serial.println(i); 
      
    if (Direction == 1)  i++;
    if (Direction == -1) i--;
      
      if (i == 180 || i == 0)       {   // At each servo end point
        servoTrack.write(posMax);       // Update tracker servo with position
        Direction = Direction * -1;     // Reverse direction of servo steps
        rssiMax = 0;                    // Reset maxima
        Serial.print(" Point to step:"); 
        Serial.println(posMax); 
        delay(1);                 }   // Pause for a bit after each sweep
         
    }




    Here is some else's video implementing the same concept

    Last edited by Optical; 4th March 2016 at 02:38 AM.

  2. #2
    Navigator
    Join Date
    Jun 2011
    Location
    Auckland, New Zealand
    Posts
    405

  3. #3
    Navigator
    Join Date
    Jun 2011
    Location
    Auckland, New Zealand
    Posts
    405
    Updated. Working on the bench now.
    Servo scan rate is about 9 seconds end to end (Arduino pro mini). This could be sped up by stepping two servo steps at once instead or maybe filtering less...

  4. #4
    Navigator
    Join Date
    Aug 2012
    Posts
    29
    Interesting. Happy to post to NZ.

    ilovetoflyfpv RSSI Antenna Tracker
    Last edited by ilovetoflyfpv; 4th March 2016 at 03:11 PM.

  5. #5
    Navigator
    Join Date
    Jun 2011
    Location
    Auckland, New Zealand
    Posts
    405
    This code is tested and working quite well. Just connect two servos of the same type and an rssi input

    Anyone given it a try?


    Code:
    #include < arduino.h > //remove spaces from inside brackets
    #include < Servo.h > //remove spaces from inside brackets
    
    
    //Two servos on pins digital 2 and 3
    const int servoScanPin = 2;
    const int servoTrackPin = 3;
    const int rssiInput = A0;     // scanner  rssi input
    
    
    Servo servoScan;  // create servo objects to control servo
    Servo servoTrack;
    
    
    int i = 0;
    int Direction = 1;
    int rssi = 0;
    float rssiFiltered = 0;
    float rssiMax = 0;
    float k = 0.0001;  //filtering values between step sizes
    int rssiProfileA[180];
    int rssiProfileB[180];
    int rssiAverage[180];
    int posMax = 0;
    int stepSize = 1;
    
    
    void setup() {
      Serial.begin(9600); // set up Serial library at 9600 bps
      pinMode(rssiInput, INPUT);
      servoScan.attach(servoScanPin);
      servoTrack.attach(servoTrackPin);
      servoScan.write(i);
      servoTrack.write(90);
      //  for (int i = 50; i >= 0; i = i - 5)  { //ensure array is cleared
      //    servoScan.write(i);
      //    delay(1000);
      //  }
    
    
      for (int z = 0; z <= 180; z++)  { //ensure array is cleared
        rssiProfileA[z] = 0;
        rssiProfileB[z] = 0;
        rssiAverage[z] = 0;
      }
    
    
    
    
      Serial.println("setup complete ");
      delay(5000);
    
    
    }
    
    
    void loop() {
    
    
      servoScan.write(i);
      for (int j = 0; j <= 5; j++) {
        rssi = 0.8 * rssi + 0.2 * analogRead(rssiInput);
      }
      delay(10);
    
    
      if (Direction == 1) {
        rssiProfileA[i] = rssi;                   // Enter filtered RSSI values into the array
        i = i + stepSize;
      }
    
    
      if (Direction == -1) {
        rssiProfileB[i] = rssi;                   // Enter filtered RSSI values into the array
        i = i - stepSize;
      }
    
    
      if (i <= 0 || i >= 180)                  {   // 40 to 137 for gws125
        Direction = Direction * -1;     // Reverse direction of servo steps
        delay(250);
    
    
          rssiMax = 0;
          for (int k = 0; k <= 180; k++)  {
            rssiAverage[k] = (rssiProfileA[k] + rssiProfileB[k]) / 2;
            if (rssiAverage[k] > rssiMax) {
              posMax = k;
              rssiMax = rssiAverage[k];
            }
          }
    
    
          servoTrack.write(posMax);         // Update tracker servo with position
          Serial.print(" Point to step:");
          Serial.println(posMax);
    
    
      }
    
    
    
    
      Serial.print(" Direction:");
      Serial.print(Direction);
      Serial.print(" RSSI:");
      Serial.print(rssi);
      Serial.print(" RSSImax:");
      Serial.print(rssiMax);
      Serial.print(" Step:");
      Serial.println(i);
    
    
    
    
    }
    Last edited by Optical; 1st May 2016 at 09:21 PM.

  6. #6
    Navigator
    Join Date
    Sep 2013
    Posts
    77
    I know the last post was a few months ago but I would like to give this a try. Ive been scouring the internet and youtube; I have either found $250+ kits or people that have created something but disappeared without sharing anything. On that note thanks for sharing. I will post once I get parts in to start.

  7. #7
    Navigator
    Join Date
    Aug 2012
    Posts
    29
    Hi ellou79

    I've been developing a tracker using RSSI over the past few years. I offer a kit that sells for just $90 USD. The firmware is far more elaborate than what has been shared here. It's well worth checking out Heppy Ket on YouTube as he has many videos demonstrating/using the system. I hope that helps.

    Cheers

    Jase

    ilovetoflyfpv Antenna Tracker RSSI

    Quote Originally Posted by ellou79 View Post
    I know the last post was a few months ago but I would like to give this a try. Ive been scouring the internet and youtube; I have either found $250+ kits or people that have created something but disappeared without sharing anything. On that note thanks for sharing. I will post once I get parts in to start.

  8. #8
    Navigator
    Join Date
    Jan 2014
    Location
    Australia
    Posts
    17
    Jase
    I'm hoping you still look at this, because I was wanting to pick up one of your kits if possible.
    cheers
    Dennis

    I've been developing a tracker using RSSI over the past few years. I offer a kit that sells for just $90 USD. The firmware is far more elaborate than what has been shared here. It's well worth checking out Heppy Ket on YouTube as he has many videos demonstrating/using the system. I hope that helps.

    Cheers

    Jase

    ilovetoflyfpv Antenna Tracker RSSI[/QUOTE]

Similar Threads

  1. Video Link issue when Cam is powered by separate battery
    By wootenelli in forum IFR - Video Link Discussion
    Replies: 9
    Last Post: 27th January 2014, 06:53 PM
  2. Cinemizer separate video feeds per screen
    By Izord in forum LUMENIER
    Replies: 2
    Last Post: 11th August 2013, 06:26 AM
  3. Why do you need a separate link for RC and Video for LRS?
    By rtmoore4 in forum IFR - Video Link Discussion
    Replies: 3
    Last Post: 30th September 2012, 01:22 AM
  4. Separate battery for Video Tx
    By StevPrin in forum IFR - Video Link Discussion
    Replies: 7
    Last Post: 5th May 2012, 02:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •