Product introduction: Developed based on the OpenHarmony open source Hongmeng system. The chip used is hi3861, which supports 16-channel servo control, GPIO, ADC, PWM and other operations.
Materials required: 7.4v lithium battery*1, sg90 steering gear*2, inner diameter 4mm, outer diameter 11mm, thickness 4mm rubber-coated bearing*4, M2*6 flat head screws*17, M2*6 self-tapping screws*4 (for reinforcement connection to the bearing)
Calf structure: constructed using 3D printed parts and connected using screws of the same specifications to reduce purchase costs
describe
For the first time drawing board, make it simple.
Appearance design
Even if you only have one leg, keep going! So I made him a skateboard.
In order for it to run, I couldn't drag the line, and at the same time, the control board didn't take up too much space, so I installed the board under the skateboard. Originally, I used M2.5*4 screws, but found that the installation was not firm, so I changed them to M2*6 screws, which protruded from the surface of the skateboard, but the screw specifications were still unified .
The small hole on the mounting shaft is used to expand the shaft diameter and prevent the bearing from slipping.
Legs based on human body bionic design
Reference picture (
The installation method can be seen in the picture below. The connecting rod with the steering gear has small teeth to prevent slipping.
Physical map
PCB
3D printing
The installation is complete
The servo on the left in the perspective of the picture below requires some effort to install. In fact, I originally wanted to use a direct insertion method to step on the skateboard with one foot and use the other foot to slide forward. However, considering the center of gravity, it was changed to this, resulting in the current position of the power interface being a bit awkward.
The two servos can be fixed with cable ties to reduce shaking. I put rubber patches on the soles to prevent my feet from slipping.
Precautions
7.4vPlease pay attention to the positive and negative poles of the power supply.
There is a problem with the reset button, do not solder it. You can use tweezers to short-circuit or use a two-pin button.
No one should do it, right?
Burning and Settings
Use the serial port cable to connect GND-GND, 3V3-3V3 , RXD-RXD, TXD-TXD to the computer
Open HiBurn.exe and press the image below to burn
After burning is completed, press reset again to see the device prompt information.
Connect to Hi3861's wifi, open 192.168.10.1, and click "dog control" in the application function below
Click "Installation Mode" (5V power supply is required to control the servo, disconnect the serial port and use 7.4v battery power supply, pay attention to the positive and negative poles of the power supply), and install as shown below
Software description
Load the genkipi plug-in in pycharm , and you can use pycharm to develop and control the legs through wifi or serial port. The example is as follows
# Control the angle of the two servos
dog.legAngle(0,(90,90))
from genki import dog
# Use json control
# count: number of loops
# Each array has 9 values. Each of the first 8 values represents the two servo angles of one leg. I only have one leg here, so I only need the first two angle values; the last one represents the time required for the servo to complete rotation.
if __name__ == '__main__':
dog.exec(
'{"type": 3, "count": 20, "list": ['
'[90, 90, 0, 0, 0, 0, 0, 0, 80], '
'[51, 60, 0, 0, 0, 0, 0, 0, 30], '
'[45, 55, 0, 0, 0, 0, 0, 0, 30], '
'[38, 50, 0, 0, 0, 0, 0, 0, 30], '
'[24, 40, 0, 0, 0, 0, 0, 0, 30], '
'[11, 30, 0, 0, 0, 0, 0, 0, 30],'
'[0, 15, 0, 0, 0, 0, 0, 0, 30],'
'[7, 40, 0, 0, 0, 0, 0, 0, 30] ]}'
)
The SDA pins and SCL pins of this project are GPIO13 and GPIO14 respectively. If you need to modify the bottom layer, please modify it in the main function.
IoTIoSetFunc(IOT_IO_NAME_13, IOT_IO_FUNC_13_I2C0_SDA);
IoTIoSetFunc(IOT_IO_NAME_14, IOT_IO_FUNC_14_I2C0_SCL);