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.
Left: Tested using Dengge’s open source FOC2.0 board
Medium: 13*13cm Lichuang Purple PCB
Right: 10*10cm final version
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:
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 |
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 |
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
The specific items that need to be purchased are in the bill of materials.xlsx
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.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet