In the previous article we already presented the possibility to control up to eight servos via a USB interface using a joystick or gamepad, a PC and a PiKoder/SSC. Here is now described how a wireless model remote control can be realized with a PiKoder – receiver, the PiKoder/SSC RX. Bluetooth for command transmission.
First, the PiKoder/SSC RX must be connected to the PC at the operating system level. For this purpose, you first search for new Bluetooth devices in the device control.
After a short time, the Bluetooth module of the receiver should be offered. The PIN is “1234”.
With the selection “Connect” the coupling (pairing) takes place on system level.
As the following view from the device manager shows, the coupling of the system also establishes two virtual serial interfaces, which we access later in the program for establishing a connection.
This completes the setup and the JoystickRC program can now be started as described in the previous post.
Sometimes only a joystick or a gamepad is not enough for a use case but other USB devices like rudder pedals and a headtracker should be mixed into the PPM signal.
If the devices are recognized as Windows joysticks/gamepads, then Joystick Gremlin in conjunction with vJoy provides the ability to combine devices into one or more new virtual devices.
The Joystick2PPM – applications Joystick2PPM, Joystick2PPM4Arduino, USBtoPPMforCompuFly and JoystickRC4Diddyborg offer all connected (also virtual) joysticks then at program start as input device and enable by virtualization the assignment of the axes of the different USB devices to the PPM channels.
The installation of Joystick Gremlin is described in the manual and was possible without any problems. Then you configure virtual devices with the desired assignment of axes and keys.
If one of the Joystick2PPM apps finds more than one device (no matter if physical or virtual) at startup, the user is offered a selection with all found devices at program startup.
If no selection is made by the user, then the first joystick in the list is automatically used.
In this blog I describe how I evolved the joystick / gamepad remote control of my RPI-controlled DiddyBorg to QGroundControl and MAVLink as communication protocol.
This has given me the basis to process more sensors in a standard environment in the future and to plan and execute missions for the DiddyBorg.
Software installation on the Raspberry Pi (RPi)
On the RPi, first install pymavlink, the Python version of the MAVLink libraries. The easiest way to do this is with PIP:
pip install pymavlink
After that you have to replace the module mavutil.py, because otherwise there will be no connection between the RPi and QGroundControl due to a pymavlink-issue. To do this, find the installation location of the pymavlink library with:
pip list -v
Then replace the mavutil.py module with the version in the github repository for this blog. The new version is backward compatible.
Finally, create a directory, e.g. diddy2QGC into which you copy the Python modules diddy2QGroundControl.py and ThunderBorg3.py. In this directory you then start the Python script later with:
Software installation on the desktop
Install QGroundControl on your desktop.
Starting the applications
Make sure the RPi and your desktop are on the same network and run QGroundControl (QGC) and the Python script (the order is irrelevant).
The DiddyBorg logs into the QGC and you will then find the option to teach your joystick in the Vehicle settings. Please note that diddy2QGroundControl.py in mode 2 uses the roll channel for right/left control and the inverted value of the pitch channel for motor control.
In this blog I am presenting my Windows-App USB2PPM4CompuFly for the CompuFly USBtoPPM Converter V2.0 by Flytron. This software replaces the CompuFly – programm available on the Flytron web-page.
The USBtoPPMforCompuFly-app maintains the proven user interface of the CompuFly-programm to a large extend but presents itself as a completely rewritten Windows 10/11 app with a more modern inerface and new features.
When started the app will automatically connect with the converter and the first DirectX capable Joystick or Gamepad found. Your configuration will be saved and reloaded when restarting.
The user interface of the app is intuitive and self-explanatory: simply associate joystick axes, sliders or buttons to channel outputs. In order to accommodate the specifics of your application, channels connected to sliders and axis can be trimmed and the pulse range can be adjusted (EPA).
On top of the feature set of the open source CompuFly.zip version 1.35 buttons can be turned into on/off switches. You would assign a button to an output channel. By checking the “sw” box which replaces the inverse option after you assigning a button to an output channel.
You will find the USBtoPPMforCompuFly app in the Microsoft app store.
In this blog I present my Windows app JoystickRC4DiddyBorg for remote control of the DiddyBorg (from PiBorg) with a joystick or gamepad.
The DiddyBorg sample programs published by the manufacturer PiBorg also include a Python remote control script with joystick, but it uses Bluetooth and therefore has a rather limited range.
The app presented here uses the existing WLAN and UDP as protocol to ensure sufficient agility of the remote control. For safety reasons, the time-out logic of the ThunderBorg motor controller is activated.
The DiddyBorg needs a Python script JoystickRC4DiddyBorg as receiver, which you can find on github.com. In addition to the receiver program, you will also find a version of the ThunderBorg – Library for Python 3.x in the repository (the sample programs for the DiddyBorg are still based on Python 2.x).
The easiest way is to copy the two files additionally into the directory with the examples – then the script should work without further adjustments of path names.
On the PC side, install the Windows app JoystickRC4DiddyBorg of the same name, which you can get for free from the Microsoft App Store.
First start the Python script on the DiddyBorg. If you have a screen connected, then the program will log in and indicate that it is waiting for a client.
When you start the PC app, it will automatically search for a DiddyBorg with an active and compatible receiver on the local WLAN (to which both the DiddyBorg and the PC being used must be connected). If no connection can be established, a corresponding error message is displayed.
After the connection has been successfully established, the channels can be assigned to the various joystick axes and keys. Channels 3 and 4 are used as push buttons and allow for example fast / slow rotation (the function of the push buttons can be traced in the Python script).
The assignment of the channels is saved and restored at the next program start.
The “picCAR” App turns an Android-Tablet or Smartphone with Bluetooth into an R/C transmitter.
The app is based on the Cxem Car 1 Open Source Projekt. The app has been extended and revised to interface with a PiKoder/SSC RX receiver.
The picCar app is open source and released under a GNU General Public License Version 3. The app can be installed via the Play Store. The source code is provided through github.
The user interface of the picCAR app is pretty intuitive and straight forward. You can select one of four control modes by touching the respective screen button: button control, a virtual joystick, accelerometer (control by moving the device) and a combination between accelerometer and a slider. The Bluetooth connection would be established once the mode has been selected.
For building your receiver please refer to the PiKoder/SSC Bluetooth receiver page. The App is supported by all PiKoder/SSC firmware versions. It is recommended though that you use a PiKoder/SSC firmware 1.03 or above in order to deploy the TimeOut-Funktion of the Android app.
picCAR User’s Guide (.pdf File, EN)
The picCAR User’s Guide describes the picCAR app in detail.
Some time ago I bought a Metz remote control transmitter 191/1 on ebay. The description stated that the transmitter had been converted to a connection to 12 volts (plug for cigarette lighter).
When I looked at the transmitter a few days ago, I came across an interesting inner workings: in addition to the expected DC voltage regulator for 6 volts according to the battery voltage, a circuit board was built into the battery compartment with a relay, wire potentiometer, motor and a break contact.
After a few tests and considerations, it soon became clear that the transmitter would be clocked by the motor with an interrupter. The switching disk on the motor ensures a pulse-to-pause ratio of 1: 1 and the pulse length can be adjusted via the rotary resistance.
At first this was astonishing to me, since the remote control technology of the time worked more with tone frequencies than with pulse lengths and I tried to imagine the required receiver logic.
After doing some research, I came across the following publication in Funkschau issue 21/1965, in which the process is well explained. Apparently someone has recreated the logic of the transmitter using electromechanical means.
I am not sure whether the approach worked, as my system is quite “built-in” – the integrated voltage regulator is probably the result of a later adjustment / repair, the mechanical and soldering quality are very different, so that the attempts by several owners are assumed and the structure found will certainly not work with its current wiring. But maybe this conversion was also presented in a model making or electronics magazine? – I would be very grateful for any relevant information!
The description of the Metz system in the radio show gives a pulse duration of 5 ms. This would correspond to an engine speed of 6,000 rpm. My measurements with the oscilloscope show that the contacts are at a pulse length< = Bounce heavily for 20 ms. On the other hand, based on the receiver circuit, I can also imagine that a reliable channel differentiation is possible even with larger pulse lengths. As soon as I can get hold of a working receiver, I will check my thesis.
To be continued…
The previous blog describes the Arduino PPM encoder. Together with a multi-protocol module, you can set up a complete remote control transmitter with little additional effort.
To do this, adapt the module using an Arduino prototype shield. However, not all shields are equally suitable. Some shields do not have a hole pattern in the lower right area but a specific layout like the red circuit board in the picture. But you need a prototype board with a complete breadboard like the blue circuit board.
You make the electrical connection between the Arduino and the module with a five-pole pin header with extra-long pins. Insert the pin header into the socket header on the back of the module. Then position the module on the prototype shield and find the correct position for the module and the soldering points that you need to use.
To ensure a secure hold, I have also provided Velcro tape. Since this additional intermediate layer changes the height of the soldering pins again, you can only solder the pins now.
The wiring for the power supply and for the PPM signal can be found in the picture. The assembly is completed when the module is plugged in.
My previous blogs about connecting a joystick to a model remote control via USB have always used one of my PiKoders. But of course an Arduino can also take over the PPM signal generation.
To implement this idea I created an Arduino Sketch USB2PPM_by_Arduino (Open Source), which you can find on Github . The program implements a PPM encoder whose parameters and channel values are set via serial commands.
For example, you can switch the polarity of the output signal and select the number of PPM channels in the range from one to eight in order to adapt the encoder to your transmitter.
The PPM signal can be found on pin D8. To connect to the student input of your model remote control, you will then need a corresponding cable. It may also make sense to use an Arduino prototype shield that accepts a suitable socket to ensure a stable connection.
For the integration of the PPM encoder into your application, the definition of the commands and messages can be found in the header file protocol.h.
Additionally you will find the Joystick2PPM4Arduino app in the Microsoft Store with which you can connect a joystick or gamepad (DirectX-compatible) to your Arduino-based PPM-Encoder. The app connects to the Arduino Uno, Nano and Pro Micro.