Method: Phidgets::DCMotor#setCurrentRegulatorGain

Defined in:
ext/phidgets/phidgets_dc_motor.c

#setCurrentRegulatorGain(regulator_gain) ⇒ Object Also known as: current_regulator_gain=

Depending on power supply voltage and motor coil inductance, current through the motor can change relatively slowly or extremely rapidly. A physically larger DC Motor will typically have a lower inductance, requiring a higher current regulator gain. A higher power supply voltage will result in motor current changing more rapidly, requiring a higher current regulator gain. If the current regulator gain is too small, spikes in current will occur, causing large variations in torque, and possibly damaging the motor controller. If the current regulator gain is too high, the current will jitter, causing the motor to sound ‘rough’, especially when changing directions. Each DC Motor we sell specifies a suitable current regulator gain.



78
79
80
81
# File 'ext/phidgets/phidgets_dc_motor.c', line 78

VALUE ph_dc_motor_set_current_regulator_gain(VALUE self, VALUE gain) {
  ph_raise(PhidgetDCMotor_setCurrentRegulatorGain((PhidgetDCMotorHandle)get_ph_handle(self), NUM2DBL(gain)));
  return Qnil;
}