The introductory story is told here. The actuator comes with a quadrature encoder. An absolute encoder is added to make it more versatile didactic aid. Affordability of DIY projects is our priority, therefore AS5600 is selected - a popular choice among DIY-ers. We are going to close a speed control loop. A simplified control structure without a current/torque control loop will be used. A proportional-integral controller is to be deployed. Here you can get familiar with the relevant practicalities such as anti-windup and discretization. Your task will be to add outer position control loop. If constant references are to be tracked and constant disturbances are to be rejected it is sufficient to deploy the proportional controller, assuming that the speed controller contains the integral part. Why? Apply the internal model principle to demonstrate that. Have fun with feedback control systems!
Important
This is not a precision drive - the planetary gear has a noticeable backlash (it's a 10-year-old used part), the magnet alignment is not great (notice my "very" rapid prototyping approach with rubber bands), and the whole assembly is not vary stiff (the magnet is not even glued to the shaft). On the positive side, such a setup let's you observe how the magnet misalignment (incl. eccentricity) affects the sensor operation. Building physical drives gives you additional insights into phenomena related to their operation - phenomena we simplify or even completely neglect when playing with basic numerical simulation models.
Tip
Not happy with the speed ripples you get even though everything seems to be sound mechanically? Maybe the resolution of your encoder is too low. You may also experiment with low-pass filtering of measured speed. The two firsthand choices are increasing the sampling period (averaging is low-pass filtering) or adding a first-order lag element (repurpose the one on in the code of pulse timing for the incremental encoder - now it's there just for HMI purposes and that is why it has such a big time constant set). You should also check your encoder - some devices offer edge computing in the form of configurable filters. Be aware that such filtering always comes at a cost - notice that you have to slow down the transients to keep similar overshoot. Lowering the frequency bandwidth of the measurement system helps tackle noise but at the same times distorts information about the plant state by introducing a phase shift (a delay) and an amplitude attenuation. We are going to improve the drive response during the classes.
- ams AS5600 Position Sensor (ams OSRAM)
- AMS AS5600 Driver (Raul Gotor, raulgotor) [MIT license]
- stm32-ssd1306 OLED driver (Aleksander Alekseev, afiskon) [MIT license]
- Serial plotters (a bunch of serial plotters I've played with)
- web-serial-plotter (sekigon-gonnoc) [MIT license]
- Audi A7 Stabilus POWERISE actuator
- AS5600 magnetic encoder
- BTS7960B H-bridge converter
- SoC indicator
- Gens ace G-Tech 5500mAh 11.1V 3S1P 60C HardCase
- ams AS5600_SO_REF_RB Reference design board (ams OSRAM) [convenient if you plan to develop an encoder knob]
Don't worry 🙂 Just log in to MyST and 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.
Build a fully-blown control system with an inner current/torque control loop. A selection of Hall-effect current sensors can be found here.
Create your own home laboratory/workshop/garage! Get inspired by ControllersTech, DroneBot Workshop, Andreas Spiess, GreatScott!, bitluni's lab, ElectroBOOM, Phil's Lab, atomic14, That Project, Paul McWhorter, Max Imagination, Nikodem Bartnik, Stuff Made Here, Mario's Ideas, Aaed Musa, Haase Industries, and many other professional hobbyists sharing their awesome projects and tutorials! Shout-out/kudos to all of them! Promote README-driven learning 😎
Warning
Electric drives and feedback control systems - do try them at home ❕
220+ challenges to start from: Control Engineering for Hobbyists at the Warsaw University of Technology.
Stay tuned!




