BLDC motor software design

For off topic tech projects this audience might like
User avatar
AngelMarc
Posts: 612
Joined: Sat Apr 08, 2023 11:23 am
cars: A CB450 running to 8,000RPM with a P59.

BLDC motor software design

Post by AngelMarc »

Finally made a video of it
https://www.youtube.com/watch?v=Yr6UChpj-to

Sitting around the last couple months with not much to do (prison), and a basic understanding of 3 phase motors, I decided to do some software design for a scratch built controller. Was aiming for max torque, found out (through graphing things out with colored pencils, no internet) my design won’t work with a typical sensor layout where the sensors are centered on the electromagnets (every hover board motor); they’d need to be between the electromagnets.

Well, how about that, older LG direct drives put the sensors in between the electromagnets. basically reverse engineered something I never new about. This in between strategy also doesn’t allow for back EMF sensing at full duty cycle, not realistically anyway; some fancy circuit involving shunt resistors could work.

3 wires do all the work.

Hover boards have 1+, 1-, 1 unconnected at any given time. Shown in 2nd picture.

This strategy does 2+, 1- or 1+, 2- at any given time. Shown in 1st pictured with some of the software design-- forward and reverse, the translation array instead of a clusterfuck of “if” statements, anti-shoot-through delay logic foundation.

The 2 overlapped sheets at top of 1st picture are a linear representation of the pattern of permanent and electromagnets… how I figured out the sensor alignment discrepancy.

A summary of the necessary logic. Row index (of the polarity array) = translate [direction] [sense]. And a shoot through timer that's reset every time the phase orientation changes sets "swap" = direction if timer not complete, or 2 if it is complete, then PWM/desired torque logic sets polarity of output pins (through port mashing) with polarity = [swap] [row index] or polarity = 0b000000.
1000005413.jpg
1000005414.jpg
Shitty psuedo code.
The pulse handler would be like my ECU code. Look it up if you care.
1000000028.jpg
1000000029.jpg
IMG_20260329_152529.jpg
You do not have the required permissions to view the files attached to this post.
Don't stress specific units.