Unable to send signals from XJT Module to XM+ Receiver

Electronic projects that are either related to the firmwares for the 9x, or simply great for radio control applications.
Post Reply
DroneNewbie
Posts: 4
Joined: Sun May 02, 2021 3:39 pm
Country: -

Unable to send signals from XJT Module to XM+ Receiver

Post by DroneNewbie »

Hello!

I have a project at school where I should move a drone remotely with the computer. That's when I ran into a problem. I can’t send PPM signals from my transmitter to the drone, or I send it in a wrong form.

I have two approaches:

The first plan would be for the computer to accept commands and send them to the Arduino. This then generates PPM signals and sends them on to a transmitter (FrSky XJT module), which then sends the signals to the drone (Beta85X Whoop Quadcopter with XM+ Receiver). The problem here is that I can connect the module to the drone, but the signals are not transmitted or are transmitted incorrectly.

The second plan would be to use the teacher / student mode to send the signals. I would use the LiteRadio2 controller, which should send signals to the drone, but this approach is still only theoretical and not tested.

Unfortunately, I am not sure whether the approaches are really correct and I would appreciate any help or feedback.

Just tell me if you need more information and I will gladly provide them.

Many Thanks!

User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Unable to send signals from XJT Module to XM+ Receiver

Post by MikeB »

What is the Arduino sending to the module?
It should be sending what is called CPPM (Composite PPM), where it sends a pulse train, one pulse for each channel, followed by a longer pulse (>4mS) as a sync. pulse.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
DroneNewbie
Posts: 4
Joined: Sun May 02, 2021 3:39 pm
Country: -

Re: Unable to send signals from XJT Module to XM+ Receiver

Post by DroneNewbie »

Since i was only testing things out, i only grabbed some random ppm generator code from the internet. So do you think it is, because i am only sending ppm signals and not a cppm signal?
One of the example Code is:
/*
* PPM generator originally written by David Hasko
* on https://code.google.com/p/generate-ppm-signal/
*/

//////////////////////CONFIGURATION///////////////////////////////
#define CHANNEL_NUMBER 12 //set the number of chanels
#define CHANNEL_DEFAULT_VALUE 1500 //set the default servo value
#define FRAME_LENGTH 22500 //set the PPM frame length in microseconds (1ms = 1000µs)
#define PULSE_LENGTH 300 //set the pulse length
#define onState 1 //set polarity of the pulses: 1 is positive, 0 is negative
#define sigPin 10 //set PPM signal output pin on the arduino

/*this array holds the servo values for the ppm signal
change theese values in your code (usually servo values move between 1000 and 2000)*/
int ppm[CHANNEL_NUMBER];

void setup(){

//initiallize default ppm values
for(int i=0; i<CHANNEL_NUMBER; i++){
ppm= CHANNEL_DEFAULT_VALUE;
}

pinMode(sigPin, OUTPUT);
digitalWrite(sigPin, !onState); //set the PPM signal pin to the default state (off)

cli();
TCCR1A = 0; // set entire TCCR1 register to 0
TCCR1B = 0;

OCR1A = 100; // compare match register, change this
TCCR1B |= (1 << WGM12); // turn on CTC mode
TCCR1B |= (1 << CS11); // 8 prescaler: 0,5 microseconds at 16mhz
TIMSK1 |= (1 << OCIE1A); // enable timer compare interrupt
sei();

}

void loop(){

/*
Here modify ppm array and set any channel to value between 1000 and 2000.
Timer running in the background will take care of the rest and automatically
generate PPM signal on output pin using values in ppm array
*/

}

ISR(TIMER1_COMPA_vect){ //leave this alone
static boolean state = true;

TCNT1 = 0;

if (state) { //start pulse
digitalWrite(sigPin, onState);
OCR1A = PULSE_LENGTH * 2;
state = false;
} else{ //end pulse and calculate when to start the next pulse
static byte cur_chan_numb;
static unsigned int calc_rest;

digitalWrite(sigPin, !onState);
state = true;

if(cur_chan_numb >= CHANNEL_NUMBER){
cur_chan_numb = 0;
calc_rest = calc_rest + PULSE_LENGTH;//
OCR1A = (FRAME_LENGTH - calc_rest) * 2;
calc_rest = 0;
}
else{
OCR1A = (ppm[cur_chan_numb] - PULSE_LENGTH) * 2;
calc_rest = calc_rest + ppm[cur_chan_numb];
cur_chan_numb++;
}
}
}
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Unable to send signals from XJT Module to XM+ Receiver

Post by MikeB »

12 channels is too many for a frame length of 22.5mS. You need to allow at least 2mS for each channel, then at least 4mS for the sync.
Either reduce the number of channels to 8, or increase the frame length to (12*2+4.5) at least 28.5mS.

Which connections are you using on the module?

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
DroneNewbie
Posts: 4
Joined: Sun May 02, 2021 3:39 pm
Country: -

Re: Unable to send signals from XJT Module to XM+ Receiver

Post by DroneNewbie »

Hello, sorry for the late answer!

On the XJT Modul we are using the RS232 Serial Port (Txd, +5V , GND). The PPM Signal go out through Pin 10 on the arduino

Thanks for the help!

User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Unable to send signals from XJT Module to XM+ Receiver

Post by Kilrah »

The module doesn't accept PPM on the label-side ports, only on the top pin of the 5-pin module connector.
DroneNewbie
Posts: 4
Joined: Sun May 02, 2021 3:39 pm
Country: -

Re: Unable to send signals from XJT Module to XM+ Receiver

Post by DroneNewbie »

Kilrah wrote: Tue May 04, 2021 11:07 am The module doesn't accept PPM on the label-side ports, only on the top pin of the 5-pin module connector.
Sorry i don't quite understand what that means...
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Unable to send signals from XJT Module to XM+ Receiver

Post by MikeB »

The module is designed to plug in to a transmitter. For this purpose there is a 5-way connector on the side opposite from the face where you see switches and LEDs.
This is the "5-pin module connector". The top connection (closest to the antenna) is the one you need to use.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Post Reply

Return to “General RC Electronic Projects and Discussion”