Hello! I am currently trying to control the velocity of a T-Motor GB2208 with an Arduino and a SimpleFOC Mini driver. I am also using an AS5600 magnetic encoder. It’s like the kind on the small white PCB you can get on Amazon. When I run the SimpleFOC open-loop velocity control example code, the motor works great, but when I change to the closed-loop control with a PID controller, it doesn’t. Instead of moving at some set velocity, it holds its position. It’s not dead, it’s applying torque to the motor, but not only is it not rotating, but it’s not letting me rotate it. It does the same thing in the Torque control example; however, instead of just applying a constant torque to hold its position, regardless of the value I set to the motor as it does in velocity control, it actually reflects what I set the voltage to be. For example, it’s way harder to move it out of its position when I set the voltage to 6 than when I set it to 2. There clearly seems to be something going on with the encoder, but I don’t know what. When I ran the SimpleFOC as5600 example code, it read accurate values. It does, however, hit a minimum twice in a 360-degree rotation for some reason, which means the direction is not always accurate. Here’s the serial port I got when it initialized:
MOT: Init
MOT: Enable driver.
MOT: Align sensor.
MOT: sensor_direction==CW
MOT: PP check: fail - estimated pp: 23.41
MOT: Zero elec. angle: 4.33
MOT: No current sense.
MOT: Ready.
Obviously, the pole pair count is not 23.41, it’s supposed to be 6 for this motor, so that’s another reason why I think something’s wrong with the encoder, but again I have no idea what, because it gives good values in the example code. How should I go about fixing this?
are you confident the magnet is the correct diametrically magnetized type? The white boards from AliExpress or Amazon are often delivered with the wrong magnet (axial instead of diametrically magnetized).
In that case the sensor often kinda works when you turn it by hand, but utterly fails when the motor is moving by itself.
Third question:
Is the power configuration correct (3.3V vs 5V) - the sensor can do either, but the electrical connections are a bit different for each (see Datasheet)
I encountered exactly the same problem. In a closed loop with AS5600 the motor holds its position and does not move. I tried moving the motor in open loop and getting data from the sensor and it is correct. Are there any other reasons for this behavior?
I am using an arduino mega in combination with one of the versions of the simpleFOC Shield for arduino and a GM 3506 motor. In fact, I have tried with different boards, such as the SimpleFOS mini and the MKS DUAL FOC for ESP. The result is always unsuccessful. I set the number of pole pairs equal to 11. I used the example torque_control / magnetic sensor, and this is the log I get:
MOT: Monitor enabled!
MOT: Init
MOT: Enable driver.
MOT: No current sense.
MOT: Ready.
Motor ready.
Set the target voltage using serial terminal:
2.0000 2.0000 0.0000 0.0000
2.0000 2.0000 0.0000 0.0000
2.0000 2.0000 0.0000 0.0000
2.0000 2.0000 0.0000 0.0000
2.0000 2.0000 0.0000 0.0000
2.0000 2.0000 0.0000 0.0000
2.0000 2.0000 0.0000 0.0000
2.0000 2.0000 0.0000 0.0000
In this case, the motor only holds position but does not move.
The GM3506 motor should work fine with the SimpleFOC mini. Maybe not at full torque, but it should definitely move. using a fairly low voltage like 8-10V it should also be fine to run this motor open loop for a while.
So it’s a bit mysterious what is going on here.
One thing to check is maybe the motor is damaged? Are all its phases working? You can use a multimeter to measure the resistance between all the phase pairs, and they should all be approximately the same.
Perhaps you can also share the current version of the test code you are running?
Hello, I measured the motor phase resistances using a four-wire circuit. The result is as follows:
A-B = 5.377 Ohm
B-C = 5.370 Ohm
A-C = 5.362 Ohm
I don’t think that such a difference in resistance can affect anything.
In an open circuit, the motor moves perfectly. The only thing that can be noted is that I cannot accelerate it faster than 35 rad/s.
My test code almost completely corresponds to the example from the library, except that I configured the PWM outputs according to my Shield configuration.