PPM to Joystick

I think I have found it. I have to reprogram another TEENSY 3.2 with the code to confirm.

unfortunately, not quite what I need. I would like to be on ardupilot (quiet long distance flights). As I understand it, betaflight is more suitable for freestyle.
By the way, what if I only use telemetry? without main transmitter?
I.e. I connect telemetry transmitting and receiving equipment to the drone. To the laptop too. Can I use the mission planner to control the drone manually with a joystick (for example: takeoff and landing, simple aerobatics) and over long distances by waypoints?

Please read the posts more carefully.
The betaflight FC is not used on the vehicle! It is used as a USB joystick dongle for the GCS computer. This way you can use any RC transmitter as a joystick.

Why don’t you clearly re-state what you do need?

In general, I want to transmit control commands from the mission planner to the transmitter. That is, get rid of the remote control.
It seems to me that I can only use RFD868 to receive telemetry and control the drone?

Which “transmitter” do you want to use for this communication? I take it you don’t want to use a transceiver like the RFD868?

I’m pretty sure only one radio connection is needed to use Mission Planner. I’m not positive, but I believe this radio connection needs a way of sending and receiving Mavlink messages.

This thread was originally about using a normal RC transmitter/receiver pair as a joystick input to Mission Planner. The solution @charles_linquist came up with replicates the work discussed in this thread I linked to earlier. (Or the technique mentioned in the other thread replicates the work of @charles_linquist. I don’t know which method was developed first. Bother techniques were likely independently developed.)

By “transmitter” I mean something like a crossfire TX that plugs into the remote control.
I am currently considering using only RFD868 for two-way communication. From the drone, telemetry data from the laptop control signals.
Just due to the fact that I’m just getting into the topic of drones, I really lack knowledge. Therefore, I was not sure about the possibility of using RFD868

So you want this bundle. Plugs into your radio like a crossfire module, and it will also create a wifi link To your laptop for mission planner. Crossfire can technically do this as well but it’s not very practical yet.

Well, I’m very curious to see that code. Even though the betaflight controller is working. So you can send the code even untested.

I have not tested but this look conform:

I tried this code, but it fails compilation. I tried with many different boards, but I keep getting errors. Unfortunately, my coding knowledge is very low…

I’m still looking for a dedicated ppm to joystick converter. Even though the betaflight controller was working, today it stopped. I’m still debugging, but haven’t found the problem yet.

You have to make sure you are using a HID compliant device like an arduino Pro Micro or a Teensy.

The reason for this is I would like to have a possibility control the aircraft when out if range of the tx via telemetry, just using the same transmitter. This would be like an emergency home-bringer.

I’ve tried it using SITL, and it seems to work.

Technically you have the home-bringer with the Failsafe mode as it automatically switch to RTL in case of RC and/or GCS lost.

I tested remote control through GCS telemetry long range on 900MHZ using my Spektrum RF linked to this Dongle and connected to PC acting as Joystick control

https://www.spektrumrc.com/Products/Default.aspx?ProdID=SPMWS2000
it is working OK in guided modes but it is sluggish and laggy in manual control

Fully agree with you about this failsafe. However, this telemetry solution would be the last resource to bring the aircraft home. I’ve also seen those dongles, but they are always dedicated to a specific tx. I am still looking for a reliable, universal ppm (or any other protocol) 8 channel to joystick converter solution.

I guess the FC & Betaflight combo is a good option, that is cheap and easy to implement

You are right. It worked very well for a few days, but today stopped. Anyway, many thanks for your help and advice. Much appreciated.

1 Like

/*

  • This code was adapted from many others by Charles Linquist
  • of CAL Multirotor in Arroyo Grande, CA
  • Use a TEENSY 3.2
  • The TEENSY must be uploaded in the serial+keyboard+mouse+joystick mode
  • Connect the TEENSYs VCC and GND pins to the receiver and
  • the PPM output of the receiver to TEENSY Pin #10
  • This circuit has been tested with a FrSKY i10 receiver, although
  • any other one should work.
  • If you need to change the input pin, change the number in the joyin.begin line.
  • you will need the PulsePosition.h file from the TEENSY website.

#include <PulsePosition.h>

PulsePositionInput joyIn;

void setup() {
Joystick.useManualSend(true);
joyIn.begin(10);
}

void loop() {
int num;
num = joyIn.available();
if (num > 0) {
Joystick.X(map(joyIn.read(4),1050, 1900, 0, 1024));//Pitch
Joystick.Y(map(joyIn.read(2),1050, 1900, 0, 1024));//Roll
Joystick.Z(map(joyIn.read(3),1050, 1900, 0, 1024));//Throttle
Joystick.Zrotate(map(joyIn.read(1),1050, 1900, 0, 1024));
Joystick.sliderLeft (map(joyIn.read(5),1050, 1900, 0, 1024));
Joystick.sliderRight(map(joyIn.read(6),1012, 2012, 0, 1024));
Joystick.button(3, joyIn.read(7) >= 1900);
Joystick.button(4, joyIn.read(8) >= 1900);
}
Joystick.send_now();
delay(5);
}

/*

  • This code was adapted from many others by Charles Linquist
  • of CAL Multirotor in Arroyo Grande, CA
  • Use a TEENSY 3.2
  • The TEENSY must be uploaded in the serial+keyboard+mouse+joystick mode
  • Connect the TEENSYs VCC and GND pins to the receiver and
  • the PPM output of the receiver to TEENSY Pin #10
  • This circuit has been tested with a FrSKY i10 receiver, although
  • any other one should work.
  • If you need to change the input pin, change the number in the joyin.begin line.
  • requires PulsePosition.h from TEENSY website
    */

#include <PulsePosition.h>

PulsePositionInput joyIn;

void setup() {
Joystick.useManualSend(true);
joyIn.begin(10);
}

void loop() {
int num;
num = joyIn.available();
if (num > 0) {
Joystick.X(map(joyIn.read(4),1050, 1900, 0, 1024));//Pitch
Joystick.Y(map(joyIn.read(2),1050, 1900, 0, 1024));//Roll
Joystick.Z(map(joyIn.read(3),1050, 1900, 0, 1024));//Throttle
Joystick.Zrotate(map(joyIn.read(1),1050, 1900, 0, 1024));
Joystick.sliderLeft (map(joyIn.read(5),1050, 1900, 0, 1024));
Joystick.sliderRight(map(joyIn.read(6),1012, 2012, 0, 1024));
Joystick.button(3, joyIn.read(7) >= 1900);
Joystick.button(4, joyIn.read(8) >= 1900);
}
Joystick.send_now();
delay(5);
}