Lepton Deku mod

Time to get back to my main thread after my adventures in sensor extrapolation SmoothingSensor: Experimental sensor angle extrapoltion

A major discovery made along the way is that if you use sinePWM instead of trapezoid120 and manually adjust motor.zero_electric_angle, you can correct for any phase offset of the hall sensors. As long as they’re placed 120 electrical degrees from eachother, it doesn’t matter how they’re placed relative to the stator. Both the imperfect yellow/green placement and perfectly out of phase cyan work equally well now. This is great because it means you don’t need precision machining of custom stator mounts to get correct timing.

The tuning procedure is to run in torque or velocity mode and command the motor to spin faster than it’s able to for the voltage/current limit, and adjust zero_electric_angle until the maximum speed reached is the same in both directions.

In my case it appears to be due to slight variations in sensor timing even though my stator mounts are precisely machined. I tried 3 different wire connection combos with the cyan sensor placement, and two of them were just about perfect if I offset zero_electric_angle by pi/7 from the value that the auto-calibration came up with, but one needed a little more offset. All of them reach about the same top speed and sound the same when the offset is right.

I made another discovery while playing with a hoverboard motor (by which I mean hacking out the center of the stator with a coping saw like a barbarian while dreaming of machining a big cycloidal reducer for it to flap a 7 foot long version of the wing in post #49), which is that it doesn’t have any capacitors on its hall sensor PCB. So I checked the sensors and they are marked 41F, which looks to be a digital hall that doesn’t need filtering capacitors. That will save a lot of fiddly soldering work.