JFET

Self-balancing Lello triangle_esp32_rechargeable_10*10 version

 
Overview

Self-balancing Lello triangle rechargeable version

introduce

Based on the "self-balancing Lello triangle based on LQR controller" at Station B, a charging module is added. The main control chip uses ESP32 and is equipped with a parameter adjustment host computer, which can easily adjust parameters wirelessly through wifi. Brushless control uses Dengge’s open source FOC. Create a self-balancing Lello triangle that is easy to reproduce. It is a very good display video as an ornament on the table_None yetThe stuff was already finished, but I was too overwhelmed by asking me to record a video of the production process from scratch. Recording - Create a new folder

The project git program is downloaded from git itself. The program should not be changed anymore. The markdown may be modified.

show.png

Left: Tested using Dengge’s open source FOC2.0 board

Medium: 13*13cm Lichuang Purple PCB

Right: 10*10cm final version

1 Software architecture

Modify the original author's self-balancing control voltage algorithm and change the voltage control to speed control. Makes control of the model physically easier to understand. And the code parameters can be adjusted through the wifi connected to the ESP32. The specific features are as follows:

  • Based on Arduino : running on ESP32 Arduino
  • Rich control modes : voltage control and speed control

gui_main.jpg

2 Hardware features

illustrate parameter
Lello Triangle Dimensions 100*100mm
Momentum wheel size 80*80mm
Battery*3 Thickness x length x width: 7.9mmx25mmx40mm
Input voltage 3.7v lithium battery*3
Charging voltage 5V input from Type-C port
Charging chip CS5095 5V input, maximum 1.2A charging current
Serial chip CH340C Need to turn on the switch to download
Master chip ESP-WROOM-32
Motor driver chip L6234PD Pins: 32, 33, 25, 22; 22 is enable
AS5600 encoder SDA-23 SCL-5
MPU6050 six-axis sensor SDA-19 SCL-18

3 Instructions for use

  1. Go to Dengge’s open source FOCgit to download the Arduino development environment (You can also download Arduino and install SimpleFOC yourself) and open main in Arduino in this project, and burn the program to ESP32.
  2. Open FOC_gui.exe in python_gui in this project and connect to WIFI: ESP32. Click Settings to start adjusting parameters.

For example, if the balance angle is 90 degrees, enter: TA90, and it will be stored in the eeprom position 0. Note: The wifi command cannot be sent too fast , because it will be saved into the eeprom every time, and the K parameter is not saved into the EEPROM, so you can use the slider. Adjustment.

Parameter command illustrate
TA target_angle balance angle for example TA89.3 set balance angle 89.3
SV swing_up_voltage Swing voltage is a voltage that swings left and right. The larger it is, the faster it reaches equilibrium, but if it is too high, it will overshoot.
SA swing_up_angle When the swing angle is still a few degrees away from the balance angle, switch to self-balancing control
VP1 P of the PID of the speed loop, 1 is the P value before stabilizing at the equilibrium angle
VI1 The I of the PID of the speed loop, 1 is the I value before stabilizing at the equilibrium angle.
VP2 P of the PID of the speed loop, 2 is the stable P value
VI2 The I of the PID of the speed loop, 2 is the I value after stabilization
K 1 1 1 and 2 are voltage control parameters. LQR parameter 1*angle difference
K 1 2 1 and 2 are voltage control parameters. LQR parameter 2*left and right tilting acceleration
K 1 3 1 and 2 are parameters during voltage control, and 3 and 4 are parameters during speed control. LQR parameter 3*current speed

4 Hardware design

Use Lichuang EDA to draw the circuit schematic diagram, and LaserMaker to draw the Lello triangle and momentum wheel (there is a laser cutting machine that can cut the structure in advance as a reference). Import the drawn graphics into Lichuang EDA and use it as the outer frame of the PCB. The silk screen patterns are Gawr Gura and ouro kronii helicopter

The plt drawn by LaserMaker is in the Lello triangle structure folder

Thanks to Jialichuang's PCB board manufacturing, DIY circuit production has become very convenient

Lello triangle PCB

momentum wheel

The specific items that need to be purchased are in the bill of materials.xlsx

5 Ctrl+C +V (reference)

The control algorithm on Arduino is the original author's LQR, and the brushless motor control is Dengge's open source FOC. The motor control pin definition and sensor definition are the same as the Dengge open source FOC control board version 2.0.

The GUI for Python is SimpleFOC's SimpleFOCStudio.

The charging circuit is the open source CS5095 charging solution of Lichuang Plaza.

  1. Original author: Self-balancing Lello triangle BV19v411n7mN based on LQR controller
  2. Deng Ge’s open source FOC https://gitee.com/ream_d/Deng-s-foc-controller
  3. Charging chip circuit https://oshwhub.com/Aknice/cs5095e-san-jie-li-dian-chi-sheng-ya-chong-dian-dian-lu

6 useful places

  1. The command.h and command.cpp in the Arduino program can support arbitrary string input. It can also be used in other projects, whether it is string data received by wifi or string data from the serial port.
  2. The GUI host computer can continue to be used in other wifi projects, and it is very convenient to adjust parameters.
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-07-19 18:19:30

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号