Skip to content

ufnalski/as5600_speed_position_feedback_l432kc

Repository files navigation

AS5600 absolute encoder feedback control loop demo using Stabilus POWERISE actuator [STM32L432KC]

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!

AS5600 absolute encoder in action AS5600 absolute encoder drive response AS5600 absolute encoder rubber bound AS5600 absolute encoder integration AS5600 absolute encoder display AS5600 absolute encoder drive converter

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.

Libraries, datasheets, and tools

Exemplary hardware

Missing files?

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.

What next?

Build a fully-blown control system with an inner current/torque control loop. A selection of Hall-effect current sensors can be found here.

Call to action

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!

About

AS5600 absolute encoder feedback control loop demo using Stabilus POWERISE actuator and STM32/HAL.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors