Unmanned Ground Vehicle (UGV)

 

 

Tech Stack

Mechanical

Electronics

Software

Development Environment

Fusion 360

Raspberry Pi 4 Model B

Python 3.11.2

Visual Studio (VS) Code

Boss Laser LS-1630

L298N Motor Driver

Lightburn

VS Code Remote-SSH Extension

Bambu Lab A1 3D Printer

ESP32 UWB Pro with DW1000

Bambu Studio

Windows Subsystem for Linux (WSL)

DC Motors

MaUWB STM32 AOA

 

Linux: Debian

SG90 Servo Motors

 

 

GitHub

 

 

Budget

Item

Vendor

Unit Price

Qty.

Units

TOTAL

Details

Notes

Acrylic Sheet 10" H x 8" W x 0.11" D

Hobby Lobby

$3.99

3

count

$11.97

Platform Panels, Peripheral Mounting Plates, Laser Cut

MFD FX Maker Space

#10-24 x 2-1/2" SS Pan Philips Machine Screw

Ace Hardware

$1.00

4

count

$4.00

Platform Panel Standoffs

#10/24 Nylon Cap (Acorn) Nut

Ace Hardware

$1.09

4

count

$4.36

Platform Panel Standoffs

5/16" X 2" Tension Pin 300 Series

Ace Hardware

$1.69

4

count

$6.76

Platform Panel Standoffs

Breadboards and Jumpers Kit

Amazon

$9.99

1

count

$9.99

Peripheral Wiring

L298N Motor Driver, 2 DC TT Motors/Wheels

Amazon

$7.99

1

Count

$7.99

Motor and Wheel Assemblies, Motor Driver Combo Kit

 

3D Print Drive Motor and RasPi Mounts

OCLS Melrose Ctr.

$0.05

30

grams

$1.50

Drive Motors and Raspberry Pi Mounts

MFD OCLS Melrose Ctr.

#10-24 x 1/2" Screw

Ace Hardware

$0.60

8

count

$4.80

Fasten RasPi Block and Motor Mount Blocks to Platform

#10-24 Nylon Hex Nut

Ace Hardware

$0.45

8

count

$3.60

Fasten RasPi Block and Motor Mount Blocks to Platform

M3 x 30mm Screw

Ace Hardware

$0.60

4

count

$2.40

Fasten Motor to Motor Mount Block

M3 Washer

Ace Hardware

$0.55

4

count

$2.20

M3 Screw to Motor Mount Block (between screw head and motor mount outer face)

M3 Hex Nut

Ace Hardware

$0.45

8

count

$3.60

Fasten Motor to Motor Mount Block (one on either side of motor, per fastener)

#10-24 x 3/8" SS Pan Philips Machine Screw

Ace Hardware

$0.40

2

count

$0.80

Fasten Caster Mount to Platform

#10-24 Nylon Hex Nut

Ace Hardware

$0.45

2

count

$0.90

Fasten Caster Mount to Platform

#10-24 x 1/2" Screw

Ace Hardware

$0.60

2

count

$1.20

Fasten L298N Motor Driver Mount to Platform

#10-24 Nylon Hex Nut

Ace Hardware

$0.45

2

count

$0.90

Fasten L298N Motor Driver Mount to Platform

M3 x 10mm Standoff

Amazon

4

count

Fasten L298N Motor Driver to Mount

Standoffs Kit

M3 x 6mm Screw

Amazon

4

count

Fasten L298N Motor Driver to Mount

Standoffs Kit

M3 Hex Nut

Amazon

4

count

Fasten L298N Motor Driver to Mount

Standoffs Kit

Self Adhesive Caster Wheel

Amazon

$0.75

1

count

$0.75

Purchased in a pack of 8 for $5.99

Caster Wheels

ESP32 UWB Pro with Display with DW1000

Makerfabs

$54.80

2

count

$109.60

Localization module – need 4 modules total for trilateration (1 tag, 3 anchors)

 

3D Print SG90 Servo Motor Mount

OCLS Melrose Ctr.

$0.05

2

grams

$0.10

SG90 Servo Motor Mount

MFD OCLS Melrose Ctr.

#10-24 x 3/8" SS Pan Philips Machine Screw

Ace Hardware

$0.40

2

count

$0.80

Fasten SG90 Servo Motor Mount to Platform

 

#10-24 Nylon Hex Nut

Ace Hardware

$0.45

2

count

$0.90

Fasten SG90 Servo Motor Mount to Platform

 

M2 x 5 + 3mm Standoff

Amazon

 

2

count

 

Fasten SG90 Servo Motor to Mount

Standoffs Kit

M2 x 3mm Screw

Amazon

 

2

count

 

Fasten SG90 Servo Motor to Mount

Standoffs Kit

M2 Hex Nut

Amazon

 

2

count

 

Fasten SG90 Servo Motor to Mount

Standoffs Kit

#10-24 x 3/8" SS Pan Philips Machine Screw

Ace Hardware

$0.40

2

count

$0.80

Fasten Breadboard Mount to Platform

 

#10-24 Nylon Hex Nut

Ace Hardware

$0.45

2

count

$0.90

Fasten Breadboard Mount to Platform

 

3D Print 6V Battery Mount

OCLS Melrose Ctr.

$0.05

19

grams

$0.95

6V Battery Mount

MFD OCLS Melrose Ctr.

#10-24 x 3/8" SS Pan Philips Machine Screw

Ace Hardware

$0.40

2

count

$0.80

Fasten Battery Mount to Platform

 

#10-24 Nylon Hex Nut

Ace Hardware

$0.45

2

count

$0.90

Fasten Battery Mount to Platform

 

2/4/6/8 x 1.5V AA Battery Holder

Amazon

$8.90

1

count

$8.90

 

Battery Holder

Crimp Pin Connector Kit (Pins, Housings)

Amazon

$9.99

1

count

$9.99

Miscellaneous wire work

Connector Kit

Polyolefin Heat Shrink Tube 1/8” (3.2mm)

Ace Hardware

$3.59

1

count

$3.59

Pack of 7; Miscellaneous wire work

 

 

 

Technical Drawings

 

Mobile Platform Base

·         The platform bases are designed like a pegboard to make the UGV more modular, and they’re manufactured from acrylic using a laser cutter

o   This design facilitates designing and fastening peripheral mounts/attachments and flexibly position them as needed

o   The platform bases are manufactured from acrylic for the material’s low conductivity and ability to withstand heat, thereby reducing unintended influence on electronic components

o   Laser cutting the design onto an acrylic sheet allowed for consistent and accurate cuts

·         Laser Cut at Maker FX Maker Space on Boss Laser LS-1630

 

Raspberry Pi 4 Model B Mounting Block

A grey square object with holes

AI-generated content may be incorrect.

·         3D Printed at Orange County Library – Melrose Center Maker Space on Bambu Lab A1 printer

 

Breadboard Mounting Plate

·         Breadboard dimensions: 3.25” X 2.125”

·         Breadboard comes with adhesive sheet to adhere to mounting plate

·         Laser Cut at Maker FX Maker Space on Boss Laser LS-1630

 

6V Battery Mounting Block

·         Rev A:

o   Fastener head clearance too tight

o   It is difficult to remove battery box from mounting block without flipping upside down

§  Needs space to fully grip battery box for removal from mounting block

·         3D Printed at Orange County Library – Melrose Center Maker Space on Bambu Lab A1 printer

 

DC ‘TT’ Motor

A yellow and white mechanical device

AI-generated content may be incorrect.

A diagram of a mobile platform

AI-generated content may be incorrect.

·         DC ‘TT’ Motor assembly file from GrabCAD, as indicated in drawing notes

·         Technical drawing by me

 

DC ‘TT’ Motor Mounting Block

·         Only the right drive motor mount was modeled, so the model was mirrored in the Bambu Studio slicing software when 3D printed to produce the left drive motor mount

·         3D Printed at Orange County Library – Melrose Center Maker Space on Bambu Lab A1 printer

 

L298N Mounting Plate

·         Laser Cut at Maker FX Maker Space on Boss Laser LS-1630

 

SG90 Servo Motor Mounting Block

·         Rev A

o   The mounting block is designed to fasten to the servo motor via two M2.5x5+6mm standoffs, so the print will be 5mm too short for a motor to sit directly in the saddle without standoffs

·         Rev B

o   Added missing width dimension in drawing

o   Taller standoff supports clearing fastener heads and motor wires’ bend radius

o   Narrower standoff supports improving servo fit in mount saddle

o   Standoff support thread holes’ diameter increased from 2.1mm to 2.2mm

o   Use M2x5+3mm standoffs to fasten servo motor to mount

·         3D Printed at Orange County Library – Melrose Center Maker Space on Bambu Lab A1 printer

 

 

Pictures of Manufactured and Assembled UGV

A small yellow and blue vehicle with wheels and wires

AI-generated content may be incorrect.

A yellow wheel on a blue and black vehicle

AI-generated content may be incorrect.

A yellow wheel on a blue vehicle

AI-generated content may be incorrect.

 

 

Mechanical

 

DC Gear Box Motor – DC ‘TT’ Motor

 

Technical Specifications

DC Voltage

3V

4.5V

6V

Current

150mA

155mA

160mA

Gear Ratio

1:48

1:48

1:48

Minimum Operating Speed

90RPM +/- 10%

-

200RPM +/- 10%

Stall Torque

0.4kg-cm

-

0.8kg.cm

 

 

·         Voltage à Speed

·         Current à Torque

 

·         Gear Ratio: Motor shaft turns 48 times for every 1 turn of the output shaft (wheel)

 

·         Stall Torque: Maximum rotational force a motor can produce when the shaft is prevented from turning, resulting in zero rotational speed

o   When a motor is at stall torque, it draws maximum current which can lead to overhearing and damage if stalled for too long

o   Stall current can be measured by connecting an ammeter in series with the motor, physically fixing the motor shaft to prevent it from turning, and applying voltage to the motor.  The ammeter reading when the motor is physically stalled is the stall current.

 

·         Constant Voltage: Torque is inversely proportional to Rotational Speed

o   Stall torque occurs when rotational speed = 0, so where the torque-speed curve intersects the y-axis

o   Zero-torque occurs when rotational speed = maximum, also known as the no-load speed

torque equation

 

 

 

·         Determine the motor’s torque and a given speed using the equation of a line to define the torque-speed curve

 

 

 

SG90 Servo Motor

 

Servo Motor Pinout

Source: Circuit Geeks

 

·         Position-controlled motor that can be useful to precisely control the position of robotics

·      Rotation range:

o   No continuous motor movement

 

·         Disadvantages:

o   Slower movements

o   Lower output power than other motor types

 

Source: Circuit Geeks

 

·         Components:

o   DC Motor

o   Gearbox: Reduce speed and increase torque; drives position of the output shaft, measured in degrees

o   Potentiometer: Monitor the position of the output shaft and deliver position feedback

o   Control Circuit: Interprets the input signal to determine the position of the arm and how much movement is required

 

Servo Motor Closed Loop System

Source: Circuit Geeks

 

·         Consists of 3 wires (wire colors may vary by motor):

o   VCC (5V): Supplies electric current to motor

§  Know how much power the use-case requires to know how much power / current it will need to pull from its power source

·         Different motors and use-cases will have different requirements depending on the size and workload

§  Power supply rating should be greater than the stall current of the servo, per servo connected to the power supply

·     

·         Consider the PCA9685 for controlling multiple servo motors with one microcontroller

o   GND

o     Signal (PWM): Delivers control signal to motor (degrees, )

 

·         Servo motors are driven by indicating the angle at which the output shaft should be positioned, expressed in degrees

o   Signal delivered as PWM

§  Pulse width determines servo arm position

Servo Motor Control Signal

Source: Circuit Geeks

 

 

Electrical / Electronics

 

Raspberry Pi 4 Model B

Raspberry Pi hardware - Raspberry Pi Documentation

Pin Number

Pin Description

Pin Assignment

Pin Number

Pin Description

Pin Assignment

1

3V3 POWER

ESP32 UWB DW1000

2

5V POWER

L298N POWER IN 5V

3

GPIO 2 (SDA)

4

5V POWER

Object Detection Servo 5V

5

GPIO 3 (SCL)

6

GND

L298N GND

7

GPIO 4 (GPCLK0)

8

GPIO 14 (TXD)

9

GND

10

GPIO 15 (RXD)

11

GPIO 17

L298N MOTOR B IN1 (RIGHT)

12

GPIO 18 (PCM_CLK)

13

GPIO 27

L298N MOTOR B IN2 (RIGHT)

14

GND

15

GPIO 22

L298N MOTOR B EN (RIGHT)

16

GPIO 23

L298N MOTOR A IN1 (LEFT)

17

3V3 POWER

18

GPIO 24

L298N MOTOR A IN2 (LEFT)

19

GPIO 10 (MOSI)

ESP32 UWB DW1000

20

GND

21

GPIO 9 (MISO)

ESP32 UWB DW1000

22

GPIO 25

L298N MOTOR A EN (LEFT)

23

GPIO 11 (SCLK)

ESP32 UWB DW1000

24

GPIO 8 (CE0)

ESP32 UWB DW1000 (CS)

25

GND

26

GPIO 7 (CE1)

27

GPIO 0 (ID_SD)

28

GPIO 1 (ID_SC)

29

GPIO 5

30

GND

31

GPIO 6

32

GPIO 12 (PWM0)

Object Detection Servo Signal

33

GPIO 13 (PWM1)

34

GND

Object Detection Servo GND

35

GPIO 19 (PCM_FS)

36

GPIO 16

37

GPIO 26

38

GPIO 20 (PCM_DIN)

39

GND

40

GPIO 21 (PCM_DOUT)

 

 

L298N Motor Driver

·         The DC motors are rated for a voltage that exceeds what a microcontroller outputs

·         A motor driver provides the motors with an external power source that meets the motor’s specifications but receives logic signals from the connected microcontroller

·         The L298N microcontroller has H-bridge and Pulse Width Modulation (PWM) capability, controlling the motor’s output effort (i.e. rotation speed) and direction

A red and blue circuit board with green text

AI-generated content may be incorrect.

Pin Label

Pin Description

Pin Notes

Output A

DC Motor A

DC Motor Leads

Output B

DC Motor B

DC Motor Leads

12V Input

Motor Power Source (+) up to 12V input

 

GND

Motor Power Source (-) / Microcontroller Ground

 

5V Input

5V from Microcontroller Pin for Driver Logic

 

Channel-A Enable

PWM: DC Motor A

1 pin on channel for duty cycle % (float between 0 and 1)

Channel-A IN1/IN2

H-Bridge: DC Motor A

2 pins on channel for Boolean signals (CW: T/F, CCW: F/T)

Channel-B Enable

PWM: DC Motor B

1 pin on channel for duty cycle % (float between 0 and 1)

Channel-B IN1/IN2

H-Bridge: DC Motor B

2 pins on channel for Boolean signals (CW: T/F, CCW: F/T)

 

 

·         H-Bridge: Uses Boolean signals to control the direction that the motor spins (clockwise vs. counterclockwise)

o   The Boolean signal defines the motor’s polarity by changing the direction that the current flows through a motor

o   Switching the polarity switches between a clockwise and counterclockwise motor rotation

 

Clockwise

Counterclockwise

A diagram of a circuit

AI-generated content may be incorrect.

A diagram of a circuit

AI-generated content may be incorrect.

 

 

·         Pulse Width Modulation (PWM): Commands a percentage to define how much of a motor’s total available ‘effort’ (Duty Cycle) to output as a digital signal

o   The power delivered to the motor is not actually reduced to a percentage of the total motor spec

o   Instead, the power supplied continually flips between a ‘low’ and ‘high’ state to simulate a variable voltage that’s bound between the min and max operating speed

§  This state flipping is not perceivable to the human eye

 

Pulse Width Modulation - SparkFun Learn

 

 

·         The diagram below shows how the L298N motor driver is connected to the DC motors and the microcontroller logic pins

 

A red circuit board with many wires

AI-generated content may be incorrect.

 

 

Ultra Wideband (UWB)

·         Ultra-Wideband (UWB) is a high-precision, short-range wireless radio technology used for accurate, low-power device localization at short distances

o   Devices send multiple short radio pulses over a wide frequency band and measure the time it takes for signals to travel between one another (Time of Flight, ToF) to determine their distance and position

o   Large bandwidth provides high data rates and stability to reduce interference while enabling precise positioning

§  Ideal for indoor positioning and navigation

 

Peripheral

Proposed Purpose

ESP32 UWB Pro DW1000

Localization

MaUWB STM32 AOA

Docking

 

·         These peripherals use Serial Peripheral Interface (SPI), a synchronous serial communication for short-distance wired communication

o   See Communication Protocols: SPI in Tech Notebook

 

ESP32 UWB Pro with DW1000

CPU

ESP32 - WROVER

UWB

DW1000

Measuring Distance

200M

UWB Channel

2/5

Board USB Supply Voltage Range

4.8~5.5V, 5.0V Typical

Other Features

WiFi, BlueTooth

 

 

ESP32-WROVER Pin Layout (Top View)

A white sheet of paper with black squares and black text

AI-generated content may be incorrect.

Source: Makerfabs ESP32 UWB with DW1000 Documentation

 

 

ESP32 Pin Definitions

A white sheet with black text

AI-generated content may be incorrect.

Source: Makerfabs ESP32 UWB with DW1000 Documentation

 

 

Algorithms

 

·         All algorithms implemented in this UGV are documented in the Tech Notes section of my digital notebook!

o   Localization: Trilateration

o   Path Planning: A* Path Planning

 

 

Software

 

·         All code implemented in this UGV is publicly available on my github!

o   Localization

o   Path Planning

o   L298N Motor Driver Demo

o   SG90 Servo Motors

 

 

Helpful Links

·         H-Bridges

·         Ultra Wideband Sensors

·         Servo Motors

·         Makerfabs ESP32 UWB with DW1000