Help tuning GBM4108-120T with some load/inertia (central motor in setup)

Hi everyone,

I’m working on a project using the GBM4108-120T BLDC motor, and I could use some help tuning it. This motor has a small load and some noticeable inertia. It’s the central motor in my setup (see attached image). I’m using SimpleFOC on an Arduino due. The motor runs fine, but the control performance doesn’t quite meet my expectations — it’s not as fast or accurate as I’d like.

Here’s my current configuration function:

void configureMotor_2(BLDCMotor& motor) {
  motor.foc_modulation = FOCModulationType::SinePWM;
  motor.torque_controller = TorqueControlType::voltage;
  motor.controller = MotionControlType::angle;

  motor.voltage_limit = 12.0;   
  motor.current_limit = 2.0;

  motor.PID_velocity.P = 3.0;        
  motor.PID_velocity.I = 5.0;
  motor.PID_velocity.D = 0.001;        
  motor.PID_velocity.output_ramp = 1000.0;  
  motor.LPF_velocity.Tf = 0.003;

  motor.P_angle.P = 8.0;             
  motor.P_angle.I = 0.2;           
  motor.P_angle.D = 0.001;            
  motor.P_angle.output_ramp = 10000.0;
  motor.P_angle.limit = 30.0;        
  motor.LPF_angle.Tf = 0.003;

}

The control feels sluggish, and response times could be improved. I’m wondering:

My Questions:

  • Are there specific parameters I should tweak to better handle inertia and improve response?
  • Would switching to TorqueControlType::dc_current give me better performance in this case? I know switching to foc_current would be better but i did not find parameter to get it to work.
  • Are my P_angle PID values (P = 8.0, I = 0.2) too aggressive or too weak?
  • Should I reduce output_ramp values for more responsive behavior?

I’ve also noticed that the end-effector motor (at the tip of my robot arm) works great with the default parameters — but it has almost no load or inertia, so I assume that’s why it’s much easier to tune. The default parameters do not work when the motor is in the middle, as they lead to an unstable system.

Thanks in advance for your support!

(Image of the setup is attached — again, the motor in question is the one in the center.)