Skip to content

ufnalski/one_dof_copter_bno055_l432kc

Repository files navigation

1-DOF copter portable demonstrator (STM32L432KC)

An STM32 HAL example of PID control for a 1-DOF copter. The demo features an ESC (electronic speed controller) that supports DShot (Digital Shot) protocol, and an AHRS from Bosch Sensortec.

1-DOF copter on tarmac

Video: 1-DOF copter in action

Motivation

When you have an ESC and an AHRS up your sleeve you should definitely combine them into a 1-DOF copter! Such a copter poses an excellent plant1 to elevate your control system design skills. Let's then play with practical PID controllers. Integrator anti-windup and band-limited differentiator will be your best companions for that journey.

Missing files?

Don't worry 🙂 Just hit Alt-K to generate /Drivers/CMCIS/ and /Drivers/STM32L4xx_HAL_Driver/ based on the .ioc file. After a couple of seconds your project will be ready for building.

Exemplary hardware

  • Talon32 Slim 40A AM322 128K 3-6S (Skystars)
  • V2306/V2207 V3.0 VELOX 2550KV (T-MOTOR)
  • HQProp S4 Lemon Lime (Ethix)
  • 2200mAh 11.1V 30C 3S1P LiPo battery (Gens ace)

Compatible software (configuration tool)

New to practical PID controllers?

Note

My favorite anti-windup technic is the one discussed by Brian Douglas. You can switch between the two by commenting or uncommenting #define PHIL_S_LAB.

New to the AM32 project?

AM32 ESC Setup 1

AM32 ESC Setup 2

Warning

Propellers that spin at tens of thousands rpm are not toys ❗ Safety first: LEGO 43038.

Warning

LiPo batteries are not toys either - learn to handle them before you use one in your project ❗

Sources and inspirations

Call to action

Create your own home laboratory/workshop/garage! Get inspired by ControllersTech, DroneBot Workshop, Andreas Spiess, GreatScott!, ElectroBOOM, Phil's Lab, atomic14, That Project, Paul McWhorter, and many other professional hobbyists sharing their awesome projects and tutorials! Shout-out/kudos to all of them!

Warning

Feedback control systems - do try them at home ❗

200+ challenges to start from: Control Engineering for Hobbyists at the Warsaw University of Technology.

Stay tuned ❗

Footnotes

  1. https://en.wikipedia.org/wiki/Plant_(control_theory)]

  2. They used to be shipped with the BLHeli_32 firmware. Recently the manufacturer switched to the AM32 firmware. Both of them support DShot300 and can be used interchangeably in this mini-project if DShot300 is selected. Similar exchangeability is not possible if DShot150 is opt for - the AM32 firmware does not support DShot150, which is totally understandable within the context of modern drones.