Thread Tools
Jan 25, 2016, 03:40 PM
Registered User
Roel-CP's Avatar
Thread OP
Idea

Arduino 2 CH RC Reciever Servo subtrim for Antenne Tracker


Sometimes a FPV antenne tracker can be a little of.
In theorie this subtrim or offset can help.
I only tested it on a small setup.
This is just an idea not a discussion.
Kind Regards form the Netherlands

// FPV Antenna Tracker subtrim RAW setup
// Hardware / 2 Potmeters / Atmega168 Arduino
// Goal is to tweak an antenna tracker with Pan / Tilt with 2 analog potmeters
// Made by Roel-CP & JP from FlyWild The Netherlands.

#include <Servo.h>

Servo servoPan; // Define Pan servo
Servo servoTilt; // Define Tilt servo

int potpinPan = 0; // analog pin 0 used to connect the potentiometer
int potpinTilt = 1; // analog pin 1 used to connect the potentiometer
int valP; // variable Pan
int valT; // variable Tilt
int potvalP; // analoge input potmeter Pan
int potvalT; // analoge input potmeter Tilt

byte trackerPan = 5; //PWM input Pan on pin 5
byte trackerTilt = 6; //PWM input Tilt on pin 6


void setup()
{
servoPan.attach(9); // Set Pan servo to digital on pin 9
servoTilt.attach(10); // Set Tilt servo to digital on pin 10

pinMode(trackerPan, INPUT);// Tell it is input Pan
Serial.begin(115200);//monitor
pinMode(trackerTilt, INPUT);// Tell it is input Tilt
Serial.begin(115200);//monitor
}

void loop()
{

valP = pulseIn(trackerPan, HIGH); //PWM read reciever Pan
valT = pulseIn(trackerTilt, HIGH); //PWM read reciever Tilt
Serial.println(valP); //monitor
Serial.println(valT); //monitor
potvalP = analogRead(potpinPan); //subtrim read Pan
potvalT = analogRead(potpinTilt); //subtrim read Tilt
potvalP = map(potvalP, 1023, 0, -125, 125); // centre subtrim with only 125 trim on Pan
potvalT = map(potvalT, 1023, 0, -125, 125); // centre subtrim with only 125 trim on Tilt
valP = (valP + potvalP); //subtrim + reciever total Pan
valT = (valT + potvalT); //subtrim + reciever total Tilt
delay(15); // hold for a sec
servoPan.write(valP); //exit pan
servoTilt.write(valT); //exit tilt

}
Sign up now
to remove ads between posts


Quick Reply
Message:

Thread Tools