I bought two boards last week and I’m having some problems.
I have an error, the motor runaway when there’s a lever arm with a load. When I test the compliance of the arm or on initialization, the motor starts spinning endlessly.
Do you have a fix for this bug?
Thank you in advance
Could you please provide us with some more info, so we can target the problem more precisely:
What is the microcontroller you are running the code with?
Does this happen with only one motor connected or when both are connected?
Are you using encoders for both motors?
What is the cpr that you configured in the encoders?
Basically runaway will happen when the foc algorithm looses (or misnitializes) electrical zero angle of the motor. This is a bit more common with the encoders due to the integral error of the counting the position. Especially on Arduino UNO.
Therefore if you are using Arduino UNO, I would suggest using lower encoder cpr to start with and make everything work and then you can test the higher cpr once you have it running.
Also the other problem that can arise is the lever blocking the motor to initialize. Encoders unfortunately dont have a way to instantaneously know the absolute position and therefore you will need to initialize motor and encoder 0 position on start. If the motor cannot move the lever with weight then it will never initialize properly. It can still work a bit, but you will see that one direction will be easier to push than the other, this means the init step was not successful.
There is many things you can do to avoid this of happening, but the simplest one would be to increase the alignment voltage to maximal value during configuration:
motor.voltage_sensor_align = motor.voltage_power_supply;
This will give the motor doing the alignment more power, which might be enough to solve your problem.
The other way you can solve this is by holding the lever in your hand, you can just raise the lever a bit and act as a spring so that the motor moves it to the electrical angle 0 (the movement will be maximally ± 10degrees ) and after this the motor should work.
I use an arduino UNO with an AMT 102-V encoder and an iPower GM4108 BLDC (11pp).
This happened with one motor and when both are connected. I use TWIManager for the interrupt.
I use one encoder for each motor with cpr of 8192.
Ok, I will test that. Do you have some documentation about the electrical zero angle because I’m not sure to understand what is-it exactly ?
Thanks for the trick, I increase the voltage sensor align and I have no more problem on the inisialization.
This CPR is unfortunately too high for the Arduino UNO.
You configure the CPR easily with the switch array inside the sensor. Try to lower the CPR under 2000 for both of them.
Here is the documentation of the FOC implementation:
And here is a bit of theory about the FOC algorithm:
Let me know how it goes!