RC with your web browser – more intuitive and more agile

In previous blogs related to RC with a web browser I presented solutions which were suited for simple and none time critical applications due to the user interface and the system response time.

The initial concept of a button based user control was relatively slow because the web page had to be re-transmitted and rebuild on the client side after each user interaction.

The improved “joystick”-based interface was already deploying AJAX to improve the system agility. However, in order to initiate a command you would have to touch the screen and to stop the movement you would have to touch the screen at another location which is not very intuitive. You would probably expect a movement to last as long as you touch the screen.

The latest version of httpRC presented here does address both requirements based on a button based UI: a command is executed only as long as you touch it in a very agile way.

The source code for the ESP8266-01 is provided through github and the programming itself can be done via the programming adapter described earlier.

Additional information regarding the receiver kit you would find on the respective PiKoder page.

Joystick controls eight servos

Overview

In the field of robotics, there is more often the need to control several servos, e.g. when realizing a robot arm. A joystick is a suitable control element, because the variety of axes / degrees of freedom allows efficient control over many channels.

This article introduces a PC-based solution for controlling up to eight servos with a joystick. The mapping of the joystick channels and switches on the servo channels is done flexibly in the configuration interface of the software. The actual pulse generation for the servos is carried out by a PiKoder Serial Servo Controller connected to the PC via a USB interface. With a PiKoder/SSC a control accuracy of 1 microsecond can be achieved; for a higher accuracy (up to 0.2 microseconds), a PiKoder/SSC-HP can be used.

Setup

The setup is ideally done with the help of a PiKoder/SSC evaluation board or – as shown in the picture – with the PiKoder/SSC-HP evaluation board and with a standard USB adapter.

The PiKoder is supplied with power via the USB cable. Since the USB interface cannot provide enough power for the servos, those must be feed with an independent voltage source via the respective header. 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. Further information can be found in the User Manual of the PiKoder/SSC and PiKoder/SSC-HP.

Connection of the USB cable to the PiKoder/SSC-HP Evaluation Board – please note that the jumper must not be plugged in

Software

The Joystick2SSC program is open source (Java) and can be found on github, the directly executable program with all required modules can be downloaded here as a .zip file.

All files are extracted and copied to the destination directory; an installation of the program is not required. The program starts by double-clicking start.x86.bat (in a 32-bit system) or start.x64.bat in a 64-bit system.

After the software is started, the main screen appears.

Main screen Joystick2SSC

To configure the servo channels, select the tab labeling your connected joystick.

Assignment of joystick channels / switches to servo channels

Here you can now make the necessary settings. Then return to the start screen and connect to the PiKoder/SSC via Connect. The bars on the right side of the screen allow you to track the positioning and output values of each channel.

Control RC models with a joystick

Overview

Already in the previous blog the possibility to control up to eight servos via a USB interface with a joystick, a PC and a PiKoder/SSC was described. Here we describe how to realize a wireless model remote control with a PiKoder receiver, the PiKoder/SSC RX. Bluetooth for command transmission.

Building

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 “Connect” selection, pairing is done at the 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 Joystick2SSC program can now be started as described in the previous post. Please note that you need a program version 1.1.0; in the original version, the Bluetooth virtual interfaces were not supported.

Radio control with your webbrowser

If your rc model would offer an access point and run a webserver, then you could control your model with a webbrowser running on your smartphone – no matter whether this is a Windows or Android device or an iPhone.

The PiKoder/SSC wRX (see below) is well suited as a hardware platform for this concept: the ESP8266-01 offers the access point and runs the webserver, the PiKoder/SSC manages all realtime aspects of controlling the servos and the electronic speed control.

pikoder_ssc_wrx-catalogue-image-png

PiKoder/SSC wRX

The standard configuration of the PiKoder/SSC wRX requires the ESP8266-01 to act as a transparent bridge. Since we will be needing a webserver, we would have to flash this wifi controller with a new firmware. This can be easily accomplished by using the latest Arduino IDE which is supporting generic ESP8266 modules.

The new controller firmware is open source and would be available through the github repository makerprojects/httpRC. After downloading open the sketch in the Arduino IDE. At the beginning of the source code you will find the settings recommended for compiling the program. [Update December 27, 2018: The httpRC sketch has been completely revised and updated. Please check this blog for more details.]

In order to flash the ESP8266-01 you will need an USB-Serial converter, since the wifi module does not feature a USB port. Please keep in mind also, that the ESP8266 requires a supply voltage of 3,3 Volts – the board is not 5 V tolerant! The offering of USB-Serial converter offering a 3,3 Volt supply as well as 3,3 Volt signal level is limited; therefore it might be easier to use a converter with 5 V supply and 3,3 V signal level such as the PL2303TA readily available at ebay (shown below) and build your own converter from 5 V to 3,3 V.

usb-connector-ebay

USB-Serial connector

Since you would need a “reset” and “program” button for flashing the module you might consider to construct the little adapter shown below using a prototype board.

programmieradapter-esp8266

Programming adapter for the ESP8266-01

The schematic for the programming is shown below.

esp8266_flash_prog_board_sch

The conversion of the 5 V provided by the USB-Serial adapter to 3,3 V follows the design of the PiKoder/SSC wRX and requires a standard low drop voltage controller LF 33 CV ( please refer to the following excerpt of the PiKoder/SSC wRX schematic; the 5 V input would be to the left, the output is to the right).

spannungsanpassung

Unfortunately the flashing of the ESP8266 does not start automatically as you might be used to when downloading a program into your Arduino but has to be initiated manually. You would push the RST and PROG button simultaneously and release the RST button while still holding the PROG button. After releasing the PROG button, the module would be in flash mode. Now you would start uploading the program. Now you would start uploading the program. Once the upload is complete your controller would require another reset prior to being operational. Once the upload is complete your controller would require another reset prior to being operational.