王达业

【CW32】Xinyuan 4-axis aircraft

 
Overview
Preface
 
Since I completed the last training camp and saw the cooperation with Xinyuan Semiconductor in this training camp, I also have some ideas. I have always wanted to develop a small drone by myself. Although I had previously imagined using the more mature STM series open source solution, now that we have this training camp, we must support a wave of domestic chips
no matter what. So, I started Design of UAV flight control circuit and development of driving algorithm
Since the UAV needs to be miniaturized, I chose a brushed motor, powered by a 3.7V lithium battery, and adjusted speed through PWM signal
2022.08.18 Record: Basic Complete the development of the drone's hardware body, sensor driver and overall flight control algorithm.
 
Text
 
overview
 
MCU: using CW32F030C8T6 chip, external 8MHz crystal oscillator, providing SW & TTL two programming methods;
power supply: 3.7V lithium battery power supply, DC-DC Boost to 5V, then step down to 3.3V through LDO;
button & indicator: Reset button; 3.3V power LED indicator; 2 programmable LED indicators; 4 programmable WS2812B lamp beads;
core module: The overall design scheme of MPU6050 attitude sensor module; BMP280 air pressure sensor module; buzzer module; serial communication module; coreless motor (brushed) drive module
is as follows:
9EHmGTWJtYg059SXh6767jMDwFHq4Zbbw2cDvC3T.pngThe overall idea of ​​the flight control algorithm (refer to Station B - Fengling Tiantian) is as follows Figure:
X9uijtgoGp4PN8uZ1wLjEh10AT8Tkzswiw7hrd6D.png 
Function introduction PWM speed
 
regulation has been developed
 
: PWM signal has been generated through ATIM method & GTIM method to control the motor speed.
MPU6050 driver: Use the hardware IIC method to read the MPU6050 sensor data, and use the serial port to print and display it, as shown below:
         OqTviOqNfVLlVQtwMBJCxbYphSdkUmQlXoRDJGAP.pngAnonymous host computer debugging: Connect to the anonymous host computer, transmit attitude angle and other information, and debug the drone.
         Flight control algorithm: transplant the open source flight control algorithm and make targeted adaptation according to the characteristics of the CW32 chip; filter the MPU6050 raw data, combine it with the control instructions, and use double closed-loop PID control to realize UAV flight control.
WiFi control: Currently the TCP protocol + transparent transmission method is used for network connection; currently the PC debugging software is used to send flight control instructions; the ESP-01 module communicates with the CW32 through the serial port, obtains flight attitude information, and sends control instructions to CW32;
 
Advanced target!
Host computer development: Use C++ language and Qt to develop a PC-side host computer that communicates with the ESP-01 module through WiFi. It can display aircraft status information in real time, provide virtual joystick mapping, and perform flight control through keyboard keys.
 
        GlebTZVLUlOSg7XPqwMzzhs5ci294DKSbFmtTZ35.png 
Physical picture of the finished product in
 
flight control circuit board
GD0tLFHUsNUuZnJlIEDnoC0NRSzndYlwBkCxWxaK.png 
testing (temporarily using a third-party rack, and will design and print the adapted rack by ourselves in the future~)
b4WlawSC1FhSSfYflnNkkuLd3hkWFcsjBv7jsaKz.png 
To be continued
 
I have been quite busy in the past month, publishing papers, working on projects, etc., there is no need for this The man-machine solution itself is also a bit more complicated, resulting in slow progress, but I still feel sorry for it; I
finally insisted on completing it. Although there are some flaws (the PID parameters need to be tuned), I will continue to improve, so stay tuned!
 
 
 
 
 
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-24 13:36:34

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号