Is I_Motor in the below equation referring to the total current ?
i.e. I_Motor = total motor.config.current_lim + total motor.config.current_lim_margin ?