This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Setting max current at runtime

Other Parts Discussed in Thread: MOTORWARE

Hi,

Is it possible to change the maximum motor current at runtime, or is this only settable at compile time?

Thanks,

Steve

  • Steve,

    The maximum motor current is dynamically adjustable.  With SpinTAC it is an input parameter that can be modified with this function call:

    STVELCTL_setOutputMaximums(handle, OutputMaximum, OutputMinimum) [ for velocity control]

    STPOSCTL_setOutputMaximums(handle, OutputMaximum, OutputMinimum) [ for position control]

    This functionality has been already implemented in the MotorWare 13 InstaSPIN-MOTION labs and can be easily added to the MotorWare 12 InstaSPIN-MOTION labs.

  • Yes you can change that on the fly by calling the following function:

    CTRL_setSpd_max_pu()

    This function limits the output of the speed controller in per units. So for example, if you are running the motor and you have these two definitions:

    #define USER_IQ_FULL_SCALE_CURRENT_A          (10.0)
    #define USER_MOTOR_MAX_CURRENT          (5.0)

    Then your speed max in per units is _IQ(5.0/10.0) or _IQ(0.5) which means 5 Amps. That is the default based on these two defines. If you want to change the maximum to 3 Amps for example, then you would have to call the above function as follows:

    CTRL_setSpd_max_pu(ctrlHandle, _IQ(0.3));

    -Jorge