AI Self Driving Car

by jmoreno555 in Circuits > Raspberry Pi

38867 Views, 318 Favorites, 0 Comments

AI Self Driving Car

portada.png
IMG_1567.JPG
IMG_1562.JPG
IMG_1119.JPG
IMG_1572.JPG
IMG_1558.JPG
IMG_1559.JPG
IMG_1561.JPG
IMG_1563.JPG
IMG_1564.JPG
IMG_1565.JPG

Self-driving cars, also known as autonomous vehicles, are a revolutionary innovation in the automotive industry that is transforming the way we conceive transportation. These vehicles are capable of moving safely and efficiently on roads and urban environments without direct human intervention. They use a combination of sensors, cameras, radars, and advanced navigation systems to perceive their surroundings, interpret signals, and make real-time decisions.

The development of self-driving cars has been driven by leading technology companies and automakers, who have invested significantly in research and development to bring this vision to reality. As technology has advanced, autonomous cars have evolved from mere prototypes to become an increasingly common presence on our roads.

The potential benefits of self-driving cars are vast, ranging from reducing traffic accidents to optimizing traffic flow and improving accessibility for people with mobility impairments. However, they also pose regulatory, ethical, and safety challenges that must be addressed before widespread adoption. Despite these challenges, the future of mobility seems inevitably linked to the proliferation of self-driving cars, promising a radical shift in how we get around.

Creating a scale model of a self-driving car is more than just an engineering exercise; it's an opportunity to explore the future of mobility and inspire innovation. These miniature models allow you to visualize and better understand the operation of autonomous vehicles, as well as their numerous advantages.

By building a scale model of a self-driving car, you're participating in the realization of a revolutionary vision that is transforming the automotive industry. Furthermore, you immerse yourself in a creative process that challenges your technical skills and fosters your creativity.

Creating a scale model also gives you the opportunity to experiment with different designs and technologies, exploring new ideas and innovative solutions to the challenges facing autonomous driving.

Moreover, by exhibiting your scale model, you can inspire others and generate interest in self-driving car technology, thus contributing to the advancement and dissemination of this exciting innovation.

In summary, making a scale model of a self-driving car is not only an exciting and educational project, but it also puts you at the forefront of the technological revolution that is transforming how we get around. Let your imagination soar and bring the future of mobility to life in your hands!


Join me on this incredible adventure of creating a scale model of a self-guided car.

Supplies

See supplies in steps below

Description and Scope of the Project

The project is divided into three main parts

  1. Car: Mechanical Components
  2. Car: Electronic Components
  3. Treadmill

Let's see the characteristics of each part:

Part One: Mechanical Components

A low-cost 1/10 scale remote control model kit was selected that would allow the option of making improvements. After analyzing various models, the HSP 94123 kit was chosen, since it is the basis for assembling a scale Nissan GTR model. For the power transmission system, a 550 type brush motor and its speed controller card (ESC) were chosen.

Part Two: Electronic Components

The car has two types of cameras: a 1.2 Megapixel camera equipped with a 160-degree lens and a stereoscopic camera with two 75-degree lenses.

The cameras are connected to a Raspberry Pi 4 equipped with a Google Coral USB, which is a unit capable of processing 4 trillion operations (tera-operations) per second (TOPS). To manage the distance sensors, rear lights, steering servo and speed control card, as well as the processing of Radio control signals, a Wemos D1 R32 board is used, which is an ESP32 mounted on a PCB of the Same format as an Arduino UNO, this allows us to mount shields to test various electronic components.

Part Three: Treadmill

I designed a treadmill for this car to allow control and navigation testing without having to go behind the car on a test track, this way you can interact with the car at your desk.

The front of the treadmill is designed to handle the incline angles that the Ackerman steering has.


IMPORTANT: This is a project in development and the scope of this INSTRUCTABLE includes only the hardware part (Chassis & Electronic Components). However, at the end, in the software section, some guidelines are given on the path that is being followed to test this concept.

This is the first version of the Hardware and during its implementation, construction details have been found that will be corrected in the next version. Likewise, at the end, the modifications that are being taken into account for the next version are announced.

Every effort has been made to ensure that this first version is as close to the desired design as possible.

The purpose of this INSTRUCTABLE is to give you the bases so that you can create your own self driving car from a solid base.

As soon as a new version is available, this INSTRUCTABLE will be updated.

DESIGN BASIS

db.png

The construction of the car must be carried out on a chassis of a low-cost 1/10 scale model that can be easily acquired.

The motor must be a brushless motor and model 550.

The car must be able to be handled in two ways: a manual one through a radio control transmitter and an automatic one, where the car is guided by means of a computer.

The car must be equipped with vision cameras. A wide-angle lens to allow a panoramic view of the environment and make vision algorithms for object recognition easier and more efficient. The other camera must be stereoscopic so that the distance at which objects are in front of the camera can be determined. As an auxiliary system in distance detection, the car must have the option of using an optical distance sensor. The cameras must be placed in the front of the car in the grill area.

The car must have at least rear stop and turn lights.

The computer inside the vehicle must be a Raspberry Pi 4 or higher. To process the images from the cameras and detect objects and determine trajectories using AI tools, the car must be equipped with a Google Coral USB drive that allows processing up to 4 TOPs. To manage the radio control signals, the management of the motor speed regulator card, the steering servo and the distance sensors, a Wemos D1 R32 card should be used, which is an ESP32 microcontroller mounted on a board with the format of an Arduino UNO, in this way the features of the car can be expanded by placing shields on the top. The Wemos R32 card is managed by the Raspberry Pi through a USB port (serial connection), which at the same time provides it with power.

The electrical system should be composed of 18650 type Lipo batteries, separating the batteries into two groups: one to drive the electronics and the other to power the motor.

The signals between the Raspberry Pi and the Wemos D1 R32 are via serial port and using parser algorithms to send commands between them.

Design Recommendations - BEFORE STARTING 3D PRINTING

3d.png

Efficient 3D Design: Use 3D design software like SolidWorks, Fusion 360, Tinkercad, or Blender to create your model. Ensure you are familiar with the chosen tool.

Design the structure to require the least amount of supports during printing. This will make printing easier and reduce the time and material needed.

Print Orientation: Plan the orientation of the part on the 3D printer to minimize the need for supports. Often, a flat orientation is the best choice.

Avoid sharp angles or excessively long overhangs as they might require supports or be prone to deformation.

Printing Material: Choose a suitable material for your application. PLA is common for prototypes, but if you need more strength, consider ABS, PETG, or Nylon. For specialized applications, you might consider materials like TPU for flexibility or resin for high resolution.

Wall Thickness and Infill: Adjust the wall thickness and infill of your design according to your needs. Parts that need to be stronger can have thicker walls and more infill, while less critical parts can be lighter.

Easy Assembly: Design parts that are easy to assemble without the need for additional tools. Consider using clips, bolts and nuts, or slot and tab systems to keep parts together.

Consider Tolerances: Take into account tolerances to ensure that the printed parts fit together properly. 3D printers can have some variability in the dimensions of printed parts.

Modular Structure: Divide the structure into smaller modules that can be printed separately and then assembled. This makes printing, troubleshooting, and part replacement easier.

Iterative Testing: Prototype and test with 3D-printed parts before printing the complete structure. This allows you to make adjustments and improvements to the design without wasting time and material.

Documentation: Document your design in detail. Provide clear assembly instructions, a parts list, and any additional information that might be useful for others looking to build the same robot.

Consider Functionality: Ensure that the structure can accommodate all necessary components, such as motors, wheels, sensors, and circuit boards.

Strategic Reinforcements: If needed, you can add reinforcements in critical areas of the structure to increase strength and durability.

Optimize for Weight: If mobility is a significant factor, look for ways to optimize the weight of the structure without compromising strength.

Respect Copyrights: If you are using pre-existing designs or third-party components, make sure to respect copyrights and relevant licenses.


3D PRINTING: Grille-Front Bumper, Cameras Support & Sensor Support

3D_4.png
IMG_1084.JPG
IMG_1083.JPG
IMG_1394.JPG

The following files contain the parts that we need to print that are part of the GRILLE & CAMERAS SUPPORT:

3D PRINTING: Battery Holder

3D_9.png
IMG_1120.JPG
IMG_1121.JPG

The following file contain the part that we need to print that are part of the ENERGY SYSTEM:

3D PRINTING: Electronic Components Base

3D_5.png
IMG_1281.JPG
IMG_1280.JPG

The following files contain the parts that we need to print that are part of the Components Base:

3D PRINTING: Rear Lights

3D_8.png
IMG_1384.JPG
IMG_1385.JPG

The following files contain the parts that we need to print that are part of the Rear Lights:

IMPORTANT: To print the right light, in the 3D printer software clone the left part and apply the mirror effect, in this way the right part of the rear light will be created.

3D PRINTING: Car Treadmill

3D_1.png
3D_2.png
IMG_1466.JPG
3D_3.png
IMG_1467.JPG
IMG_1140.JPG

The following files contain the parts that we need to print that are part of the TREADMILL:

IMPORTANT: The PLUG part must be cloned 15 times

3D PRINTING: Post Processing

IMG_1123.JPG

Once the 3D printer has finished its work, it is often necessary to work on the part itself: this is where post-processing comes in. Post-processing includes several steps on the cleaning of the parts. The goal is to remove all excess material.

The post processing steps are:

  • Support Removal
  • Sanding
  • Joining
  • Priming & Painting

Tools that we are going to use in this step:

  • Dremel
  • Dremel 432 Sanding Band
  • Dremel 932 Aluminum Oxide Grinding Stone
  • Dremel 9901 Tungsten Carbide Carving Bit
  • Retracting-Blade Utility Knives
  • Straight Rectangular File for Coarse Finish, 8" Long x 1/2" Wide
  • Sanding Sheet with Paper Abrasive Backing, for Smooth Finish, 220 Grit
  • Drill Bits: 1/8", 5/32", 13/64", 7/32", 4mm, 8mm
  • HSS Straight Groove Step Drill Bit 3-12mm

POST PROCESSING

IMG_1386.JPG
IMG_1282.JPG
IMG_1283.JPG
IMG_1284.JPG
IMG_1285.JPG
IMG_1286.JPG
IMG_1287.JPG
IMG_1288.JPG
IMG_1122.JPG
IMG_1387.JPG

Use a Straight Rectangular File for Coarse Finish, 8" Long x 1/2" Wide to remove excess plastic.

Use a HSS Straight Groove Step Drill Bit 3-12mm to drill the holes for the M3 screws to go through.

HEAT SET INSERTS

M4-heatset-thread-insert__98710.jpg
IMG_1291.JPG
IMG_1293.JPG
HI1.png
IMG_1099.JPG
IMG_1395.JPG
HI2.png
IMG_1103.JPG
IMG_1111.JPG
HI3.png
IMG_1295.JPG
IMG_1301.JPG
HI4.png
IMG_1124.JPG
IMG_1128.JPG
HI5.png
IMG_1392.JPG

For Heat-set inserts tutorial, follow this link


TOOLS:

Heat Insertion Tool For Plastic 3D Printer Soldering Iron

MATERIAL:

Heat-Set Inserts for Plastic, Brass, M3 x 4.2 mm, 3 mm Installed Length x 2 (for Step Down Converter)

Heat-Set Inserts for Plastic, Brass, M3 x 4.2 mm, 3 mm Installed Length x 2 (for Laser Sensor Support)

Heat-Set Inserts for Plastic, Brass, M3 x 4.5 mm, 4 mm Installed Length x 3 (for Cameras_Nuts.stl)

Heat-Set Inserts for Plastic, Brass, M3 x 4.5 mm, 4 mm Installed Length x 2 (for Grille)

Heat-Set Inserts for Plastic, Brass, M3 x 4.5 mm, 4 mm Installed Length x 6 (for Rear Lights support)

Heat-Set Inserts for Plastic, Brass, M3 x 4.5 mm, 4 mm Installed Length x 4 (for Battery Holder)

Heat-Set Inserts for Plastic, Brass, M3 x 4.5 mm, 5 mm Installed Length x 8 (for Electronics Support Base)

STEPS:

Carefully using the insertion tool, install the insertion nuts as shown in the pictures.

PLACING HEXAGONAL SPACERS

IMG_1302.JPG
IMG_1303.JPG
IMG_1304.JPG
IMG_1305.JPG
IMG_1306.JPG
IMG_1307.JPG
IMG_1308.JPG

TOOLS:

Hobbypark RC Car Wheels Tools Metal Hex Hexagon Sleeve Wrench Cross Wrenches (4mm, 5mm, 5. 5mm, 7mm)


MATERIAL:

M3 Male Female Hex Spacer Standoff Screw Nut Threaded Pillar (M3 6mm + 6mm) x8

M3 Male Female Hex Spacer Standoff Screw Nut Threaded Pillar (M3 12mm + 6mm) x4


STEPS:

Install the M3 Male Female Hex Spacers Standoff Screw as shown in the pictures.


DESCRIPTION of COMPONENTS

COMPONENT DESCRIPTION: Raspberry Pi 4

GPIO-Pinout-Diagram-2.png

Specifications

  • Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.8GHz
  • 1GB, 2GB, 4GB or 8GB LPDDR4-3200 SDRAM (depending on model)
  • 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE
  • Gigabit Ethernet
  • 2 USB 3.0 ports; 2 USB 2.0 ports.
  • Raspberry Pi standard 40 pin GPIO header (fully backwards compatible with previous boards)
  • 2 × micro-HDMI® ports (up to 4kp60 supported)
  • 2-lane MIPI DSI display port
  • 2-lane MIPI CSI camera port
  • 4-pole stereo audio and composite video port
  • H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode)
  • OpenGL ES 3.1, Vulkan 1.0
  • Micro-SD card slot for loading operating system and data storage
  • 5V DC via USB-C connector (minimum 3A*)
  • 5V DC via GPIO header (minimum 3A*)
  • Power over Ethernet (PoE) enabled (requires separate PoE HAT)
  • Operating temperature: 0 – 50 degrees C ambient


COMPONENT DESCRIPTION: Wemos D1 R32

29925aa3937a1589b45662af2164b15920466e7b.png

Wemos D1 R32 is ESP32 Based WiFi/Bluetooth Board in Arduino UNO form factor. The UNO form factor lets you use existing Arduino Shields with ESP32 Wireless CPU. All I/O pins are 3.3V

The ESP32 chip integrates a dual-core processor with 448 KByte ROM, 520 KByte SRAM, 16 KByte SRAM in RTC, 802.11 b/g/n/e/I Wi-Fi, Bluetooth v4.2 BR/EDR & BLE, clocks & Times, abundant peripheral Interfaces and security mechanism.

COMPONENT DESCRIPTION: Synchronized Dual Lens Stereo USB Camera

stereocam.jpg

Specification:

  • Sensor 1/3 inch OV9750
  • Pixel Size 4860µm x 3660 µm
  • 1.3MegaPixels,Max. Resolution 2560(H)X960(V)
  • Sensitivity 3.7V/lux-sec@550nm
  • Mini illumination 0. 1lux
  • Lens Parameter: M9 Lens HOV90 degree
  • Shutter Type Electronic rolling shutter / Frame exposure
  • Connecting Port type USB2.0 High Speed
  • Free Drive Protocol USB Video Class(UVC)
  • Support OTG Protocol USB2.0 OTG
  • AEC Support, AEB Support


COMPONENT DESCRIPTION: Cables

Screenshot 2024-05-02 084806.png

We need two USB micro cables like this

COMPONENT DESCRIPTION: Raspberry Camera & Fisheye Lens

camara raspberryy.png
LENS 180.png

A Raspberry camera was acquired and the original lens was changed to a 180 degree lens since within the community of OpenCV programmers who have created line detection algorithms they have found that vision algorithms detect lines better when wide angle lenses are used.


Fish Eye Lens:

  • Focal length: 1.8mm
  • Mounting: M12*P0.5
  • Image format: 1/2.5"
  • Aperture: F2.0
  • Viewing angle: 180 degrees

Camera Specifications:

  • 5 megapixel OV5647 sensor
  • CCD size: 1/4 inch
  • Best resolution sensor: 1080p
  • 4 screw holes: used for fixing IR lights and for 3.3V electrical driving Focal length: 2.1
  • Dimensions: 25mm x 24mm

COMPONENT DESCRIPTION: Motor & Controller

esc combo.png

ESC + MOTOR COMBO:

550 brushed motor

Characteristics:

The RCXAZ 550 Brushed Waterproof Motor is an economical motor built for messy, dirty, off-road action.

This powerful 550 motor has a 30% longer armature than a standard size 540 motor for extreme monster torque.

Heat resistant motor with built-in cooling fan, allows for fast speeds, long life and long service life.

High strength magnets ensure maximum performance.

1/8 inch shaft diameter, oil bearing on output side.

Bullet plugs are easy to connect without the need for soldering.

The four models that are available to choose from are 12T/21T/29T/35T.


Specifications:

  • Motor diameter: 36mm
  • Motor shaft length: 16mm(12T) 11mm(21T 29T 35T)
  • Shaft diameter: 3.17mm
  • Use voltage: 7.4V(12T) 7.4-11.1V(21T 29T 35T)
  • Weight: about 230G
  • Suitable for: RC car/boat



60A brushed ESC:

Characteristics:

Built-in heat sink, good heat dissipation efficiency, can quickly reduce the motor temperature.

Operating mode: Forward brake and reverse brake/Forward trailing brake and trailing brake.

Automatic throttle stroke adjustment, automatic throttle neutral adjustment, easy to use.

Applied jumper cap adjustment mode for battery type, which is simple and clear.

It has multiple protection functions, such as lithium battery low voltage protection, automatic cell quantity detection, high temperature protection, and throttle signal loss protection.

Specifications:

  • Forward: 60A/360A
  • Reverse: 30A/180A
  • Voltage: 2-3S Lipo/5-9 cells NiMH battery
  • Application: For 1/10 Car, Buggy, Short Course Truck, Crawler and Tank

COMPONENT DESCRIPTION: Google Coral USB Accelerator

accelerator-inhand.jpg

The Coral USB Accelerator adds an Edge TPU coprocessor to your system, enabling high-speed machine learning inferencing on a wide range of systems, simply by connecting it to a USB port.


Performs high-speed ML inferencing

The on-board Edge TPU coprocessor is capable of performing 4 trillion operations (tera-operations) per second (TOPS), using 0.5 watts for each TOPS (2 TOPS per watt). For example, it can execute state-of-the-art mobile vision models such as MobileNet v2 at almost 400 FPS, in a power efficient manner.

PLACING DECALS & REINFORCING THE CAR BODY

IMG_1076.JPG
IMG_1077.JPG
IMG_1078.JPG
IMG_1079.JPG
IMG_1080.JPG
IMG_1081.JPG
IMG_1082.JPG

Now we are going to place the decals on the body and we are also going to reinforce parts of the structure with aluminum tape. This serves to strengthen the weak parts of the body. Also with the aluminum tape you have to stick the magnets to the body. The magnets serve to hold the body to the chassis.

CUTTING HOLES: Grille

IMG_1097.JPG
IMG_1085.JPG
IMG_1089.JPG
IMG_1090.JPG
IMG_1087.JPG
IMG_1088.JPG
IMG_1091.JPG
IMG_1093.JPG
IMG_1095.JPG
IMG_1096.JPG
IMG_1098.JPG

With a marker, delimit the grill area and using a Dremel cutting disc, remove the marked piece from the casing.

CUTTING HOLES: Rear Lights

IMG_1135.JPG
IMG_1136.JPG
IMG_1137.JPG
IMG_1138.JPG
IMG_1139.JPG

With a marker, delimit the area of the rear lights and using a Dremel cutting disc, remove the marked pieces from the housing.

Before Starting to Assemble: ROD CUTTING

FKGMU8JLP5HNU4Q.jpg
F2BC1YCLP5HNU6H.jpg
FMVENX7LP5HNU75.jpg
FWFJHOGLP5HNU57.jpg
IMG_1488.JPG

TOOLS:

Electric Angle Grinders

Angle Grinder Cutoff Wheel for Stainless Steel, Flush-Cut, 4-1/2" Diameter, 0.045" Thick

MATERIAL:

Multipurpose 304/304L Stainless Steel Rod, 1/8" Diameter

STEPS:

We need to prepare the following steel bars:

8 bars 1/8" in diameter by 65 mm in length.

Mark each rod with the necessary distance and make the cuts with the grinder.

Grind the cuts to avoid burrs.

Before Starting to Assemble: Mounting Cameras & Distance Sensor

IMG_1119.JPG

We are now going to mount the distance sensor and the cameras. Two types of distance sensor are available: one is the SHARP 2Y0A21 and the other is a VL53L0 laser sensor. We must choose one of these two options.

OPTION A: Mounting the SHARP Distance Sensor

IMG_1434.JPG
IMG_1435.JPG
IMG_1436.JPG
IMG_1437.JPG

To mount the SHARP sensor, carefully insert it into the sensor hole.

OPTION B: Mounting the Laser Distance Sensor

IMG_1402.JPG
IMG_1403.JPG
IMG_1404.JPG
IMG_1405.JPG
IMG_1406.JPG
IMG_1407.JPG
IMG_1408.JPG
IMG_1409.JPG

To mount the VL53L0 laser sensor, screw the sensor into its adapter base and carefully insert it into the sensor hole and pass the cables through the camera bracket hole. Be careful with the flat cable of the Raspberry camera.

Mounting the Cameras

IMG_1116.JPG
IMG_1413.JPG
IMG_1424.JPG
IMG_1425.JPG
IMG_1426.JPG
IMG_1427.JPG
IMG_1428.JPG

We are going to place the cameras on their support. First we are going to install the Raspberry camera, for this we are going to need four M1x12 screws. Before screwing the camera into place, carefully install the ribbon cable into its connector.

IMPORTANT: Verify that the side of the metal conductors on the flat cable match the connector. Screw the camera in carefully.

Then carefully install the stereo camera. The camera mount is designed to hold the camera firmly, however the camera lenses have excess glue that was used to secure the lenses when calibrating the cameras and this excess glue may prevent the cameras from inserting properly into their holder. place. If this is your case, carefully with the Dremel and a grinding tip, remove the plastic from the support in the glue area and check the space until the chambers fit firmly, but without forcing.

Installing the Grille (OPTION A) and Cameras Together

IMG_1437.JPG
IMG_1438.JPG
IMG_1439.JPG
IMG_1440.JPG

Take the grill with the SHARP sensor and route the cables through the hole in the camera bracket. Be careful with the flat cable on the Raspberry Pi.

Installing the Grille (OPTION B) and Cameras Together

IMG_1429.JPG
IMG_1430.JPG
IMG_1432.JPG
IMG_1431.JPG
IMG_1433.JPG

Take the grill with the Laser VL53L0 sensor and route the cables through the hole in the camera bracket. Be careful with the flat cable on the Raspberry Pi.

Before Starting to Assemble: ELECTRICAL SYSTEM

IMG_1357.JPG

Now we are going to assemble the electrical system.

ELECTRICAL SYSTEM: Switch & StepDown Converter

IMG_1341.JPG
IMG_1342.JPG
IMG_1343.JPG
IMG_1344.JPG
IMG_1345.JPG
IMG_1346.JPG

1.- Insert the power switch into place.

2.- Fix the voltage regulator in place using two M3x5 screws.

ELECTRICAL SYSTEM: Battery Wiring

IMG_1320.JPG
IMG_1321.JPG
IMG_1322.JPG
IMG_1323.JPG
IMG_1324.JPG
IMG_1325.JPG
IMG_1326.JPG
IMG_1327.JPG
IMG_1328.JPG
IMG_1329.JPG
IMG_1330.JPG
IMG_1331.JPG
IMG_1332.JPG
IMG_1333.JPG
IMG_1334.JPG
IMG_1335.JPG
IMG_1336.JPG
IMG_1337.JPG
IMG_1338.JPG
IMG_1339.JPG
IMG_1340.JPG

For the wiring of the 18650 Lipo batteries, we are going to use two battery holders with three cells each. The wiring arrangement is divided into two sections:

One is for the supply voltage to the electronic components and is composed of four batteries, connected as follows: Two batteries in series to have 4.2 volts x 2 batteries = 8.4 volts / 2200 mA. These are connected in parallel to two other batteries in series to form the 8.4 volts / 4400 mA array. This arrangement connects to the power switch and from there it goes to the voltage regulator.

The other section has the two remaining batteries are for driving the motor and are connected in series: 4.2 volts x 2 batteries = 8.4 volts / 2200 mA. This arrangement is to be connected to the speed controller card (ESC).

ELECTRICAL SYSTEM: Regulator & Switch Wiring

IMG_1348.JPG
IMG_1349.JPG
IMG_1350.JPG
IMG_1351.JPG
IMG_1352.JPG
IMG_1353.JPG
IMG_1354.JPG
IMG_1355.JPG
IMG_1356.JPG
IMG_1357.JPG

Carefully solder the positive cable (16 AWG color red) from the batteries to the power switch and from there solder another small red cable to the positive input of the voltage regulator.

The negative cable (16 AWG color black) is soldered directly to the voltage regulator.

ELECTRICAL SYSTEM: Voltage Adjusting

IMG_1358.JPG
IMG_1359.JPG
IMG_1360.JPG
IMG_1361.JPG

Let's now adjust the voltage of the regulator.

IMPORTANT: Verify that the batteries are fully charged before starting.

1.- Turn on the switch

2.- Verify that the voltage regulator LED lights up.

3.- Connect a multimeter to the output of the regulator and measure the voltage it is delivering.

4.- Adjust the potentiometer with a small flat screwdriver until the reading on the multimeter is 5.1 volts.

ELECTRICAL SYSTEM: Battery Wiring for Motor

IMG_1479.JPG
IMG_1480.JPG

Place terminals on the motor power cables.

ELECTRICAL SYSTEM: Gluing the Battery Holder

IMG_1472.JPG

Using glue, attach the battery holder to its 3D printed base.

ELECTRICAL SYSTEM: SOLDERING USB TYPE C CONNECTOR

IMG_1478.JPG
IMG_1476.JPG

Cut a length of 25 cm from a 3A capacity USB Type-C cable. Identify the negative and 5 volt wires and solder them to their respective voltage regulator output terminals.

HSP 94123

Screenshot 2024-05-02 181308.png

Now we are going to start with the mechanical assembly of the car.

This kit can be purchased already assembled or can be purchased unassembled.

If you choose the unassembled version and have not assembled such a vehicle before, it may seem like a difficult task. If this is your case, I recommend that you watch the following video, which shows how to assemble this model. It is in Spanish but you can set the subtitles to English.

Or you can also take as reference the photos of the following steps where details of the various assembly steps are shown.

If you purchased an assembled model, skip directly to the step of placing the electronic components and cameras.

HSP 94123: FRONT SUSPENCION

s-l960-removebg.png
suspencion frontal 1.png
suspencion frontal 2.png
suspencion frontal 4.png

FRONT DIFERENTIAL

FRONT DIFERENTIAL

IMG_1226.JPG
IMG_1227.JPG
IMG_1228.JPG
IMG_1229.JPG
IMG_1230.JPG
IMG_1231.JPG
IMG_1232.JPG
IMG_1233.JPG
IMG_1234.JPG
IMG_1235.JPG
IMG_1236.JPG
IMG_1237.JPG
IMG_1238.JPG
IMG_1239.JPG
IMG_1240.JPG
IMG_1241.JPG
IMG_1242.JPG
IMG_1243.JPG

Front Suspension Assembly

Front Suspension Assembly

IMG_1174.JPG
IMG_1198.JPG
IMG_1203.JPG
IMG_1214.JPG
IMG_1212.JPG
IMG_1209.JPG
IMG_1206.JPG
IMG_1220.JPG
IMG_1247.JPG
IMG_1254.JPG
IMG_1267.JPG
IMG_1271.JPG

TRANSMISION

IMG_1518.JPG
IMG_1513.JPG
IMG_1517.JPG

What Is a SERVO SAVER?

When your RC car’s wheels hit any obstacle, such as a rock, it creates an unusual force that can harm the servo gears. As a result, the servo installed inside can malfunction, or stop working completely.

No RC owner would expect it. This is the case where a servo saver has a major role. 

The device has a spring-loaded mechanism that sits between the servo and the steering linkage. In the case of a sudden shake, the mechanism absorbs the impact and moves the steering linkage a little without transferring the shock to the servo. 

This is how it saves the servo in an RC car. For this reason, servo savers have been crucial components of high-performing RC cars to enhance their performance and durability.


This servo saver uses a spring mechanism to reduce the shock, a popular choice for off-road racing and bashing. When wheels hit any obstacle, it reduces the impact so the force does not transfer to the servo gears.


Installing the Grille and Cameras on the Car

IMG_1440.JPG
Screenshot 2024-05-03 140530.png
IMG_1441.JPG
IMG_1442.JPG
IMG_1443.JPG
IMG_1444.JPG
IMG_1445.JPG
IMG_1446.JPG
IMG_1447.JPG
IMG_1448.JPG
IMG_1449.JPG

Rear Suspension Assembly

s-l960 (2).png
suspencion trasera 1.png

Follow the same steps as for the front suspension.

Rear Suspension Mounting

IMG_1519.JPG
IMG_1522.JPG
IMG_1523.JPG
IMG_1526.JPG
IMG_1524.JPG
IMG_1525.JPG

Follow the same steps as the front suspension and look at the photos to see the differences.

Mounting the ELECTRICAL SYSTEM

IMG_1530.JPG
IMG_1528.JPG

Use four M3x6mm screws to secure the power system to the chassis platform.

Mounting the Electronic Components Base

IMG_1534.JPG
IMG_1532.JPG
IMG_1535.JPG

Now mount the upper aluminum support and place the electronic components support on it.

Placing the Electronics Components

IMG_1571.JPG
IMG_1538.JPG
IMG_1548.JPG
IMG_1543.JPG
IMG_1541.JPG
IMG_1542.JPG
IMG_1544.JPG
IMG_1539.JPG
IMG_1540.JPG
IMG_1552.JPG
IMG_1547.JPG

To wire the components to the Raspberry Pi, follow the following steps:

  • Connect the Google Coral unit to a USB3 port.
  • The stereo camera is connected to a USB3 port.
  • The Wemos D1 R32 card connects to a USB2 port
  • The available USB2 port can be used for a BlueTooth unit for a mouse and keyboard.
  • The wide-angle camera connects via a flat cable to the camera connector of the Raspberry Pi.

The rear light LEDs will be connected to the Wemos D1 R32 on the following pins:

  • Led Yellow Left pin 2
  • Led Yellow Right pin 4
  • Led Red Left pin 25
  • Led Red Right pin 26

IMPORTANT: Due to engine speed control problems at low speeds, the wiring portion of the radio control system and the ESC are not detailed in this version. As soon as the correct solution is determined this ISTRUCTABLE will be updated to reflect those changes.

REAR LIGHTS

IMG_1473.JPG
IMG_1474.JPG
IMG_1546.JPG
IMG_1547.JPG
IMG_1548.JPG
FullSizeRender.jpg

Two high-intensity red LEDs and two yellow LEDs are used for the rear lights.

20 mm LED lenses are used to make the model look as real as possible.

The magnets that secure the housing to the car are also placed on the rear light support.

REAR LIGHTS PRO (UPDATED VERSION: PCB & 3D PRINTER FILES)

Screenshot 2024-05-07 163654.png
Screenshot 2024-05-07 171752.png

In the following LINK you can download the Gerber file necessary for the rear lights PCB required for the car.

I used the services of JLCPCB, for the manufacture of the PCBs.


The steps to follow so you can obtain these cards are:

1.- Download the Gerber file from my GitHub site

2.- Go to the JLCPCB site and if you do not have an account, create one.

3.- Enter the site and at the top right of the page click on the "Order now" link

4.- Click on the "Add gerber file" button

5.- Select the *.zip file that you downloaded and once the upload is complete, you can select, for example, to change the color of the PCB.

6.- Click on the "SAVE TO CART" button

7.- Go to "View Car" and proceed with the payment.

READY...let's wait for the courier to bring us the PCB

To print the 3D parts, follow the same observations as in step 7.

GEARBOX ANALYSIS

gearboxWT.png

Let's now do some calculations, which we will require later when we are carrying out our control algorithms.

After some research I found this information, which allowed me to verify the gearbox ratio:

From the MAE 3 site:

The Power Transmission often includes a Gear Ratio or Mechanical Advantage. A Gear Ratio can increase the output torque or output speed of a mechanism, but not both. A classical example is the gears on a bicycle. One can use a low gear that allows one to pedal easily up hill, but with a lower bicycle speed. Conversely a high gear provides a higher bicycle speed, but more torque is required to turn the crank arm of the pedal. This tradeoff is fundamentally due to the law of energy conservation and is the key concept of Mechanical Advantage. With a given power source you can either achieve high velocity output or high force/torque output but not both.
Mechanical Advantage refers to an increase in torque or force that a mechanism achieves through a power transmission element. For rotary devices the term Gear Ratio is used to define the Mechanical Advantage. The term Mechanical Advantage is used to describe components that include translation. The analysis below shows how one calculates the Gear Ratio and Mechanical Advantage of a Power Transmission component.
...
Summary 
The fundamental equations for a gear pair are:
τin ωin = τout ωout (power equality)
ωout / ωin = rin / rout (velocity relationship in terms of radiuses)
ωout / ωin = nin / nout (velocity relationship in terms of number of teeth)
τout / τin = rout / rin (torque relationship in terms of radiuses)
τout / τin = nout / nin (torque relationship in terms of number of teeth)

The Gear Ratio is defined as the input speed relative to the output speed. It is typically written as:
Gear Ratio = ωin : ωout


Arranging the equation in bold, we have:

nin x ωin = nout x ωout

We are going to start the calculation from the wheel to the motor and we are going to use 1 revolution as the input speed:

The differential gear (nin) has 38 teeth and the Bevel pinion gear (nout) has 13 teeth:

38 x 1 rev = 13 x ωout

ωout = 38 x 1 rev / 13

ωout = 2.923076 rev

This is the speed of the 38/13 diferential box.

The following calculation is between the Bevel pinion gear and 64/17 motor gear:

64 x 2.923076 rev = 17 x ωout

ωout = 64 x 2.923076 rev / 17

ωout = 11.004524 rev


11 rev is the motor speed when we have a wheel speed of 1 rev.


The gearbox ratio is 1/11

Remote Control: Code Matching Steps

RC.jpg

For manual control of the car, we will need a Radio transmitter and its receiver.

To pair a radio receiver with the transmitter, follow these steps:

  1. Insert the code checker into the code check hole of the receiver.
  2. Connect the power supply. Then connect the power cord to the receiver jack. (We can see taht the receiver's signal lights starts to flicker.)
  3. Turn On the transmitter power switch. (At this time the light of the receiver no longer flickers but keeps on).
  4. Unplug the code matching device.

The code matching is now complete.

TREADMILL

IMG_1565.JPG

TREADMILL: PVC Cutting

FVT5W30LP5HNTMX.jpg
IMG_1144.JPG
IMG_1146.JPG
IMG_1149.JPG
IMG_1143.JPG

TOOLS:

Pipe Cutter

MATERIAL:

1/2" PVC Pipe C-40

STEPS:

8 PVC sections of 35 mm are required.

Mark these measurements on the PVC pipe and use the pipe cutter to make these cuts.


TREADMILL: PVC Painting

IMG_1487.JPG
IMG_1489.JPG

Clean the PVC pipe and then apply safety yellow spray paint.

TREADMILL: Roller Assembly

IMG_1485.JPG
IMG_1481.JPG
IMG_1491.JPG
IMG_1489.JPG
IMG_1490.JPG

MATERIAL:

6063 Aluminum Low-Profile Binding Barrels and Screws, 8-32 Thread Size, for 1/2"-3/4" Material Thickness x16

PVC Pipe C40 12mm diam. x 50 mm long x8 (from Step 57)


3D PRINTER PARTS:

PLUG x16


STEPS:

  1. Place the aluminum barrels into the 3D printing plugs.
  2. Insert the plugs into the ends of the PVC pipe.


TREADMILL: Roller Front Support Assembly

IMG_1483.JPG
pearler beads.png
IMG_1502.JPG
IMG_1499.JPG
IMG_1503.JPG
IMG_1504.JPG
IMG_1505.JPG
IMG_1498.JPG

MATERIAL:

6063 Aluminum Low-Profile Binding Barrels and Screws, 8-32 Thread Size, for 1/2"-3/4" Material Thickness x10

Rod Bar  x4 (from Step 24)

Roller Assembly x4 (from Step 59)

Perler Fuse Bead x14

M5x12 screw x2

Cotton buds x4


3D PRINTER PARTS:

CAR_TREADMILL_LEFT_BOTTOM

CAR_TREADMILL_LEFT_TOP

CAR_TREADMILL_RIGHT_BOTTOM

CAR_TREADMILL_RIGHT_TOP


STEPS:

  1. Place the aluminum barrels into the 3D printing plugs.
  2. Place the rollers in place and secure them with the steel bars.
  3. To prevent the steel bars from slipping out of place, secure both ends of the bar with a Perler Beads
  4. Cut 14 plastic tubes from cotton swabs 12 mm long.
  5. Insert the plastic tube inside each Perler beads.
  6. Place the Perler Beads and tubes in the holes designed for them on the front bases of the treadmill.
  7. Place the front upper support of the treadmill on the base and secure it with the screw.

TREADMILL: Roller Rear Support Assembly

IMG_1482.JPG
IMG_1493.JPG
IMG_1497.JPG

MATERIAL:

6063 Aluminum Low-Profile Binding Barrels and Screws, 8-32 Thread Size, for 1/2"-3/4" Material Thickness x8

Rod Bar  x4 (from Step XX)

Roller Assembly x4 (from Step xx)


3D PRINTER PARTS:

CAR_TREADMILL_REAR_LEFT

CAR_TREADMILL_REAR_RIGHT


STEPS:

  1. Place the aluminum barrels into the 3D printing plugs.
  2. Place the rollers in place and secure them with the steel bars.
  3. To prevent the steel bars from slipping out of place, secure both ends of the bar with a Perler Beads


TREADMILL: Putting It All Together

IMG_1569.JPG
IMG_1570.JPG

MATERIAL:

Roller Front Support Assembly (from Step 60)

Roller Rear Support Assembly (from Step 61)


3D PRINTER PARTS:

CAR_TREADMILL_LINK_1_X2

CAR_TREADMILL_LINK_2


STEPS:

  1. Assemble the parts as shown in the images

SOFTWARE

The software is under development and is not part of the scope of this instructable, however I consider it interesting to show the guidelines I am taking for programming the car:


Unlike other scale models that use lidar to scan the environment. I think that although it is a method that requires a lot of computing power. Instead I want to use the cameras with the help of the Google Coral unit, to be able to detect the lines of the test track, as well as detect traffic signs, traffic lights, people and other vehicles at extremely high speed... and in some way it is what TESLA has done with its cars.

I am using BLENDER to simulate the test track and be able to change the lighting conditions and thus be able to train the AI in changing lighting scenarios.

In addition, BLENDER can be programmed in Python and in this way programming between the OpenCV vision software, the TensorFlow machine learning software and the simulator made in BLENDER is made easier.

To transfer information between the Raspberry Pi and the Wemos D1 R32 board, I am using a serial parser, which allows me to send endless combinations of control data and commands...something like MQTT but more powerful. An example of the use of this parse is in the taillight test file provided below and is easily modifiable to adapt it to any application. The only thing you have to do from Python on the Raspberry is send the command as a text string and that's it.


Please see the last section: REFERENCES where there are links to important information to get started in this fantastic process of making a self-guided car.

TEST REAR LIGHTS

IMG_1450.JPG

To test the lights, the following commands must be sent through the serial port to the WEMOS D1 R32:

<D,0,x> : Rear lights in day mode (off)

<D,10,x> : Rear lights in night mode (on at medium intensity)

<S,0,x> : Stop lights off

<S,235,x> : Stop lights on

<I,0,x> : Flashing lights off

<I,1,x> : Flashing lights on

<L,0,x> : Left turn signal off

<L,1,x> : Left turn signal on

<R,0,x> : Right turn signal off

<R,1,x> : Right turn signal on

Get Started With the USB Accelerator

social-horizontal.png

Raspberry Pi users: You can follow the steps below or you can instead flash your SD card with the AIY Maker Kit system image, which includes everything you need to use the USB Accelerator. For flashing instructions and Raspberry Pi-specific example code, see the AIY Maker Kit guide.

BLENDER

BLENDER.png

The Design of the Car & the Treadmill were made with BLENDER


BLENDER SIMULATOR

Screenshot 2024-03-26 162843.png

From geeksforgeeks:

OpenCV | Real Time Road Lane Detection
Last Updated : 24 May, 2023

Autonomous Driving Car is one of the most disruptive innovations in AI. Fuelled by Deep Learning algorithms, they are continuously driving our society forward and creating new opportunities in the mobility sector. An autonomous car can go anywhere a traditional car can go and does everything that an experienced human driver does. But it’s very essential to train it properly. One of the many steps involved during the training of an autonomous driving car is lane detection, which is the preliminary step. Today, we are going to learn how to perform lane detection using videos.


If you follow the previous link you can see the difficulty of obtaining videos to train a neural network to detect road lines. That's why I use BLENDER to generate this type of video quickly, plus it allows you to change the lighting mode of the stage and in this way we can train the artificial vision algorithms in different lighting conditions.

CONCLUSION

This project is constantly being updated and the following improvements are planned:

Improve the treadmill, bringing the rollers closer together to raise the height of the car a little and prevent the supports from touching the car body.

Problems were found with the voltage provided by the ESC to the motor. At this time the ESC cannot drive the car at low speeds (for example when parking the car). There are two possible solutions for this: One is to change the motor for one that has fewer revolutions per volt or change the ESC and use a motor controller that does not receive radio signals but directly controls the PWM signals.

These improvements will be implemented in the next revision and as soon as they are ready this INSTRUCTABLE will be updated.


Personally, it is a project that has allowed me to learn and put into practice many ideas and I hope that some part of this entire project can be of use to you.


Greetings from Mexico.

Jorge Moreno

References

MUST BE READ:

STANLEY: The Robot that Won the DARPA Grand Challenge