-
Notifications
You must be signed in to change notification settings - Fork 4
Components and Assembly
This page will take you through the different components required to build DeepNNCar for autonomous driving.
The material used for building DeepNNCar is shown in table below.
| Component | Quantity | Cost ($) |
|---|---|---|
| Traxxas Slash 2WD 1/10 Scale SCT Titan 12T Motor | 1 | 205.99 |
| 3000 mAh/8.4 V Nimh Traxxas battery | 1 | 34.95 |
| Raspberry Pi 3 | 1 | 49.99 |
| 16 GB micro-SD card | 1 | 23.99 |
| 20000mAh portable power supply | 1 | 29.99 |
| Xbox One Controller (Wireless) | 1 | 47.99 |
| 8 GB USB Flash Drive | 1 | 5.99 |
| Creative USB Camera (30 FPS) | 1 | 19.99 |
| Fish eye camera lens | 1 | 5.98 |
| 100 microFarad capacitor | 1 | 0.64 |
| 0.1 microFarad ceramic capacitor | 1 | 0.09 |
| L4940V5 voltage regulator | 1 | 1.51 |
| Slot Type IR Optocoupler Speed Sensor Module LM393 | 1 | 5.49 |
You will require a mini breadboard and some male and female jumper wires (cost ~10$).
These components are required to perform both manual and autonomous driving using DeepNNCar. The complete Bill of material can be found at https://docs.google.com/spreadsheets/d/1azQ_Xp9dUmQdm99CKqNXR3qQcVDEEUmMNGrfDghjG6c/edit?usp=sharing
Setting up laptop/Desktop:
In addition to the components for DeepNNCar, you will also need a laptop/desktop with windows, and a virtual machine (VM) installation with Ubuntu 18.04. This device serves two purpose (1) to configure the RPi3 you will need a monitor, keyboard and mouse along with an HDMI cable, (2) it is used to display real-time statistics of the car. Installation of required software packages will be discussed in the future sections.
DeepNNCar is built upon the chassis of Traxxas Slash 2WD 1/10 Scale RC car. The RC car has two onboard motors, a servomotor for steering control and a Titan 12T 550 motor for motive force, which are powered by an 8.4volts NiMH battery which connects to the Traxxas XL5 Electronic Speed Control (ESC) unit which allows high current handling. The RC controller communicates to the TQ Top Qualifier 2.4 GHz receiver, which controls the two motors via PWM. The chassis and components of Traxxas slash are shown in the figure below.
The Electronic Speed Controller (ESC) allows voltage isolation and high current handling to separate the Titan 12T 550 motor voltage requirements from the rest of the system's requirements (5V) including that of the steering servos. The TQ Top Qualifier 2.4 GHz receiver is a Pulse Width Modulation (PWM) controller that translates the radio signals into digital steering and acceleration controls.
We have rewired the components onboard the car to be controlled by RPi3, and we have decoupled the receiver connections and the antenna, so we cannot control the RC car with the transmitter. The speed and steering control wiring is connected to the GPIO of RPi3, which reserves two GPIO pins to generate Pulse Width Modulation (PWM) signals that are used to control the motors of the car. For the servomotor, a duty cycle range of (10,20) corresponds to a continuous steering angle of (-30\textdegree,30\textdegree) and for the Titan 12T 550 motor, we operate within the PWM range of (15,15.8) which corresponds to a vehicle speed range of (0,1) m/s approximately.
Rewiring DeepNNCar
The rewiring of the radio system is shown in the figure below. The integrity of the original system, by in large, is maintained. The biggest difference between the original circuit schematic and DeepNNCar is the inclusion of the RPi3 and its peripherals (camera, slot-type IR speed sensor, and USB drive). The RPi3 functionally replaces the TQ Top Qualifier RC Receiver that previously generated PWM controls for the two onboard motors, although the TQ Top Qualifier's channels are still used for connection points. In addition, a voltage regulator and two parallel capacitors are used to isolate the steering servos and dampen the noise produced by the two motors. The schematic of the connections on the car are shown in the figure below:
The actual wiring on DeepNNCar with labels are shown in the figure below. As seen the RPi3 is mounted on the top of the battery compartment, and it is powered by a portable power supply (not seen) at the rear bumper. The circuit isolating the steering servos is also shown in the figure. The IR Optocoupler is powered by RPi3, and it is also wired to GPIO21 which collects the digital output from the sensor for the RPM measurement, which is then used for speed calculation.
USB powered Webcamera and IR Opto-coupler are the two sensors used to drive the DeepNNCar.
Camera
Creative Live! Cam Sync HD 720P Webcam is the USB powered (from RPi3) camera which is mounted in front of the car to collect images of the front view, especially the track. The lens of this camera is fitted with a fish eye lens to get a wider field of view. The camera captures images at 30 FPS with a resolution of 320x240x3 (320x240 RGB pixels).
IR Opto-Coupler speed sensor
This sensor is used to measure the RPM of the car, once the wheel finishes a rotation, the sensor which is connected to the RPi GPIO21 raises an interrupt whenever one complete rotation of the wheel is complete. From this, we can calculate the time taken between two interrupts using the time library (python). The callback function for the speed calculation is discussed in the PinController.py script.
The setup of this sensor is shown in the figure below. The opto-coupler is attached close to the rear wheel, and we have a protruding piece of plastic, which cuts the opto-coupler slot. Once the plastic piece cuts the opto-coupler slot, the digital pulse is sent to the GPIO which uses the callback function to calculate the time for speed calculation.