Professional Documents
Culture Documents
Hanoi University of Science and Technology School of Electrical Engineering
Hanoi University of Science and Technology School of Electrical Engineering
Hanoi, 2021
1
Table of contents
Abstract............................................................................................................................................4
I. HARDWARE DESIGN...........................................................................................................4
1. Object Brief Description.......................................................................................................4
2. Concept design......................................................................................................................4
2.1 Design requirement............................................................................................................4
2.2 Block diagram....................................................................................................................5
3.Hardware design details............................................................................................................7
3.1 Battery circuit.....................................................................................................................7
3.2 Voltage regulator................................................................................................................9
3.3 Sensors..............................................................................................................................10
3.4 Driving Circuit.................................................................................................................15
3.5 MCU selection..................................................................................................................17
II. SOFTWARE DESIGN...........................................................................................................20
1. Finite State Machine...........................................................................................................20
2. Detailed software design........................................................................................................21
2.1 Main program...................................................................................................................21
2.2 Unit control.......................................................................................................................22
2.3 Motion control..................................................................................................................23
2.4 Other subroutines.............................................................................................................24
Conclusion.....................................................................................................................................24
References......................................................................................................................................25
2
List of figures
Figure 1: Design Concept................................................................................................................5
Figure 2: General block...................................................................................................................6
Figure 3: Component selection........................................................................................................7
Figure 4: Battery circuit Altium design...........................................................................................8
Figure 5: Voltage regulator Altium design....................................................................................10
Figure 6: LSM303CTR specifications...........................................................................................11
Figure 7: LPS22HB specifications................................................................................................12
Figure 8: L3GD20 specifications...................................................................................................13
Figure 9: Sensors Altium design....................................................................................................14
Figure 10: Servo driver Altium design..........................................................................................16
Figure 11: BLDC driver design.....................................................................................................17
Figure 12: STM32F411 Altium design..........................................................................................18
Figure 13: STM32F411 pin configuration.....................................................................................19
Figure 14: Finite state machine of Unit Control............................................................................20
Figure 15: Request Resolver..........................................................................................................21
Figure 16: Main program architecture...........................................................................................21
3
Abstract
Rocket is a system with multiple inputs and multiple outputs that has unstable dynamics, non-
linear, high order, and sensitive to external disturbances. In this project, we propose a design of a
controller which maneuvers the process of hovering, landing and take off vertically of a rocket.
This project was inspired by SpaceX Falcon 9 rocket.
I. HARDWARE DESIGN
1. Object Brief Description
Model of the rocket used as the objective in this project:
- Main thrust is generated by two co-axial propelled BLDC motors pointing downward,
each rotates at inversed directions to cancel angular momentum. The air thread is pushed
through 4 independent tail wings then the thrust vector is controlled by tunning these
wings by attached servos.
- On the top, 4 auxiliary brushless motors act as side thrusters, providing
the horizontall forces to help balancing the rocket.
- Battery provide energy for the whole system.
Our aim on this project is to design a controller for the above rocket model
which is capable to mimic the basic operations of SpaceX Falcon 9 including
these actions:
- Vertical take-off: The rocket can take off only by the motors in the
bottom. 4 motors on the top can support this action.
- Hovering: The main motors and 4 motors on the top need to run
properly to keep the rocket stable.
- Vertical landing (main goal): perform the re-entry process and land the
rocket gently even from the free fall state.
2. Concept design
2.1 Design requirement
a) Main thrust control:
4
c) Input parameters:
-Acceleration: required to perform motion planning and free fall detection
-Height: required to determine position of the rocket on the air
-Coordinates: determine yaw, till, pitch of a flying vehicle.
d) Remote control:
- In order to receive commands from the station while flying, a radio-based communication is
required
e) Power supply
- Main power source is battery, secondary power source for other devices on board is regulated
from main battery.
-Battery management system
Function Design Requirement Hardware Requirement
-2 outputs for ESC (each up
2 BLDCs control to 30A)
Main thrust vectoring
4 tail wings control -4 outputs for servos
5
Figure 2: General block
b) Components
Functions Requirements Components
- Small range: ±2g, ±4g
- I2C/SPI bus interface
Accelerometer LSM303C
- Voltage supply: 3.3VDC
- IC module
- Altitude resolution of 10cm
- I2C/SPI bus interface
Barometer LPS22HB
- Voltage supply: 3.3VDC
- IC module
Gyroscope - I2C/SPI bus interface L3GD20
6
- Voltage supply: 3.3VDC
- IC module
- SPI connection
LoRa - Voltage supply: 3.3VDC AIThinkerRA02
- IC module
- Voltage: 14.8VDC
- Thrust: 1000gf
2 main thrust BLDCs SunnySky X2216 Kv1100
- Amps: 14.2A
- Max. Speed: 15,000rpm
Propellers - Size: 9 inch Propeller APC 9047
- Current: 30A
- Protocol: Dshot600 with
ESCs for main thrust BLDCs KISS ESC 25A 2-5S
26.7us latency
- Individual ESC
- Voltage: 14.8VDC
4 side thrust BLDCs
- Thrust: 500gf SunnySky X2216 Kv880
- Max. Speed: 10000rpm
Propellers - Size: 4 inch Propeller APC 4x4.7
Servo SG90
- Current: 30A
- Protocol: Dshot600 with
ESCs for side thrust BLDCs 26.7us latency 4-in-1 KISS ESC 25A 2-5S
- 4-in-1 ESC or 4 individual
ESCs
- Input voltage: battery voltage
Buck converter LM2596
- Output voltage: 12V
- Input voltage: battery voltage
Buck converter LM2596
- Output voltage: 3.3V
Battery - Max. current: 30A LiPo 4S 6C 5000mAh
Fuel guage - MAX17055
- Reversed battery protection
Battery protection circuit RBO08
- Overvoltage protection
Figure 3: Component selection
7
Monolithic structure for greater reliability.
To determine battery state-of-charge (SoC) and state-of-health, fuel gauge MAX17055 is used.
The MAX17055 will send signal to microcontroller through I2C wire. Microcontroller will know
the status of the battery and then have proper actions. The MAX17055 automatically
compensates for cell aging, temperature, and discharge rate. The device also provides an accurate
state-of-charge (SoC in %) and the remaining capacity in milliampere-hours (mAh).
8
3.2 Voltage regulator
In this system, 14.8V input voltage is applied. However, some components only operates at
voltage of 3.3V (sensors, microprocessor, LoRa) and 12V (servos and servo drivers). Therefore,
buck converter is needed to step-down the input voltage to appropriate values.
The LM2596 used in this project provides all the active functions for a step-down (buck)
switching regulator:
9
Figure 5: Voltage regulator Altium design
3.3 Sensors
To control the rocket, the controller needs accurate information about the status of the rocket
such as altitude, acceleration, speed and angle between the rocket axis and vertical axis.
Therefore, accelerometer, barometer and gyroscope with high resolution and high speed is
needed in the system.
a) Accelerometter: LSM303CTR (ST Microelectonic)
Accelerometer will measure linear acceleration, inclination and vibration of the rocket. This
sensor communicates with MCU through I2C/SPI interface. The LSM303C is a system-in-
package featuring a 3D digital linear acceleration sensor and a 3D digital magnetic sensor. Some
key features of this sensor:
Magnetic field channels and 3 acceleration channels
±16 gauss magnetic full scale
±2/±4/±8 g selectable acceleration full scale
16-bit data output
SPI / I2C serial interfaces
Analog supply voltage 1.9V to 3.6V
Power-down mode / low-power mode
Programmable interrupt generators for free-fall, motion detection and magnetic field
detection
Embedded temperature sensor
10
Figure 6: LSM303CTR specifications
11
Figure 7: LPS22HB specifications
12
Figure 8: L3GD20 specifications
13
Figure 9: Sensors Altium design
14
3.4 Driving Circuit
The Driving block includes 2 separate operations: Servo driver and Thrust driver.
a) Servo Driver
There are 8 servos used in the project. Each is attached to a fin. The fins is constructed in
the top and at the bottom of the rocket. By rotating the fin through servo, the rocket can
change the direction and balance in the air.
Due to the fact that the number of servos is big, it is very hard to find a MCU with many
PWM signal outputs to drive those servos. To solve this problem, the DRV8860 is used.
The DRV8860 provides a 8-channel low-side driver with overcurrent protection and
open/shorted detection. A serial interface is provided to control the DRV8860 output
drivers, configure internal setting register and read the fault status of each channel.
DRV8860 will be daisy-chained with the MCU to use this serial interface in the project.
The 8 output of the DRV8860 will transmit PWM signals to drive 8 servos. PWM duty
cycles are configurable through serial interface as well.
15
Figure 10: Servo driver Altium design
b) Thrust Driver
The rocket needs 6 brushless DC motors to produce thrust. The 2 main thrust BLDCs are
constructed in the bottom of the rocket and the 4 side thrust BLDCs are located on the top
of the rocket. To control the speed of these BLDCs, 2 KISS ESCs 25A and a 4-in-1 KISS
ESC 25A are used. Operating voltages of these ESCs are 6-24V/2-5S LiPo, so the power
can be supplied by the LiPo battery used in the system.
6 PWM signals is needed from the MCU to the ESCs to control the speed of the BLDCs.
16
Figure 11: BLDC driver design
17
• 11 timers, 16- and 32-bit, running at up to 100 MHz
18
Figure 13: STM32F411 pin configuration
19
II. SOFTWARE DESIGN
1. Finite State Machine
20
Figure 15: Request Resolver
In the main program, unit control and request resolver are 2 indepentdent states then we design them as
polling data processing type so that each loop, requests are updated.
#
Define constants;
Initiate ISR(); \\ initiate interrupt which check if deflection
detected and then stablize the rocket
Main(){
Declare global variable();
While(1){
Request_Resolver();
Unit_control();
}
}
21
#
Case on_land:
22
}
Case Going_down:
23
Case Hover:
Conclusion
In this project, our group designed a flight controller for vertical landing rocket which capable of control
a rocket to perform simple tasks. Although the design is quite simple and may not work in reality, we
have try our best since this is a hard topic to deploy. However, we have gain knowledges about
Embedded control system designing process, and some details about synchronous communication method
including SPI and I2C and many other fields relating to the subject. We hope that in the future, this design
can be completed and our rocket could fly and land successfully.
24
References
[1] Datasheet of MEMS nano pressure sensor: 260-1260 hPa absolute digital output barometer:
LPS22HB, ST Microelectronics
[2] Datasheet of MEMS motion sensor: three-axis digital output gyroscope: L3GD20, ST
Microelectronics
[3] Datasheet of Ultra-compact high-performance eCompass module: 3D accelerometer and 3D
magnetometer: LSM303CTR, ST Microelectronics
[4] MB1115-F411VE-C01 Board Schematic 1.0, ST Microelectronics
25