Hi,
I have a question about expected behavior of torque control mode. Specifically I am using the voltage mode in torque control loop.
The motor behaves rather random after every reboot of the driver. Let me explain :D!
First, it goes through the sensor alignment process to match the absolute zero of the sensor with electrical angle of the motor. This is where I am getting a little lost in the theory.
I’ve read through the “theory corner” docs for Motor-Sensor align and it states that the electrical angle is USUALLY defined by the vector of phase A (does usually mean that SimpleFOC uses this definition ???). But the provided images does not really correspond to that. Example:
This picture (from what I understand) shows magnetic field vector of the stator aligned to -180° and rotor being at what we call “zero electrical angle”. But I feel like neither of the 2 are really where they should be. Are all angles in this library based off the “vertical” axis?? I just assumed they follow the same rules as they do with trigonometric functions (“meaning 0° is the right half of horizontal axis”).
And I am even more confused about the definition of the vectors, since it also seems to differ from what the docs state.
According to this picture from the docs the vectors in the first diagram are incorrectly oriented.
Maybe I just horribly misunderstood, so can anyone please explain in simple terms what exactly does the “zero electrical angle” mean? Maybe even provide some context with the magnetic field orientation vectors.
Getting back to the sensor alignment procedure. The “zero electrical angle” is always different and seems to drastically influence the behavior of the torque voltage control mode. Here are some debug logs I got from running the code:
MOT: sensor_direction==CW
MOT: PP check: OK!
MOT: Zero elec. angle: 2.39
MOT: sensor_direction==CW
MOT: PP check: OK!
MOT: Zero elec. angle: 2.45
MOT: sensor_direction==CW
MOT: PP check: OK!
MOT: Zero elec. angle: 1.82
MOT: sensor_direction==CW
MOT: PP check: OK!
MOT: Zero elec. angle: 1.94
MOT: sensor_direction==CW
MOT: PP check: OK!
MOT: Zero elec. angle: 1.53
It seems that the lower the zero elec. angle, the faster the rotation speed. Some kind of slowing down and accelerating again in each revolution is also present in all my attempts. It looks something like this:
2.39 zero elec. angle:
1.53 zero elec. angle:
I am using the AS5600 I2C magnetic encoder with 4mm radial magnet. The sensor is mounted 1mm away from the magnet with plastic screws. Lowering the distance to 0.7mm didn’t help at all.
Does anyone know what might be the issue and how is the rotation related to zero electrical angle??
Thanks in advance
Adam