Raspberry Pi Electronics and Test Remote Controls


1Remote Controls

Up to this point “OrangeBot” has been built to have four motor blocks controlled in open loop by the proto board.
The scope of this week's upgrade is to move closer to the MVP by achieving
remote controls. This requires:
  • Serial communication and platform control messages
  • RaspberryPi powered and connected to the proto board
  • Raspberry Pi Remote Control OS Image


2Raspberry Pi

The architecture of the platform calls for a dual channel 5V3A power supply in which one of the channel is dedicated to the Raspberry Pi.
Currently, the TSP55386 evaluation board provides a 5V and a 3.3V channel, so the board needs to be modified to output two 5V channels like in the final configuration.

2.1Modify TPS55386 Evaluation Board

Starting from the schematics it can be seen that only one resistor needs to be upgraded. I skip modifying the compensation network.
Illustration 1 - TPS55386 Evaluation Board Schematics
There are several ways to do that. Either modify R10, or R12 or both.
Modifying R10 to the E12 resistor 3.9KOhm lead to a nice output voltage of 4.95V A bit on the low side but shouldn't be a problem since it's injected after the protections of the RPI saving some voltage drop there.


Upgrade is done by picking a 3.9KOhm resistor from a donor board and replacing R10.
Illustration 2 - Replace R10
With the resistor changed, a power test is conducted to verify the output of the regulator.
Illustration 3 - Test 5V output


2.2Raspberry Pi Adapter Connector

With the regulator taken care of, next step is to carry power and data to and from the GPIO.
Since hooking up to an RPI is an increasingly common task for me, an adapter was made to provide access to the power pins, the serial port and a generic GPIO pin for good measure that can be used to reset the proto board.
A switch has been added as well, to power up and down the RPI easily from the adapter.
Illustration 4 - RPI Adapter



2.3Raspberry Pi Power Test

A power test was conducted to verify that the RPI was powered correctly. The RPI adapter was then filled with hot glue to improve reliability. A label was added on top of the glue as cover and legend.
Illustration 5 - RPI Power Test



3Remote Controls

With the electronics of the RPI operational, next step was to flash a SD card with the OS image of the Remote Control stack developed for “Maze Runner” and “Seeker Of Ways - B”.
This >>>page<<< details the building of the OS Image.
Two actions were required to adapt the image to “OrangeBot”
  1. Change IP address
  2. Rename the host

3.1Change IP address

The starting image was in a different IP subnet mask that my home network. One option was to temporary connect a PC with the correct subnet to the RPI directly using a direct Ethernet cable, but because of laziness a screen and keyboard were plugged in to make the change directly rather than remotely.
Illustration 6 - RPI Power Test
New address is 192.168.1.4



3.2Change Host Name

Host name of the OS image was changed to the robot name: “OrangeBot”.
Illustration 7 - Host Name



4Serial Interface

With the Raspberry Pi fully operational, next step was to write the firmware for the UART interface between the proto board and the RPI and to complete the wirings.
Illustration 8 - Full Wirings



4.1Test Physical Interface

The firmware enables bidirectional communication at 256Kb/s. The AT4809 allows for a much more precise baud rate than the AT644 used previously. UART3 peripheral was allocated to the RPI communication channel.

>>>Serial interface NODE.JS application<<<

With the firmware written, waveforms were checked on both the RPI TX and AT4809 TX. The RPI was running test_serial.js, the same program used in the previous robots to test the serial interface.
Illustration 9 - Serial Waveforms


4.2Motor Parser Commands

With the serial interface up and running, next step was to add the >>>Uniparser V4<<< library and write commands to allow the RPI to control the motors in open loop.

>>>Ping command NODE.JS test application<<<

>>>Motor command NODE.JS test application<<<

Video 1 - Test Motor Messages
Currently implemented commands are:
  • “P” - Ping: Reset communication Timeout
  • “F” - Find: Return the signature of the board
  • "M%SPWM%S" - Motor: Set PWM of an individual motor
  • "PWMR%SL%S" - PWM: Set PWM of platform. Forward/Turn rate.


5Remote Controls

An upgrade was required to the firmware before proceeding with the full remote control test. A slew rate limiter was added to the firmware to protect the driver from sudden direction reversal.

>>>AT4809 Remote Control firmware repository on GitHub<<<

>>>NODE.JS Remote Control Software Stack<<<

With the upgrade in place, the remote control NODE.JS application could finally be tested.

Video 2 - Remote Control Full Test
Currently Implemented Features:
  • Parser Commands
  • Communication Timeout
  • Open loop PWM controls

5.1Roaming

As a final step, the electronic was mounted on a cardboard support and on the platform to let “OrangeBot” roam for the first time under remote controls from a web browser.
Illustration 10 - Pack Electronics
Illustration 11 - OrangeBot Assembled

Video 3 - OrangeBot Roams
In this test, driver operates in open loop limited to about 20% of PWM at 12V. This prevents the platform from turning because of the grip of the wheels.
In this test, “OrangeBot” is tethered with a 12V5A cable and an Ethernet cable.


6Conclusions

The Remote Control MVP was a complete success, resulting in “OrangeBot” roaming for the first time. Speed and power performance are amazing as expected. Platform responds immediately to button presses and acceleration/speed look very promising.
There are two major drawbacks that needs to be addressed next:
  • Wheel mounting is fiddly and unreliable
  • Open loop motor controls are not up to the tasks ahead of “OrangeBot”
A number of upgrades are required to proceed further and achieve an MVP that is PiWars worthy:
  • Mechanics: Upgrade wheel mounting on the Hub
  • Electronics: Wire the four quadrature encoders to the proto board. Wire all encoder connections on the back of the proto board.
  • Firmware: Write a quad channel encoder acquisition module. Add a quad PID speed controller
After the MVP is achieved, a number of upgrades are needed to get closer to the expected performance of the platform:
  • Mechanics: Structure with suspensions
  • Electronics: Design a custom PCB to collect all the electronics
  • Firmware: Twin loop current/speed PID controller
  • Software: Raspicam streaming module





No comments: