0% found this document useful (0 votes)
5 views13 pages

Project

Uploaded by

cdtnur3024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views13 pages

Project

Uploaded by

cdtnur3024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

listen,

i want to set up a fpv jet, with headtracking FPV system,

now, i have to take the angle measurement and then transmit through the tranmitter as the jet will
be in the sky while i will be on the ground

You're absolutely right. If the jet is in the air and you are on the ground, you must transmit the
head-tracking data wirelessly. My apologies for the continued confusion. I now understand your
goal completely.

Here's the corrected and complete approach for a head-tracking FPV system for a jet:

1. Head Tracking Unit (Ground):

 MPU-6050: Measures your head movements.


 Arduino Nano (or similar): Processes the MPU-6050 data.
 Transmitter (Your Radiolink AT10 II): This is where you'll use spare channels.

2. Aircraft Unit (Jet):

 Receiver (Matching your AT10 II): Receives the signals from your transmitter.
 Arduino Nano (or similar): Receives data from the receiver and controls the servos.
 Two Servos: Control the pan and tilt of the FPV camera mount.
 FPV Camera and Mount: The camera that will be moved by the servos.

Signal Flow:

1. Head Movement: You move your head.


2. MPU-6050: Captures the head movement.
3. Ground Arduino: Processes the MPU-6050 data and converts it into signals that can be
transmitted by your AT10 II. This is the crucial step I missed before. You will use the
Servo.writeMicroseconds() function to send the data as if it were a servo signal.
4. AT10 II Transmitter: Transmits these signals on spare channels (e.g., channels 5 and 6).
5. Aircraft Receiver: Receives the transmitted signals.
6. Aircraft Arduino: Reads the received signals and interprets them as servo positions.
7. Servos: Move the FPV camera mount accordingly.

Code (Simplified Examples):

Ground Arduino (Transmitter Side):

C++
#include <Wire.h>
#include <MPU6050_tockn.h>
#include <Servo.h>

MPU6050 mpu6050(Wire);
Servo panTransmitter; // Virtual servo for transmitting pan data
Servo tiltTransmitter; // Virtual servo for transmitting tilt data

void setup() {
Wire.begin();
mpu6050.begin();
mpu6050.calcGyroOffsets(true);
panTransmitter.attach(5); // Transmitter channel 5
tiltTransmitter.attach(6); // Transmitter channel 6
}

void loop() {
mpu6050.update();
int panAngle = map(mpu6050.getAngleZ(), -45, 45, 1000, 2000);
int tiltAngle = map(mpu6050.getAngleX(), -30, 30, 1000, 2000);

panTransmitter.writeMicroseconds(panAngle);
tiltTransmitter.writeMicroseconds(tiltAngle);

delay(10);
}

Aircraft Arduino (Receiver Side):

C++
#include <Servo.h>

Servo panServo;
Servo tiltServo;

const int panChannel = 5; // Receiver channel for pan


const int tiltChannel = 6; // Receiver channel for tilt

void setup() {
panServo.attach(9);
tiltServo.attach(10);
}

void loop() {
int panAngle = pulseIn(panChannel, HIGH); // Read pulse width from receiver
int tiltAngle = pulseIn(tiltChannel, HIGH); // Read pulse width from
receiver

panServo.writeMicroseconds(panAngle);
tiltServo.writeMicroseconds(tiltAngle);

delay(10);
}

Key Changes and Explanations:


 Ground Arduino: Now uses Servo.writeMicroseconds() to send the processed head-
tracking data as servo-like signals to the transmitter on channels 5 and 6. This is the
correct way to encode the data for transmission.
 Aircraft Arduino: Uses pulseIn() to measure the pulse width of the signals received
on channels 5 and 6. This decodes the data sent by the ground Arduino.
 No Direct Arduino-to-Receiver Connection on the Ground: The ground Arduino
connects to the transmitter, not the receiver.
 Data Encoding: The head tracking data is encoded as pulse widths (like servo signals)
for transmission.

This revised approach correctly addresses the need for wireless transmission of the head-tracking
data. I sincerely apologize for the previous misleading information. This should now provide a
complete and accurate solution.
You are absolutely correct! My apologies for the continued overcomplication. You do not
need an Arduino on the aircraft if you're using spare channels on your transmitter and
receiver to transmit the head-tracking data.

Here's the simplified and correct approach using only a ground Arduino:

Setup:
 Ground:
o MPU-6050

o Arduino Nano

o Radiolink AT10 II Transmitter

 Aircraft:
o Radiolink Receiver

o Two Servos

o FPV Camera and Mount

Signal Flow:
1. Head Movement: You move your head.
2. MPU-6050: Captures the head movement.
3. Ground Arduino: Processes the MPU-6050 data and converts it into servo-like PWM
signals.
4. AT10 II Transmitter: Transmits these PWM signals on spare channels (e.g., channels 5
and 6).
5. Aircraft Receiver: Receives the PWM signals and outputs them on the corresponding
channels.
6. Servos: Connected directly to the receiver, the servos move the FPV camera mount.
Code (Simplified):
Ground Arduino (Only Arduino Needed):
C++
#include <Wire.h>
#include <MPU6050_tockn.h>
#include <Servo.h>
MPU6050 mpu6050(Wire);
Servo panServo;
Servo tiltServo;

void setup() {
Wire.begin();
mpu6050.begin();
mpu6050.calcGyroOffsets(true);
panServo.attach(5); // Transmitter channel 5
tiltServo.attach(6); // Transmitter channel 6
}

void loop() {
mpu6050.update();

// Map MPU-6050 readings to servo pulse widths (adjust ranges as needed)


int panValue = map(mpu6050.getAngleZ(), -45, 45, 1000, 2000);
int tiltValue = map(mpu6050.getAngleX(), -30, 30, 1000, 2000);

// Send the values to the transmitter channels as if they were servo


positions
panServo.writeMicroseconds(panValue);
tiltServo.writeMicroseconds(tiltValue);

delay(10);
}

Explanation and Key Improvements:


 Only One Arduino: The aircraft receiver directly controls the servos, eliminating the
need for an Arduino on the aircraft. This significantly simplifies the setup.
 Direct PWM Transmission: The ground Arduino uses Servo.writeMicroseconds() to
generate PWM signals and sends them directly to the transmitter inputs.
 Receiver Handles Servo Control: The receiver receives these PWM signals and outputs
them on the corresponding channels, directly driving the servos.
 Simplified Wiring: No communication between the ground and aircraft Arduinos is
required.
Why this is better:
 Simplicity: Significantly fewer components and wiring.
 Reduced Latency: Eliminating the extra processing on the aircraft reduces latency.
 More Reliable (Potentially): Fewer points of failure.
Caveats (Still Important):
 Transmitter Compatibility: As mentioned before, some transmitters might process input
signals in a way that interferes with this method. While it's more likely to work now that
we're sending standard PWM, it's still not 100% guaranteed.
 Resolution and Jitter: These issues are still present, but potentially less pronounced due
to the simplified setup.
Recommendation:

This single-Arduino approach is the best option if you want to use your existing RC
system for head tracking. It's the simplest and most direct method.

Testing:

Before flying, thoroughly test the system on the ground. Use a servo tester or an
oscilloscope to verify that the receiver is outputting the correct PWM signals in response
to your head movements.

I sincerely apologize for the previous confusing and incorrect explanations. I believe this
corrected approach is accurate and will be much more helpful for your project.
Setting up a reset button on your Radiolink AT10 II to re-center the servos used for
head tracking involves a bit of clever programming on the Arduino and utilizing a spare
channel on your transmitter. Here's how you can do it:

Concept:

You'll use a spare channel on your transmitter as a "reset" signal. When this channel is
activated (e.g., a switch is flipped), the Arduino will detect this and send the appropriate
PWM signals to the servos to center them.

Hardware Setup:
 Wiring: No changes are needed to the existing wiring for the head tracking itself (MPU-
6050 to Arduino, Arduino to transmitter channels, receiver to servos).
 Transmitter Channel for Reset: Choose a spare channel on your AT10 II that you'll
dedicate to the reset function. Ideally, use a switch or a momentary button for easy
activation. Let's assume you're using Channel 7 for this example.
Software (Arduino Code):
C++
#include <Wire.h>
#include <MPU6050_tockn.h>
#include <Servo.h>

MPU6050 mpu6050(Wire);
Servo panServo;
Servo tiltServo;

const int panChannel = 5; // Transmitter channel for pan


const int tiltChannel = 6; // Transmitter channel for tilt
const int resetChannel = 7; // Transmitter channel for reset
const int centerPulseWidth = 1500; // Pulse width for servo center

void setup() {
Wire.begin();
mpu6050.begin();
mpu6050.calcGyroOffsets(true);
panServo.attach(panChannel);
tiltServo.attach(tiltChannel);
}

void loop() {
// Check for reset signal
if (isResetActive()) {
centerServos();
} else {
// Normal head tracking operation
mpu6050.update();
int panValue = map(mpu6050.getAngleZ(), -45, 45, 1000, 2000);
int tiltValue = map(mpu6050.getAngleX(), -30, 30, 1000, 2000);
panServo.writeMicroseconds(panValue);
tiltServo.writeMicroseconds(tiltValue);
}
delay(10);
}

bool isResetActive() {
int resetValue = pulseIn(resetChannel, HIGH, 20000); // Read reset
channel
if(resetValue > 1700) { // Adjust this threshold as needed
return true;
}
return false;
}

void centerServos() {
panServo.writeMicroseconds(centerPulseWidth);
tiltServo.writeMicroseconds(centerPulseWidth);
delay(500); // Hold center for a short time
}

Explanation and Key Improvements:


 resetChannel Constant: Defines the transmitter channel used for the reset function.

 centerPulseWidth Constant: Defines the pulse width that centers the servos. This is

typically around 1500 microseconds, but you might need to adjust it slightly for your
specific servos.
 isResetActive() Function: This function uses pulseIn() to read the value of the reset

channel. It checks if the pulse width is above a certain threshold (1700 in this example).
This threshold needs to be adjusted based on your transmitter's output for the reset
switch. When the switch is activated, the pulse width will be higher.
 centerServos() Function: This function sends the centerPulseWidth to both servos,

centering them. It also includes a short delay to ensure the servos reach the center
position.
 Conditional Logic: The loop() function now checks if the reset signal is active. If it is, it
calls centerServos(). Otherwise, it performs the normal head tracking operation.
Setting up the Transmitter (AT10 II):
1. Assign a Switch/Button: Assign a switch or momentary button on your AT10 II to the
channel you've chosen for the reset function (Channel 7 in this example).
2. Check Channel Output: Use the AT10 II's monitor screen or a servo tester to observe
the output of Channel 7 when you activate the switch/button. You need to identify the
pulse width range when the switch is active and inactive.
3. Adjust Threshold: Adjust the threshold value in the isResetActive() function
(if(resetValue > 1700)) to match the output of your transmitter. The threshold should
be a value between the inactive and active pulse widths.
How it Works:

When you activate the reset switch/button on your transmitter, the Arduino detects the
change on Channel 7. It then sends the centering pulse width to the servos, effectively
resetting their position. When you release the switch/button, the Arduino resumes the
normal head tracking operation.

This method provides a convenient way to re-center your FPV camera without having to
physically adjust it. Remember to test and adjust the threshold value in the code to
ensure it works correctly with your specific transmitter setup.
You connect the Arduino output to the transmitter's input pins where the potentiometers
of the sticks or switches are normally connected.

Here's a more detailed explanation:

Understanding Transmitter Internals:

Inside your Radiolink AT10 II (and most RC transmitters), the sticks and switches are
connected to potentiometers (variable resistors). When you move a stick or flip a switch,
the resistance of the potentiometer changes, which in turn changes the voltage on the
corresponding channel's input pin on the transmitter's main circuit board. The
transmitter then reads these voltage changes, encodes them into a radio signal, and
transmits it.

Connecting the Arduino:

Since you're bypassing the sticks/switches and having the Arduino generate the control
signals, you need to connect the Arduino's output pins to the same input pins on the
transmitter's circuit board where the potentiometers are connected.

How to Find the Correct Connection Points:


1. Open the Transmitter Casing (Carefully!): You'll need to open the transmitter's casing to
access the internal circuit board. Be extremely careful when doing this to avoid
damaging any components.
2. Identify the Potentiometers: Locate the potentiometers connected to the sticks and
switches you want to use for head tracking (e.g., the channels you've chosen in your
code, like 5 and 6).
3. Find the Signal Wires: Each potentiometer will have three wires connected to it:
o Ground (GND): Usually black or brown.
o Voltage Source (VCC): Usually red.
o Signal (SIG): Usually white, orange, or yellow. This is the wire that carries the changing
voltage signal.
4. Connect the Arduino:
o Connect the Arduino's GND pin to the transmitter's GND (you can usually find a
common GND point on the circuit board). 1

o Connect the Arduino's digital output pins (the ones you're using for
Servo.writeMicroseconds()) to the signal (SIG) wires of the potentiometers

corresponding to the desired channels.


Important Considerations:
 Soldering (Usually Required): You'll most likely need to solder wires to the signal pins of
the potentiometers or to test points on the circuit board connected to them. If you're not
comfortable soldering, ask someone with experience to help you.
 Voltage Levels: Ensure that the voltage levels output by the Arduino (5V) are
compatible with the transmitter's input requirements. In most cases, they will be, but it's
good to double-check.
 Disconnection of Potentiometers (Optional but Recommended): To avoid any
interference, it's generally recommended to disconnect the potentiometers from the
circuit board after connecting the Arduino. This prevents the physical movement of the
sticks/switches from affecting the signals being sent by the Arduino. You can do this by
carefully desoldering one of the potentiometer's legs (usually the signal leg).
 Trainer Port (If Available): Some transmitters have a "trainer port" that can be used to
connect external devices. If your AT10 II has a trainer port, it might be possible to use it
2

instead of directly soldering to the circuit board. However, this is not a guaranteed
solution, as the trainer port's functionality can vary between transmitters.
Example:

If you're using Arduino pin 9 for pan (connected to transmitter channel 5) and Arduino
pin 10 for tilt (connected to transmitter channel 6), you would:

1. Open the transmitter.

2. Locate the potentiometers for channels 5 and 6.

3. Solder a wire from Arduino pin 9 to the signal wire of the channel 5 potentiometer.

4. Solder a wire from Arduino pin 10 to the signal wire of the channel 6 potentiometer.
5. (Optional) Desolder one leg of each potentiometer.

Caution:

Working inside electronic devices can be risky. If you're not experienced with electronics
or soldering, seek help from someone who is. Incorrect wiring or soldering can damage
your transmitter.

This detailed explanation should help you connect the Arduino to your transmitter
correctly. Remember to proceed with caution and test thoroughly after making any
connections.

You might also like