### Introduction
The design of the car is inspired by the Mars rover. The structure of the Mars rover is special. In order to ensure that it will not overturn or be blocked by obstacles when driving on the complex ground of Mars, its chassis adopts a structure called Rocker Bogie (rocker-bogie). The movable rocker adapts well to the unstructured ground, ensuring that there are always wheels that can touch the ground on uneven ground, unlike the traditional four-wheeled car chassis that may face the dilemma of the power wheel hanging in the air. Most importantly, this structure can climb stairs, which just meets my need for a car that can move freely in the building. Coincidentally, Jiali Chuang opened a car training camp, so this project came into being. :
- - -
### 1. Structural design
> *Modeling software is solidworks 2021*
> ![image.png]
- - -
> ![image.png]
> **Parts list**:
>
>
> * GB/T 276-2013 61801 12 * 21 * 5 deep groove ball bearings * 6 //Place on the front frame and driven wheel shaft
> * M3x15 (at least) screws * 16 //Fix the motor and the rear frame
> * M3x5 screws * 10 //Connect the shaft and the wheel and the PCB and the main body
> * M3 nuts * 4 //Connect the main body and the rear frame
> * M3.5x8 screws * 2 //Connect the front frame and the rear frame
> * GB37520 reduction motor 12V 110RPM * 4 (In theory, the Rocker Bogie structure is best if each wheel has power to function best, but due to funding and subsequent upgrades, only four are currently used, two each in the front and rear.)
> * Several non-standard parts
>
>
> All non-standard parts including tires are made by 3D printers. Tires are made of TPU and the rest are made of PLA. Due to their large size, there will be requirements for the size of the printer, so they are made carefully. My printer is ender3 s1, with a size of 220 * 220 * 270. No need to separate parts, they can be printed by appropriate placement.
> **Here are some assembly details**:
> ![image.png]
> The M3.5 screws need to pass through the washers to fix the front frame to the rear frame
> ![image.png]
> Two bearings are used on the driven wheel shaft
> **Finished assembly picture**
> ![f00a62025bf617edef483b760bb6abb.jpg]
>![f2c4d33c92332b55e60421e50c72537.jpg]
- - -
### 2. Circuit Design
> There is not much to say about this part. Generally speaking, it is no different from the official example. In order to ensure sufficient power supply current, a four-layer board was designed for the first time. Here are the differences from the official one:
>
> **Power supply and board-level protection**
> ![image.png]
> Since I use a 12V polymer lithium battery for power supply, I need to step down the voltage to power Liangshan School. 12V -> 5V, if LDO is used, it will generate too much heat and have low efficiency, so I found a TI DC-DC, which is mainly used to power the main control and several modules. The maximum current of 3A should be more than enough. The board-level protection has overcurrent (self-recovery insurance), peak voltage (TVS), and anti-reverse connection protection (N-mos).
> **Remote control part**
> ![image.png]
> ![image.png]
> An ESP32-CAM is connected, which can be used as a coprocessor, mainly responsible for image transmission, Bluetooth, WIFI, and a 2.4G module interface, and multiple remote control methods can be selected.
>**Buzzer**
> The buzzer used in the official example is an active buzzer. The advantage is that it will sound when powered, but the disadvantage is that it can only sound a fixed frequency. I used a passive buzzer I bought before, which needs a PWM wave to occur, but the advantage is that it can emit sounds of different frequencies, so I can play car music! I wrote a simple scale in the beep library, which can be played freely.
>![image.png]
>
>**Lighting**
>The lighting uses a lamp bead and two high-brightness LEDs on the ESP32-CAM. The ESP light is on pin 4. The LED style is as follows
>![2d77bb254083d5d9b27ff88bf9044c8.jpg]
>
>**Motor**
>![image.png]
>Two pull-down resistors are added to resist interference, and each RZ7899 has a 100uF capacitor for energy storage and a 0.1uF capacitor for filtering.
>Six servo interfaces are reserved to increase expandability.
>![image.png]
>
> **Other expansions and precautions**
> An MPU6050 is connected, and six servo interfaces are reserved. The motor interface is a reduction motor interface with a Hall encoder, six wires, and the line sequence is
> ![91a504c4bfaf75882df66e194655f09.jpg]
> The selected battery is
> ![70ec7b5be1e5f9c3007309e0761ec7a.jpg]
> Since the measured current of a single motor can reach 3A when starting, and the no-load current is 200~400mA, if the power supply is replaced, try to ensure that the instantaneous current is greater than 14A.
- - -
### 3. Program design
> Liangshan School communicates with esp32 through the serial port. Liangshan School is responsible for controlling the movement of the car, and esp32 is responsible for establishing communication with the host computer, transmitting instructions, and providing image transmission. The host computer is written by *Android Studio 2021*. Here is a reference to the demo of the big guys:
> Gitee: https://gitee.com/JDS110/embedded-related-learning
> Bilibili: https://www.bilibili.com/video/BV1kL41137kH/?spm\_id\_from=333.999.0.0&vd\_source=9828299e0853b62c5c08df197c6ba921
>
> Please note that when porting an Android project, the AS version may cause compilation failure. My solution is to create an empty project, then copy only the java and res folders in the main folder, and then compile. If an error occurs, let the compiler complete the file by itself, and then it will pass.
>
> ESP32 establishes a connection with the mobile phone through AP mode, communicates with the host computer through the UDP protocol, and receives instructions and then conveys them to Liangshan School through the serial port to control the car. Since this is my first time using AS, I am not very proficient and have limited changes to the demo. I can only say that it works. The layout is temporarily as follows:
> ![3.jpg]
- - -
### 4. Current problems
> ##### Structural problems
>
> 1. The honeycomb wheels printed by TPU were originally designed to reduce shock so that the car does not land hard when coming down the stairs, but it seems that they are not soft enough. Next, the body design will be further optimized for shock absorption, such as increasing the honeycomb area, changing the honeycomb structure, and changing the material.
> 2. For stairs of different heights, the fixed wheelbase cannot fully adapt, so some attempts will be made on the adaptability of the frame. > 3.
The camera is not fixed in any way and has extremely poor stability. Next, a two-degree-of-freedom fixed seat will be designed for it to increase the visual range.
>
> ##### Circuit problems
>
> 1. The DC reduction motor is large in size and its controllability is not as good as brushless. The next step is to use BLDC and upgrade to six-wheel drive.
> 2. mpu6050 and 2.4G have not been used yet.
> 3. Due to unfamiliarity with the encoder, it was connected to a port without a timer function, which will be corrected in the next version.
>
> ##### Software issues
>
> 1. The control feel is too poor, not smooth.
> 2. The app UI is too ugly, I can't stand it.
> 3. The app displays little information, and I will try to add power and speed information
* * *
### 5. Upgrade plan
> Since I am already a junior, I no longer have enough time and energy. This training camp was hastily concluded, which is still a bit regrettable. Due to time, equipment and funds, many ideas have not been completed in time, and there may be little time to perfect them in the next few months. Therefore, I will list some of the points I want to do here first, and I will slowly complete them in the future depending on the situation. Friends who are interested in this project are also welcome to participate.
>* [ ] Optimize shock absorption structure
>* [ ] Design 2D-freedom camera mount
>* [ ] Replace motor with brushless motor
>* [ ] Overhaul APP UI, increase display content, replace operation with joystick, optimize motion control
>* [ ] Adapt xbox controller via Bluetooth
### VI. Demo video