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 10 of 16
o reverseSwitchEnable – If overrideEnable is true: enables or disables the reverse Limit Switch.
• setBrakeCoast(bool overrideEnable, bool brakeEnable) – Overrides the hardware brake/coast
configuration.
o overrideEnable – If true, overrides the brake/coast setting set by the brake/coast LED on the
DMC60C.
o brakeEnable – If overrideEnable is true: True sets the DMC60C to brake when a neutral output is
applied, false set it to coast when a neutral output is applied.
4. Driving the DMC60C
The DMC60C API takes a slightly different approach to driving the motors. In addition to the Set() function, there
are separate drive***() functions. This was an attempt to make these functions and parameters more user
friendly. The DMC60C is designed with a 104ms timeout. If no commands are sent to the DMC60C within 104ms, it
will go into standby mode until a drive or disable command is sent. There are 6 drive modes available:
4.1 Open Loop
Open Loop drive modes do not require any additional hardware to use.
• Set(double speed) – Drives the output in percent voltage (duty cycle) mode. This function calls
driveVoltage().
o speed – The desired duty cycle, from -1 to 1.
• driveVoltage(double percentVoltage) – Drives the output in percent voltage (duty cycle) mode.
o percentVoltage – The desired duty cycle, from -100 to 100 percent.
• driveVoltageCompensation(double voltage) – Drives the output with the desired voltage.
o voltage – The signed voltage to send to the motor, from -inputvoltage to +inputvoltage. If the
desired voltage exceeds the input voltage, the duty cycle will be limited to -100% or 100%.
4.2 Closed Loop
Closed Loop drive modes (excluding driveCurrent) require a quadrature encoder to work correctly. In addition to
this, users must call the configWheel() function to properly set up the wheel parameters. Users should also call
setPIDSlot() to select which PID profile to use.
• driveCurrent(double currentAmps) – Drives the output with the desired current.
o currentAmps – The desired current in amperes to send to the motor.
• zeroEncoderPosition() – Sets the current position to 0.
• drivePosition(double revolutions) – Drives the output motor a certain number of revolutions relative to
zero.
o revolutions – Signed number of revolutions relative to zero to drive the motor.
• driveDistance(double meters) – Drives the output motor a certain number of meters relative to zero.
o meters – Signed number of meters relative to zero to drive the motor.
• driveVelocity(double metersPerSecond) – Drives the output motor a certain speed in meters per second.
o metersPerSecond – Signed speed in meters per second.
4.3 Follower Mode
In addition to directly driving the DMC60C, it is possible to set it into follower mode. A DMC60C in follower mode
will attempt to match the duty cycle of another DMC60C on the CAN bus.