qoistoochee128

【Training Camp】Bionic Robot Dog

 
Overview
Bionic robot dog based on HiSilicon Hi3861 chip

circuit design

Leg 8-way servo drive + 8-way servo expansion interface
  • 2-way ultrasonic distance sensor
  • MPU6050 attitude sensor
  • Can be externally connected to ESP32-CAM to transmit real-time video
  • 2S lithium battery balance charging, using TP5100 solution
  • With battery voltage monitoring and charging status monitoring
The main control is Chuanzhi Education  ITCAST-HI3861 , which uses STC8G2K64S4 as the servo driver and ultrasonic ranging. STC8G2K64S4 and MPU6050 are connected to ITCAST-HI3861 as slaves through the I2C bus.

structural design

The structure is designed and simulated using Creo software. The fuselage structure uses 3mm acrylic panels, the rest are 3D printed parts, and bearings are used in the joints.
20220705151926.png

Material costs

  1. Screws and other hardware¥34
    1. Several M3X8, M3X12, M3X16 large flat head screws
    2. Several M3 nuts
    3. Several M3 knurled nuts
    4. M3 lock nut x8
    5. M4X8 large flat head screw x32
    6. M4 lock nut x32
    7. Stainless steel washer 3*6*0.5 x40
    8. Nylon washer 3*12*1 x8
  2. Bearing¥37
    1. Inner diameter 3 Outer diameter 8 Thickness 3 x20
    2. Inner diameter 9 Outer diameter 14 Thickness 3 x 4
  3. Acrylic shell¥30
  4. MG995 steering gear (8 pieces)¥100
  5. 25T aluminum alloy steering gear arm (4 pieces)¥20
  6. 25T aluminum alloy steering gear disc (4 pieces)¥10
  7. Battery (three-wire interface 7.4V2200mAh)¥23

software design

STC8G2K64S4

    A total of 16 PWM outputs, PWM00-PWM03, PWM10-PWM13, and PWM20-PWM27, 2 PCA input captures, and an I2C interface are used. Use I2C to read and write registers to control PWM output, ultrasonic trigger and result output.

ITCAST-HI3861

    The code is modified from  ohosdog: the open source Hongmeng Bionic Dog teaching source code (gitee.com). It  mainly replaces the servo driver  PCA9685 and changes it to STC8 implementation, and implements battery voltage monitoring, charging management, and serial communication functions.

Robot dog debugging software

    In order to facilitate gait design, gait reverse analysis, and debugging, a PC software has been designed. The code has been open source. Please see the video attachment for how to use it.
QQ screenshot 20220718171844.png
The following is the main code of the dog-leg inverse solution. The inverse solution algorithm is mainly based on the cosine theorem, in which the origin of the coordinates is defined as the root of the joint, the X-axis is horizontally forward, and the Y-axis is vertically downward.

#define LEG_R1 80.0f // Thigh length
#define LEG_R2 82.0f // Calf length
#define LEG_R3 22.0f // Calf fulcrum length
#define LEG_R4 80.0f // Calf link length
#define LEG_R5 24.0832f // Linkage bracket radius
#define LEG_A5 96.73f // Linkage bracket arc angle
#define LEG_R6 30.0f // Thigh link length
#define LEG_R7 20.6f // Servo arm radius
#define SERVO_DIST_V 20.0f // AB servo axis vertical distance
#define SERVO_DIST_H 21.2f // AB servo axis horizontal distance

#define SERVO_DIST_D sqrt((SERVO_DIST_V * SERVO_DIST_V) + (SERVO_DIST_H * SERVO_DIST_H))
#define DEG_TO_RAD(A) ((A) * M_PI / 180.0)
#define RAD_TO_DEG(A) ((A) * 180.0 / M_PI)

void inverse(struct Point_t p, double* output) {
    double d2 = px * px + py * py;
    double d = sqrt(d2);
    double a = (d2 + ((LEG_R1 * LEG_R1) - (LEG_R2 * LEG_R2))) / (2.0 * d);
    double o1 = acos(a / LEG_R1);
    double o2 = acos(py / d);
    double o3 = o1 + acos((d - a) / LEG_R2);
    double k2 = ((LEG_R1 * LEG_R1) + (LEG_R3 * LEG_R3)) - (2.0 * LEG_R1 * LEG_R3) * cos(o3);
    double k = sqrt(k2);
    double m1 = acos((k2 + ((LEG_R1 * LEG_R1) - (LEG_R3 * LEG_R3))) / ((2.0 * LEG_R1) * k));
    double m2 = acos((k2 + ((LEG_R5 * LEG_R5) - (LEG_R4 * LEG_R4))) / ((2.0 * LEG_R5) * k));
    double m3 = px > 0.0 ? o1 - o2 : o1 + o2;
    double m4 = (2.0 * M_PI - DEG_TO_RAD(LEG_A5) - acos(SERVO_DIST_V / SERVO_DIST_D)) - m1 - m2 - m3;
    double g2 = ((LEG_R5 * LEG_R5) + (SERVO_DIST_D * SERVO_DIST_D)) - (2.0 * LEG_R5 * SERVO_DIST_D) * cos(m4);
    double g = sqrt(g2);
    double t1 = acos((g2 + ((SERVO_DIST_D * SERVO_DIST_D) - (LEG_R5 * LEG_R5))) / ((2.0 * SERVO_DIST_D) * g));
    double t2 = acos((g2 + ((LEG_R7 * LEG_R7) - (LEG_R6 * LEG_R6))) / ((2.0 * LEG_R7) * g));
    double t3 = acos(SERVO_DIST_H / SERVO_DIST_D);
    double servo_A = 45.0 - RAD_TO_DEG(m3);
    double servo_B = 135.0 - RAD_TO_DEG(t1 + t2 + t3);
    output[0] = servo_A;
    output[1] = servo_B;
}

Physical display

IMG20220719214234.jpg
IMG20220719214352.jpg

There is a problem

  • After the actual installation, with the battery in hand, the weight exceeds 1KG. Replacing the acrylic shell with a carbon fiber board should reduce a lot of weight and increase strength.
  • The current continues to be around 2A during operation, and the battery life is poor when using a 2200mAh 7.4V battery (it is later envisaged to add a wireless charging module to the chassis and automatically navigate for charging).
  • Because the lithium battery charge management chip TP5100 was burned during the debugging process, the lithium battery balance charge and discharge could not be tested.

Video display


参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-10 02:38:14

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号