(Short clip of driving outdoors)


Overview

As before, this project is about making a "drone-like" model car which gives the operator a video feed, some telemetry, and which communicates with a single digital radio. At the heart of it is a Raspberry Pi 3. It deals with messaging through the Wifi interface, controlling servos, and communicating with the motor controller, to name the most important tasks.

Hardware configuration

Illustrated in the following diagram.


Red represents power supply, black lines data flow, and yellowish major components. The box labeled Custom "Shield" is a circuit board which sits on the 40 pin header of the Pi and bears the indicated components. Besides the obvious, there is a status LED which blinks differently depending on the state of the operating system - shut down, rc car processes running, or processes not running. The "shutdown" button triggers shutdown of the OS, as the name implies. With IMU I refer to a AltIMU-10 v4 board from Pololu. I added it for the possibility to present the heading, or some sort of attitude indicator to the user.

Software

The next diagram shows the processes running on the Pi.

There is a central Python script, here named Control Process, which handles messaging and servo control. You read that right, Python. However, the speed with which it could be developed made it worthwhile to write rather than going straight for a C++ implementation. Fortunately it runs fast enough.

RX and TX refer to the processes pertaining to  the wifibroadcast software. They use stdin/stdout to exchange data. However, I find it convenient to launch them independently of the other processes. Other processes should just be able to connect to them when both parts are available. I enabled this by connecting RX/TX to socat which opens sockets other processes can connect to.

Raspivid, on the other hand, streams directly through stdout/stdin to TX since this part of the system is very simple and stable - at least from my user perspective. So no need to control these two independently.

All the processes are managed by systemd - much like in the basic wifibroadcast project. There is a service file for each of them. A custom .target file helps to bring everything up automatically in a well defined order.

(Code is on GitHub, if you dare to look)


Details on essential and/or changed components follow.

Drive train

The main goal after completing the last iteration of the vehicle was the incorporation of a new drive system. There are several reasons for this, namely: 

  • BLDC motors are considered better than brushed variants. Higher efficiency, less wear, for instance. So it would be nice to be state of the art.
  • They can come with integrated position encoders. This is useful again for several reasons. For one because speed measurement and control is desired. My attempts to retrofit the motor I already had largely failed. Also the motor has to fit the chassis and BLDC motors designed for toy cars do.
  • I'm interested in power electronics and embedded programming. Therefore I wanted to attempt to design a custom motor driver.

The controller got a project site of its own. I refer there for details.

Power distribution

The car is powered by a single 12 V battery. The motor controller has a small linear regulator to supply its micro controller. In contrast to before, the board on top of the Raspberry Pi now carries a regulator for the Pi and one for the servos. I employ identical cheap switch mode buck converter boards with 3 A output bought from Ebay. My design has two of them because a 2 A supply is recommended for the Pi and the servos can draw significant current, too. In particular...

Read more »