How can I smooth over a sensor dead zone that straddles the zero point?

There seems to be a dead zone in my magnetic PWM sensors that spans over the zero point. When the motor is in this position, it buzzes, draws a ton of current, and cannot start itself in any closed loop mode. It must be “helped” out of the dead zone by hand. Once it completes one full rotation, it gets stuck in this position once more.

From what I’ve seen in reading the motor logging output, it’s clear that the data is so fuzzy near the crossover point that the velocity controller thinks the motor is jittering back and forth at insanely high speeds. You can actually see the logged motor speed increase and then decrease as you rotate the motor by hand through this dead zone, with the highest logged speed being directly in the middle of the dead zone.

The motor runs fine in all open loop control examples, and I’ve run the magnetic PWM sensor min/max example several times and used the outputted values in the closed-loop examples. Unfortunately, it doesn’t seem to be helping, and I don’t quite understand what we are trying to do with those values well enough to massage them by hand.

I’m currently using a Pi Pico, TMC6300 driver, AS5048a sensor in PWM mode, and a GM3506 motor. I am aware that PWM mode sucks and I have the wiring harnesses for SPI arriving later today. That said I want to try to get the the bottom of this anyway, because these motor/sensor sets are often sold by default in the PWM configuration, so I can’t possibly be the only one who’s run into this problem.

Do you guys have any ideas I might be able to investigate?

You can reduce the size of the dead zone by getting the timing parameters more precise, but there is always a noticeable dead zone with PWM. However if the dead zone is small enough it’s not really a problem. As long as the motor still develops torque when the motor is anywhere in the dead zone, reading any of the values it could read, it will just leave the dead zone. for me it was a problem because you can get a small clicking sound at the dead zone if it’s not smoothed over, but that’s all.

The pulses per second were 1024 or so I think so 1khz, so pulse width of from close to zero to close to 1000 microseconds, so you are going to get a few microseconds error for various reasons, so 1/500 of a rotation or something. Not really a problem as long as you still get torque.

Unfortunately the motor does not develop torque in the dead zone— it locks itself in place and must be moved out of the dead zone by hand. It’s almost like I’d need to dynamically switch to open loop control and back once per rotation to get this to work.

Well, at the dead zone the system doesn’t know where the motor is, it can be anywhere in there. If it’s 1/500 of a rotation, and it’s say an 8 pole pair motor, then a compass needle overlaid over the stator would point much more than 1/500 of a rotation clockwise or counterclockwise, compared with a compass needle overlaid over the rotor. In other words, if the magnetic angle of the stator is anywhere near 90 degrees different from what it thinks the rotor is, then that is 1/8*4 of a rotation. So the magnetic field will still drag the rotor i.e. torque would still be produced, just not the optimal amount, and it won’t vary from the optimal by much. There must be something else wrong. I would print out the sensor values while rotating it around. Make sure it’s an actual dead spot, not something else going on.