Skip to content

ufnalski/m5stack_rollercan_barebone_g431kb

Repository files navigation

M5Stack RollerCAN BLDC drive barebone demo [STM32G431KB]

The part is M5Stack Unit RollerCAN. This repo contains my first approach to get familiar with the drive. No proper library. Blocking mode. No error handling. No multiple drive support (no structures/objects). No proper getters and setters. This is just to test the very basic functionalities of the drive. And my first impression with the drive is very positive. It is LEGO compatible! It has open-source firmware!

M5Stack RollerCAN BLDC drive in action

Tip

Is it a bug or a feature? A request for a parameter value is identical to the response if the value is zero. There is no way to tell the two frames apart. This is not the way we should organize messages on the CAN bus. Other nodes cannot use such a frame because its payload has no specific meaning. Setting RTR=1 causes the message to be ignored by the device - we cannot then use this mechanism to differentiate the messages. However, there is another bug (feature?) that creates a workaround to the first problem. According to the manual, the device is supposed to repeat the host two-byte ID in the response frame ID. Contrary to expectations, it repeats only the LSB. Thus, setting the MSB to some non-zero value makes the device to respond, e.g., with the frame ID 0x1100EFA8 to the request frame ID 0x11BEEFA. Voila!

M5Stack RollerCAN BLDC drive message trace

Missing files?

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

Readings

What next?

Play with haptic feedback. Emulate a rotary knob with detent. Emulate a rotary knob with soft endstops. Demonstrate a volume knob that turns appropriately when the remote is used.

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

Haptic feedback - do try this at home ❕

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

Stay tuned!

0xBU