aerobotics

【Training Camp】“HiSilicon Flow Horse”

 
Overview

HiSilicon luma driver board

picture.png
Everyone calls them dogs. When I first saw them, I thought of a wooden cow and a flowing horse. Let’s call it “Haisi’s flowing horse”. It not only promotes traditional culture, but also contains modern technology^ O ^. By the way, I quote an excerpt from the Internet. records:
**"**Zhuge Liang Collection" records: The method of making a wooden cow and flowing horse is as follows: The wooden cow has a square belly and a curved head, one leg and four legs, the head is in the collar, and the tongue is stuck in the belly. It can carry a lot but move little, so it should be used widely. Don't do it in small groups. Those who travel alone can reach tens of miles, and those who travel in a group can reach twenty miles. ... A man can walk six feet, an ox can walk four paces, carrying a year's worth of grain, and he can travel twenty miles a day, yet the man does not work very hard. The size of Liuma is ... two square bags, eight cents thick, two feet seven inches long, one foot six inches high and five minutes, one foot six inches wide, each containing two or three buckets of rice...

1. Main components of the circuit

picture.png

1. HiSilicon hi3861

The system-in-package module Hi3861IoTWiFi module of Chuanzhi Education based on Hi3861LV100 chip is used.

2.PCA9685

PCA9685 was originally a 16-channel LED controller controlled by I2C bus, but it was used as a servo driver. Each output has its own 12-bit resolution (4096 steps) fixed-frequency individual PWM controller operating at a programmable frequency from typical 24 Hz to 1526 Hz with an adjustable duty cycle from 0 to 100% .

3. Servo~~~~8 pieces

The steering gear is a position (angle) servo driver, suitable for control systems that require the angle to continuously change and be maintained. Steering gear is just a popular name, and its essence is a servo motor.
SG90 is an analog servo that needs to continuously send the destination PWM signal in order to rotate to the specified position. The control of the servo requires the MCU to generate a pulse signal with a period of 20ms and a high level of 0.5ms to 2.5ms to control the rotation angle of the servo.

4. Power chip DCDC XL1507 LDO SK1117-3.3

There are three levels of power input: INPUT-->DCDC-->LDO-->
External power supply (battery): 7-12V
Type C: 5V
IC power supply: 3.3V

5. usb to serial port circuit

Using USB to serial port chip CH340
Solution for connecting the microcontroller serial port: TypeC interface, using CH340C, IC unified 3V3 power supply

Important note : The final board is a simplified and optimized version , which is changed to a 6P typeC power supply. The onboard USB to serial port circuit is removed, and the layout is adjusted. The power bank on hand can be used for power supply without the need to purchase additional batteries. Overall The cost is reduced (in fact, the proportion of circuit cost in this project is not high), but it should be noted that the power bank needs an output of 5V2A or more, and it is best to support more than 3A, because the load is multiple servos. In the actual test, it was found that The power supply is unstable and the WIFI is old. Increasing the capacitors on 5V and 3.3V can solve the problem.
Do a test before applying the acrylic shell.
picture.png

2. Structural part

SolidWorks Structural Design
picture.png
Using acrylic to cut the shell
Several M2.5 screws, nuts and M1.7 self-tapping screws
I just got a charging board. The battery is relatively small and can be plugged into the circuit board just right. It’s just a bit expensive. Here’s what it looks like.
picture.png

picture.png

3. Software part

Since we are using Chuanzhi Education’s Hi3861IoTWiFi module, the software uses its Genkipi plug-in.

Programming and debugging using micorpython

picture.png
Refer to the gait generation software to generate gait instructions. They are all open source and there is nothing to talk about. You can search online. Just hang up a few pictures. ~~~~
picture.png





picture.png
picture.png
For the web page control part, the most important thing is to modify the html part in genki_web_ohosdog.c, including the interface and gait instructions.
After sorting out this code, you can see it very clearly. No wonder the control page actions are the same, and the gait instructions of the control code are the same. Waiting for you to change it.
"<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title> Chuanzhi Education Yuanqi Pai</title><style> body {user-select: none; text-align: center;} table {margin: 0 auto} td div {width: 150px;height: 150px;border: 1px solid darkgrey;display: flex;align-items: center;justify-content: center;color: black ;} #s {background-color: red;color: white;} td div:active {background: deepskyblue;color: white;} button {margin: 0.5rem;width: 9rem;height: 3rem;font-size: 1.2 rem;border-radius: 1rem;} button:hover {border-radius: 1rem;background-color: deepskyblue;color: aliceblue;}</style>
</head><body><h1>Hongmeng Dog Control</h1>
<button id="a">Installation mode</button><br>
<br>
<button id="b">Stay where you are</button><br>
<br>
<button id="c">Squat</button><br>
<br data-tomark-pass>
<button id="d">Forward</button><br data-tomark-pass>
<br data-tomark-pass>
<button id="e">Back</button><br data-tomark-pass>
<br data-tomark-pass>
<button id="f">Turn left</button><br data-tomark-pass>
<br data-tomark-pass>
<button id="g">Turn right</button><br data-tomark-pass>
<br data-tomark-pass>
<script> function u(p) {return ${p};}function g(i) {return document.getElementById(i);}function fe(e, f) {e.addEventListener('click', function (e ) {/* do something*/f();});}function fg(u, f) {let x = new XMLHttpRequest();x.onreadystatechange = function () {if (this.readyState == 4 && this .status == 200) {f(x);}};x.open("GET", u, true);x.send();}function fp(u, d, f, p) {let x = new XMLHttpRequest();if (p) {x.upload.addEventListener('progress', function (e) {p(e);});}x.onreadystatechange = function () {if (this.readyState == 4 && this.status == 200) {f(x);}};x.open('POST', u, true);x.timeout = 45000;x.send(d);}
fe(g('a'), () => {fg(u('/dog/init'), () => {});});
fe(g('b'), () => {let data = {"type": 3, "count": 30, "list": [[74, 111, 24, 151, 24, 151, 74, 111, 100], [24, 151, 74, 111, 74, 111, 24, 151, 100]]};fp(u('/dog/cmds'), JSON.stringify(data), () => {});});
fe(g('c'), () => {let data = {"type": 3, "count": 30, "list": [[74, 111, 24, 151, 24, 151, 74, 111, 100], [24, 151, 74, 111, 74, 111, 24, 151, 100]]};fp(u('/dog/cmds'), JSON.stringify(data), () => {});});
fe(g('d'), () => {let data = {"type": 3, "count": 30, "list": [[74, 111, 24, 151, 24, 151, 74, 111, 100], [24, 151, 74, 111, 74, 111, 24, 151, 100]]};fp(u('/dog/cmds'), JSON.stringify(data), () => {});});
fe(g('e'), () => {let data = {"type": 3, "count": 30, "list": [[74, 111, 24, 151, 24, 151, 74, 111, 100], [24, 151, 74, 111, 74, 111, 24, 151, 100]]};fp(u('/dog/cmds'), JSON.stringify(data), () => {});});
fe(g('f'), () => {let data = {"type": 3, "count": 30, "list": [[74, 111, 24, 151, 24, 151, 74, 111, 100], [24, 151, 74, 111, 74, 111, 24, 151, 100]]};fp(u('/dog/cmds'), JSON.stringify(data), () => {});});
fe(g('g'), () => {let data = {"type": 3, "count": 30, "list": [[74, 111, 24, 151, 24, 151, 74, 111, 100], [24, 151, 74, 111, 74, 111, 24, 151, 100]]};fp(u('/dog/cmds'), JSON.stringify(data), () => {});});</script></body></html>"

After a simple change, the effect is as follows:
picture.png
Time is short and the layout is not easy. This project has received about 6 or 7 express delivery. I originally had other ideas, but I can only improve them later. Ultrasonic waves, attitude sensors, etc. can also be added to expand its functions.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2024-11-22 17:36:10

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号