Computer Controlled CX-10

18 Aug

The goal is to control the CX-10 (without custom firmware) from a computer. This is accomplished by connecting some wires from the transmitter to an Arduino. The potentiometers are removed from the transmitter and replaced by wires which connect to the custom Arduino shield. The buttons are connected without removing the actual buttons.

Schematics

The schematics are pretty simple. Normally, the potentiometers provide a voltage between 0V and something around 3.4V. With the Aruino Uno, a PWM signal is generated and filtered with a low-pass filter. The voltage divider with two resistors (values 100K and 20K) brings it down from 5V to 4.17V. However, due to the capacitor the value seems to drop further. The oscilloscope showed a value at the outputs of around 3.4V at a duty cycle of 100%.

Schematics of the Arduino shield.
Schematics of the Arduino shield.

 

Arduino Shield

I constructed an Arduino prototyping shield according to the schematics. It has a pin header to connect to the transmitter later on. In addition to the schematics, it also has two MOSFETs to pull two push-buttons low. These buttons control the aerobatics-mode and the flip.

Arduino prototyping shield.
Arduino prototyping shield.

 

Transmitter modification

The original transmitter is modified to be able to use it with the Arduino. The potentiometers need to be removed and are replaced with wires to the Arduino. The buttons can stay in place because they are normally open.

Removal of the potentiometers.
Removal of the potentiometers.
Wires connected to mimic the potentiometers.
Wires connected to mimic the potentiometers.
Nice cable that fits into the Arduino shield.
Nice cable that fits into the Arduino shield.

 

Arduino firmware

The Arduino is flashed with Standard Firmata firmware. This firmware is available by default in the Arduino IDE. Only a small modification is done that increases the PWM frequency to the maximum. In the setup section, the following is added:

TCCR1B = TCCR1B & B11111000 | B00000001;    // set timer 1 divisor to     1 for PWM frequency of 31372.55 Hz
TCCR2B = TCCR2B & B11111000 | B00000001;    // set timer 2 divisor to     1 for PWM frequency of 31372.55 Hz

More information about Arduino PWM frequencies is available here: https://arduino-info.wikispaces.com/Arduino-PWM-Frequency

Computer software

A computer program can send firmata commands to the Arduino. For now, I made a quick and dirty program that translate joystick commands to the PWM values of the Arduino. This is the result:

5 Replies to “Computer Controlled CX-10

  1. It is not clear how you wired the potentiometers; it looks like you have 4 green (ground) wires to each middle wire, and you show one blue to one side, and later you show two yellows and a red, but not where they attach. You only have 8 wires total?

    Also, stupid question, you only use the voltage divider because the Arduino is delivering a fixed PWM signal? I am using a Raspberry Pi and I am hoping I can deliver the correct voltage and PWM via software (or rather, controlled via software). Am I completely misguided?

    • I used random colors. The green ones are TRANS_XXX in the schematic. The blue one is ground there.

      Voltage divider is there because the signal from Arduino is 5V. You could use the RPI directly since it is 3.3V, although you might still need a low pass filter.

      • Bart, thanks for responding so quickly.

        So, your random colors, were exactly do they attach on the controller PCB? I take it they go where the terminals of the potentiometer were, but there are three and you only attach to two. Other than the middle one (green), which other terminal do you use? Sorry, I think this is obvious to you, but I really have no idea which one is the right one.

        As with a low pass filter, I would have to google what that is and how to make one. But more pertinent, why would I need one?

        I apologize for being so naive; my strength is in databases and programming, not hardware per se. Just trying to have some fun and teach myself a few tricks.

        • Well, obviously ground connects to ground. The low pass filter is needed to transform the PWM signal into a smooth voltage level.

Leave a Reply to Bart Slinger Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.