toothache

Who can resist a cool balancing cube Cubli_Mini?

 
Overview
The ID of this project comes from Cubli of ETH Zurich, and the motor driver uses Simple FOC. Low cost, small, and simplified as my first open source project
The project is completely open source. Anyone can use the Github content for free. Of course, you can also click Star

introduce

This project is based on the original Cubli, removing the active braking, reducing the size and making certain simplifications. It needs to be manually adjusted near the balance point to achieve edge and point balance. Cubli_Mini is a 10 10 10CM cube that integrates motor drive, charging and discharging. When fully charged, point balance can last for ≥5 hours without disturbance.
Project cost: ≤800RMB

Information description

  • 3D model design source file
  • Main control module, IMU module, encoder module, download module hardware engineering
  • Main Control 1, Main Control 2 Software Engineering
    • The main control module uses two ESP32
  • Network debugging assistant
    • WIFI parameter adjustment use
  • Various documentation descriptions
    • Some descriptions of the project, such as parameter adjustment, key operations, control principles, etc.
  • Proofing file
    • STL format 3D printing files
    • DWG format sheet metal files
    • BOM table
      • Structure BOM table
      • PCB components BOM list

structural design

Since I have only learned SW for a week, I will miss some details on some parts, such as screw threads, copper column internal threads, etc.
Sheet metal parts such as the outer frame are made of lower-cost fiberglass boards to reduce costs while ensuring rigidity. The momentum wheel is made of 304 stainless steel, which can provide a large moment of inertia in a small volume. Supplemented by a small number of 3D printed parts. The connectors use anodized aluminum posts for aesthetic reasons, but you can also use lower-cost copper posts yourself. The cost of the overall structural parts is less than 350 yuan, and the replacement of aluminum columns with copper columns can be reduced to less than 290 yuan.
Precautions:
  • The eight corner points of Cubli_Mini are composed of two different corners, named corner 1 and corner 2, 4 each
  • The structure at the connection between the outer frame and the corners is not symmetrical at 45°, so there is an installation direction. For details, see DoC/Structure and Installation Instructions.

circuit module

Main control module:
  • The main control module integrates 3 motor drive circuits, battery charging and discharging circuits, step-down voltage stabilizing circuits, and CAN communication circuits.
  • Since a single ESP32 only has 6 motor PWM channels, two ESP32 modules are used, and CAN is used as the communication method between MCUs. Since the two ESP32s are integrated on the same motherboard, in order to save IC costs, CAN can be Modify to various short path communication methods such as IIC, UART, SPI, etc. However, the main control software and hardware need to be modified. Students with ideas can modify it by themselves.
  • For the motor drive circuit, refer to the Simple FOC open source circuit, Simple FOC link: https://github.com/simplefoc . Battery charging and discharging reference: https://oshwhub.com/qqj1228/zi-ping-heng-di-lai-luo-san-jiao_10-10-ban-ben
IMU module:
  • Use the most common MPU6050
  • To prevent stress, dig grooves in the area where the IMU is located to reduce installation stress. However, the use of three screws for hard connection cannot avoid stress problems. The improvement plan is to use soft washers and tighten only one screw to further reduce stress.
  • Since the IMU installation requirements are relatively high, when mounting, try to ensure that the MPU6050 is parallel to the PCB and located in the center of the pad.
Encoder module:
  • It uses the lower-cost AS5600, which is cheap and easy to use at low speeds.
Automatically download modules:
  • In order to reduce the main control area as much as possible, the automatic download circuit is taken out separately. Refer to the official automatic download circuit.
Precautions:
  • Under normal circumstances, the automatic download module welds the pin headers, and the main control does not weld any pin headers/female headers.

Firmware instructions

The core content of Cubli_Mini is the Simple FOC motor drive library and point balance control algorithm, which run in MCU1. MCU2 just uses the Simple FOC library to control motor 2 and motor 3, using CAN to feedback and receive control commands.
MCU1 firmware description:
  • bsp: Based on the arduino library, LED, KEY, ADC, non-volatile storage and other contents are encapsulated
  • comm: public class, currently only encapsulates a time class, obtaining time difference, non-delay waiting and other simple contents
  • control: core library, which contains the balancing algorithm and parameter adjustment interface. For parameter adjustment, please refer to the Simple FOC format. For ease of use, strings are used instead of traditional hexadecimal protocols.
  • main: main file, driver initialization and FreeRTOS task creation
    • ESP32 officially runs WIFI and Bluetooth classes on Core0. Therefore, when creating a task, create the WIFI task in Core0 and the others in Core1. I only added mutex locks for data interactions running on different core tasks.
Precautions:
  • Currently, the WIFI SSID, PSW, and TCP Server IP Port are all hard-coded into the firmware. Therefore, if you want to use WIFI parameter adjustment, you need to modify these contents. For details, please see Doc/Usage and Parameter Adjustment Instructions.

Proofing instructions

Considering that many students may be doing structural proofing for the first time, proofing files are provided.
3D printing:
  • The file is located at: /6.Process/3D printing. The file is in STL format. For the number of proofs, please check the <3D printing processing instructions> in the same directory. You can proof at the future factory or Jialichuang. Light curing is preferred.
  • The file name uses the material number. The material number is convenient for management. If the number does not end with .X, it means the first version.
Sheet metal parts proofing:
  • The file is located at: /6.Process/Sheet Metal Parts. Each material has corresponding PDF and DWG files. The PDF file is easy to view, and the DWG file is used for laser cutting/sheet processing . **Please check the "Sheet Metal Processing Instructions" in the same catalog for the number of proofs. You can find Taobao to process the drawings directly. Since the processing accuracy is not high, for personal use, the tolerance depends entirely on the mood of the processing factory.
  • You can also directly find the corresponding step file for Taobao to process.
PCB proofing:
  • From Hardware Engineering, take the PCB file and go out and turn left to Jialichuang.
BOM table:
  • The file is located at: /6.Process/ BOM
  • Structural BOM list, which lists the structural materials and links that need to be purchased
  • The PCB BOM table lists the components and materials that need to be purchased. You can also find the AD project export by yourself.
  • Precautions:
    • The PCB BOM table is exported from the AD source file. There will be repeated materials in the project, so you need to pay attention to it.
    • DRV8313, ESP32, AS5600, and IMU can be purchased on Taobao. For others, please go to the BOM list of Lichuang Mall to place an order.
    • Pay attention to the packaging of SMD aluminum electrolytic capacitors. The main control board has a limited height area, and the height limit is 8mm.
    • If there are any omissions in the document, please remind me.
Tutorial on white prostitution for novices:
  • The file is located at: /Doc/Free Prostitution Tutorial for Novices.pdf, which will teach you step by step how to complete this project.

control algorithm

Cubli_Mini uses LQR for control, and can also use cascade PID for control. The code is located in/needs modification/MCU1/control/cubli_mini
Side balance :
  • You can refer to the first-order inverted pendulum for modeling and solving parameters. Since the parameters for establishing the model are difficult to obtain accurately, the parameters I obtained are slightly different from the optimal parameters. Therefore, most of this project uses metaphysical parameter adjustment engineers to adjust parameters.
Point balance:
  • Add control of the X and Z axes on the basis of edge balancing. Use the same control method as edge balancing, see Doc/Control Principle for details.
Research type:
  • Please see the original Cubli paper

Adjust parameters

Adjustment method:
  • You can use UART and WIFI for parameter adjustment. WIFI needs to be connected to the router. Cubli_Mini is a TCP client.
Adjustment command:
  • For detailed commands, please see the Doc/parameter adjustment command description.

参考设计图片
×
Design Files
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-07-01 01:06:18

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号