Datasheet
DMC60C™ Software Reference Manual
Copyright Digilent, Inc. All rights reserved.
Other product and company names mentioned may be trademarks of their respective owners.
Page 9 of 16
3.2 Open Loop
• configOpenLoopRampRate(unsigned short rampRate) – Sets the ramp rate used in open loop modes. The
ramp rate is the number of “throttle units” (0 being 0% duty cycle, 32767 being 100% duty cycle) that the
output can change each time the control loop executes (500us). This function can be used to limit the rate
at which the motor speeds up.
o rampRate – How fast the motor can speed up. Smaller values result in slower acceleration and
less current draw.
3.3 Closed Loop
• configWheel(double wheelDiametermm, double gearRatio, int encoderTicks) – Configures the
parameters of the output of the motor. Calling this function is required when operating in closed loop
velocity or position mode.
o wheelDiametermm – The diameter of the wheel in millimeters. This is used in velocity and
distance calculations.
o gearRatio – The ratio of the encoder to the output. If the encoder is on the output of the
gearbox, this value will be 1. If the encoder is on the input of a 12.75:1 gearbox, this value will be
12.75.
o encoderTicks – The cycles per channel per revolution of the encoder in use.
• setPIDSlot(unsigned int slot) – Sets the active PID profile (slot).
o slot – 0 to use PID slot 0, 1 to use PID slot 1.
• configClosedLoopRampRate (unsigned int slot, unsigned int rampRate) – Sets the closed loop ramp rate
for the specified PID slot. This is separate from the open loop ramp rate but is functionally the same.
o slot – The PID slot to configure.
o rampRate – How fast the motor can speed up. Smaller values result in slower acceleration and
less current draw.
• configPositionReset(bool resetOnFwdLimit, bool resetOnRevLimit, bool resetOnIndex) – Configures the
DMC60C to reset (zero) its position count when one of the connected switches goes active. This will only
be done on the active edge of the corresponding pin.
3.4 Programmatically Setting Web Parameters
Some of the parameters that are set in the web configuration utility can be programmatically set. These functions
allow for dynamic configuration during operation.
• configPID(unsigned int slot, float P, float I, float D, float F) – Used to programmatically set PIDF values.
• setContinuousCurrentLimit(double currentAmps) – Sets the continuous current limit, described in
section 2.2.2.
• setPeakCurrentLimit(double currentAmps) – Sets the peak current limit, described in section 2.2.2.
• setPeakCurrentDuration(double currentAmps) – Sets the peak current duration, described in section
2.2.2.
• enableCurrentLimiting(bool enabled) – Enables or disables current limiting.
o enabled – True to enable, false to disable.
• setLimitSwitches(bool overrideEnable, bool forwardSwitchEnable, bool reverseSwitchEnable) –
Overrides the limit switch settings to the specified configuration. This does not change the parameters,
only overrides them.
o overrideEnable – True to override the web configuration switch settings.
o forwardSwitchEnable – If overrideEnable is true: enables or disables the forward Limit Switch.