Strange current wave form in “open_loop_velocity_example”

I’m new to this library and very impressed that it’s very nice software to study FOC.
My setup is this:

  • Arduino UNO R4 Minima
  • SimpleFOCShield V2.0.4 (bought from AliExpress)
  • Iflight GM4108H-120T with magnetic encoder
  • 12V DC power source

In using “examples/motion_control/open_loop_motor_control/open_loop_velocity_example”,
I come to notice that the motor starts to oscillate when “voltage limit” > 3.4 volt.
Below picture is PWM signal at PH_A in TB_M1 connector (yellow) and current signal at C1_OUT (blue). T command is set to 6 rad/s, and L command is set to from 2 to 3.5 volt.
Do you have some idea why this happens?

That is weird. The pwm signal looks like it is wrapping around or something. If the pwm wasn’t odd then i might have said it was over current protection in gate driver.

You talk about voltage_limit but don’t say whether this is motor.voltage_limit or driver.voltage_limit you are changing. it might be worth setting the other or both. (Be careful not to fry your board).

One pattern people seem to do is

driver.voltage_limit = 3;

Most people here use closed loop where voltage limit is used only to protect the board and not as a motor control adjustment variable

Thanks for your comment !

The program sets initial values:

  driver.voltage_power_supply = 12;
  driver.voltage_limit = 6;
  motor.voltage_limit = 3; 

I’m manipulating motor.voltage_limit by commander:

  void doLimit(char* cmd) { command.scalar(&motor.voltage_limit, cmd); }

As you mentioned, gate driver’s current limit might be possible,
but I’m wondering why it works while the gimbal motor’s R=11 ohm.

Thank again.

Accidentally I noticed that the power connector is getting loose. As soon as I fix them, PWM signal (yellow) has changed a lot and seems to be reasonable.

The motor still oscillates or sometimes rotates reverse, but I understand this comes from the saturated nonlinear drive signals and can be avoided as long as I keep motor.voltage_limit < driver.voltage_limit/2.

Thank you so much.

1 Like