Although the servo output of an RC receiver provides all the information required to control an L298N motor driver, the signal must be evaluated and recoded in a suitable manner , as the control logic of the motor driver is fundamentally different to that of an RC servo.
This task can be performed by the RCRX2Bridge module. This is a single-chip solution that evaluates one channel at a time and thus controls one motor of the L296 bridge. The circuit is very simple and the module is quick to assemble with the breakout board.
RCRX2Bridge supports the two common, but different control modes of L298N bridges: Models with 2/4 phases and models with two logic inputs and one speed input.
Control of bridges with two inputs
The RCRX2Bridge module is connected to the receiver on the input side, as shown in the picture. The input pins of the motor driver IN1 and IN2 are connected to the output pins of the breakout board as shown in the picture. If a second motor is to be controlled, a second RCRX2Bridge module is required.
Control of bridges with three inputs
For this application, the RCRX2Bridge module is configured for the changed logic using a solder bridge at “MODE” and then also connected to the receiver on the input side in this case, as shown in the article image.
The input pins of the motor driver ENA, IN1 and IN2 are connected to the output pins of the breakout board as shown in the picture. If a second motor is to be controlled, a second RCRX2Bridge module is also required here.
The kit for the breakout board with the RCRX2Bridge controller is available in the store.
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.
In the field of robotics, there is more often the need to control several servos, e.g. when realizing a robot arm. In this case, operation with a gamepad or joystick is ideal because the large number of axes / degrees of freedom enables efficient control of many channels.
This blog describes the setup to use the free Windows APP JoystickRC to control eight servos wired, e.g. for a robot arm.
The mapping of the axes and switches to the servo channels is done flexibly in the software. The actual pulse generation for the servos is done by a PiKoder Serial Servo Controller (PiKoder/SSC), which is connected to the PC via a USB adapter.
The setup is ideally done with the help of a PiKoder/SSC –development board and with a standard USB adapter. The PiKoder is supplied with power via the USB cable. Since the USB interface cannot supply enough power to control the servos, they must be supplied with an independent voltage source via the terminal strip. In order to prevent balancing currents that could damage the PC, the jumper must not be plugged into the PiKoder circuit board under any circumstances. More detailed information can be found in the PiKoder User Manual.
Connecting the USB cable to the PiKoder/SSC development board – please note that the jumper must not be plugged in.
Connecting the USB cable to the PiKoder/SSC development board – please note that the jumper must not be plugged in.
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:
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.
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 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.
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.