FPGA-powered Autonomous Search and Rescue Vehicles

by pcmihnea in Circuits > Robots

9482 Views, 202 Favorites, 0 Comments

FPGA-powered Autonomous Search and Rescue Vehicles

DSC_0002.JPG
DSC_0003.JPG
DSC_0006.JPG
DSC_0005.JPG
DSC_0004.JPG
DSC_0007.JPG
DSC_0030.JPG
DSC_0031.JPG

UPDATE2: check http://www.digilentdesigncontest.com/2015-eu-contest-entries.html for the complete source-code and documentation.

UPDATE1: added a new module - a 3-axis magnetometer (digital compass). See step 2 for details.

This project represents an application for the 11-th (2015) edition of Digilent’s Design Contest, and consists of two mobile platforms. The theory behind its operation is that one of the platform performs the “search” function, whilst the other the “rescue”, as described in detail at step 2.

The first platform incorporates the following modules:

  • One Nexys4DDR FPGA board
  • One LCD screen
  • One infrared (contactless) thermometer
  • Three ultrasonic sensors
  • One RF transmitter
  • One Dual DC motors driver
  • Four logic level converters
  • Two DC motors
  • Two rotary encoders
  • One step-up switching mode power supply
  • One step-down switching mode power supply
  • One battery holder for eight 1.5V AA (R6) size batteries

The second platform consists of:

  • One electronic speed controller (ESC)
  • One RF receiver and PWM driver module
  • One Dual DC motors driver
  • Two servomotors (which power a makeshift stretcher)
  • Two DC motors
  • One step-down switching mode power supply
  • One battery holder for eight 1.5V AA (R6) size batteries

Parts

diagram1.BMP
DSC_0025.JPG
DSC_0013.JPG
10947283_818529728216839_9148540454649658246_o.jpg
DSC_0016.JPG
DSC_0014.JPG
DSC_0018.JPG
DSC_0024.JPG
DSC_0017.JPG
diagram.jpg
DSC_0023.JPG
diagram.PNG
DSC_0019.JPG
DSC_0029.JPG
DSC_0028.JPG
DSC_0021.JPG
DSC_0020.JPG
DSC_0022.JPG
diagram2.BMP
DSC_0035.JPG
DSC_0034.JPG
DSC_0032.JPG
DSC_0033.JPG
DSC_0036.JPG
DSC_0037.JPG
DSC_0038.JPG
DSC_0039.JPG
DSC_0008.JPG

1. Nexys4DDR board

The Nexys4 DDR board is development platform based on the Xilinx XC7A100T-1CSG324C Artix-7 Field Programmable Gate Array (FPGA).

Artix-7 100T features include:

  • 15,850 logic slices, each with four 6-input LUTs and 8 flip-flops
  • 4,860 Kbits of fast block RAM
  • Six clock management tiles, each phase-locked loop (PLL)
  • 240 DSP slices
  • Internal clock speeds exceeding 450 MHz
  • On-chip analog-to-digital converter (XADC)

The Nexys4 DDR offers the following ports and peripherals:

  • 16 user switches
  • 16 user LEDs
  • Two 4-digit 7-segment displays
  • USB-UART Bridge
  • Two tri-color LEDs
  • Micro SD card connector
  • 12-bit VGA output
  • PWM audio output
  • PDM microphone
  • 3-axis accelerometer
  • Temperature sensor
  • 10/100 Ethernet PHY
  • 128MiB DDR2
  • Serial Flash
  • Four Pmod ports (with 8 I/Os per port)
  • Pmod for XADC signals (with 4 differential inputs)
  • USB-JTAG port (for FPGA programming and communication)
  • USB HID Host for mice, keyboards (and memory sticks for configuration).

This board is used as the main controller in the project, centralizing the input data (from the ultrasound modules, infrared sensor, and rotary encoders) and controlling the output peripherals (LCD, motor driver, and the second platform via RF).

2. Mobile platform

Both platform were acquired as a kit, and includes the main plastic support board, two DC motors-driven wheels (with fixing brackets), a third passive wheel, and a power button (it also had a four AA-size batteries holder, but it was not used). The multi-layer structure was obtained using ordinary PCB cooper boards (due to their availability, price, and added use as a ground plane).

3. LCD screen

The HannStar Display HSD043I9W1-A is a color active matrix thin film transistor (TFT) liquid crystal display (LCD). This module is composed of a TFT LCD panel, a driving circuit and a back light system. This TFT LCD has a 4.3 (16:9) inch diagonally measured active display area with WQVGA (480 horizontal by 272 vertical pixel) resolution. RGB data is inputted via parallel 24-bit (8-bit per colour) and sync (control) signals can be either via Horizontal Sync/Vertical Sync (as used in the VGA interface), or using DataEnable/DataClock (where DataEnable is high when the horizontal and vertical display counters are in the active area, with the DataClock at 10MHz). It was salvaged from a defective GPS navigator (as noticed by its branded plastic frame), and because it had a fairly inaccessible 30-pin 0.5mm pitch flat flex cable, an adaptor board had to be built to allow the use of a more comfortable 2.54mm pitch header as a means of connection to the FPGA board.

4. Infrared thermometer

This module was also salvaged from a household-usage ear thermometer whose display cracked. The lack of any data interface documentation, combined with the chip-on-board with no markings, resulted in a need of manual protocol decoding. Thus, the following data may not be unique, nor the most efficient way to acquire temperature data, but it seems to be stable enough for this project. Through the on-board header (with the pins marked as “V D C G A”) the onboard microcontroller/ASIC seems to output a SPI-like data, with the following pinout:

  • V = 3V3 VCC,
  • D = serial data,
  • C = serial clock,
  • G = ground,
  • A = “Action”/Slave Select (tied to the thermometer’s “Measure” button).

Additionally, a fifth pin had to be soldered (as explained below) to the “Menu” button. Both this button and the “Measure” one are active low (when pressed, they pull the signal to ground).

The way the thermometer appears to work is the following:

- The device is pulled out of sleep mode by pulling “Menu” down, entering the ear measuring mode (this mode implies a very strict temperature range, 34 to 42 degrees Celsius, and a 2-second warm-up time, thus not suitable for continuous operation),

- To transit to room temperature measurement mode, both “Menu” and “Measure” have to be pulled down for a second, then released,

- Now, each time the “Measure” signal is low, ambient temperature is measured (-20 to +80 degrees Celsius), and outputted via the “D” pin, in sync with the device’s internally generated clock available on the “C” pin,

- To obtain a continuous reading, the “Measure” signal is pulled low then high at a rate of 5Hz, 50% duty cycle (tests with higher frequency and/or lower duty cycle percent proved too fast for the device’s internal button debouncing subcomponent, reading the input as a continuous press, which results in a lack of data output). After the measurement is complete, the serial data outputted is read at the clock’s falling-edge.

Each measurement cycle outputs a 40-bit serial data string, composed of the following 8-bit words:

0x5B t1t2 t3t4 checksum 0x0D

Where the 4-bit words t1, t2, t3 and t4, when converted from hex to char results in t1=tens of degrees, t2=degrees, t3=1/10 degrees, t4=1/100 degrees Celsius. Checksum is the binary sum of the first 24 bits, and 0x5B and 0x0D represents the start and ending of the data stream.

5. Ultrasonic sensor

The HC-SR04 Ultrasonic ranging module provides 2cm - 400cm non-contact measurement function, with accuracy up to 3mm. The modules includes ultrasonic transmitter, receiver and control circuit. To measure distance, the following protocol had to be implemented: “Trigger” pin is pulled high for 10us (the module sends eight 40 kHz), and after the module receives the pulses signal back, it pulls the “Echo” pin high for a set time of 1uS per 58 centimeters in measured distance.

6. RF Transmitter module

These 2.4GHz RF modules were scavenged from a remote-controlled, and follow standard 50Hz (and high time of 1 to 2 ms) PWM signals implemented in hobby-grade analog controlled motors and servomotors.

The transmitter part was cut-out from the remote control board, and traced only to three pins (3V3 VCC, GND, and DATA). The DATA pin’s protocol has been decoded, and appears to accept the following serial stream: each 20ms, a pulse train containing four high-level pulse (where each pulse corresponds to each channel on the receiver, with its duration equal with the addition of 400us to the source pulse duration), each separated

7. Dual DC motors driver

This dual bidirectional motor driver is based on the L298 Dual H-Bridge Motor Driver Integrated Circuit. The circuit allows the state and direction control of two motors of 5V to 35V, up to 2A each (25W total max). Logic is supplied at a 5V level, and includes a Enable, and two signals for motor drive polarity control (as depicted in its internal schematic). A 10Ohm, 5W power resistor limits the current sourced by the driver to about 1A, reducing the risk of pre-mature battery depletion.

8. Logic level converter

The JY-MCU is a 4-way bi-directional MOS-FET-based level converter. The low-level reference voltage is supplied by an internal 3V3 voltage regulator, which in turn is powered from the high-level reference voltage (in this case 5V).

9. Rotary Encoder

This component is a standard 24-steps per revolution passive rotary encoder, used to provide the number of full or partial rotation of the wheels, allowing a measurement and control of distance travelled on the ground by each wheel.

10. Step-up Switching mode power supply

Powered by an XLSemi XL6009 400kHz 60V 4A Boost DC-DC converter, this module supplies the required 19V voltage rail for the LCD’s LED backlight, converting from the 12V rail.

11. Step Down Switching mode power supply

Powered by an TI LM2596 150kHz 40V 3A Buck DC-DC converter, this module supplies the required 5V voltage rail for the Nexys4 board, ultrasound modules, motor driver logic and RF transmitter, converting from the 12V rail. It incorporates a 7-segment display, on which it shows the input or output voltage, or the output current (mode selectable via the button), allowing the user to also use it in constant-current mode (besides the usual constant-voltage).

12. Battery holder

This is a standard battery holder able to carry eight AA (R6) 1.5V alkaline batteries, supplying the 12V voltage rail required by the two DC-DC converters and the motor driver.

13. ESC

This is a standardized, hobby-level, microcontroller-powered, ESC (electronic speed controller) that convert two 50Hz PWM signals (correspondent to throttle and direction) into the six signals necessary for the motor driver. It allows us to interface the simple L298 H-bridge to the RF receiver.

14. RF Receiver

This receiver converts the signal received into four separate channels, implementing the 50Hz, 1 to 2ms high time PWM.

15. Servomotor

This PWM-commanded motor incorporates an analog feedback circuit in order to maintain its position even under load, and is 100% compatible and designed for the type of RF receiver/controller that is used in this project. It allow to modify the angle of the make-shift stretcher in order to pick-up the “victim”.

16. Step-down Switching mode power supply

Similar to the buck converter used on the other platform, it also uses the same LM2596 voltage regulator, but does not include a current/voltage display, nor current limiting capability.

NEW: 17. Magnetometer

In order to eliminate mechanical drift while the first platform moves forward or backward, and also enable precise measurement and control of angle of rotation while the platform turn left, right or 180 degrees, an HMC5883L 3-axis magnetometer (or digital compass) was integrated in the design. By measuring the magnetic field strength on the X and Y axis, and applying an arctan2() operation (also known as arctan(x/y)), a magnetic north heading can be calculated.

Theory of Operation

The first platform (main platform) with all modules will autonomously traverse (the “search” phase) an area randomly riddled with obstacles in search of the target (“victim” – a hands warmer). Once the target has been found (using the IR thermometer), the most efficient/shortest/direct route back to the starting point will be calculated and then traversed by the second platform, without any sensory aid. Once it too will reach the target, it will pick-up the target, (the “rescue” phase).

See http://www.digilentdesigncontest.com/2015-eu-contest-entries.html for the complete source-code and documentation!