Using a Voltage Clamp with RoboClaw

Why Use a Voltage Clamp?

A voltage clamp is a circuit used with a motor controller to divert excess energy away from the control circuitry and power supply to prevent damage. In the two applications discussed below a MOSFET is used as switch to divert excess power through a power resistor where it’s dissipated as a heat. The RoboClaw and MCP motor controllers both have the ability to trigger this type of external circuitry when a user programmable voltage is reached.
The primary purpose of a voltage clamp is to protect a motor controller’s power supply from the regenerative power created when a motor is stopped or slowed down quickly. A motor spins when power is applied to it however it also acts as a generator when slowing down or suddenly stooped. This energy opposes the flow of current to the motor and is directed back to the motor controller and power source. Switching power supplies are not designed to handle this power surge and some batteries will also not tolerate the sudden inrush of current. A voltage clamp detects this power surge as a rise in voltage and sends the excess current to a resistor where it’s turned in to heat.

Using the VClamp Board

1. To start, the RoboClaw motor controller should be fully wired to power and an appropriate motor. An example of doing so can be found in this tutorial by following it up to step 10.
2. Begin the process of wiring the voltage clamp board with the connections to the control header on the board. Use the table below to connect the voltage clamp board and the RoboClaw.
Function VClamp Board RoboClaw
5V Power 5+ terminal Any 5V pin
Ground GND terminal Any ground pin
Control Signal CTRL terminal S3, S4 or S5 pin (selectable in Motion Studio)

3. Select the resistor for the voltage clamp based on the table below. Note that the Digikey parts listed below are all 50 watt resistors which are sufficient for most use cases. However if the voltage clamp is expected to be on for long periods of time or the motor is driving a large load a resistor with a higher power rating may be necessary.

Figure 1: A table of suggested resistor values and DigiKey part numbers.

4. Wire the power supply to the voltage clamp board noting polarity. The positive side is connected to the “B+” terminal and the negative side is connected to the “GND” terminal.

5. Wire the resitor to the voltage clamp board by attaching it to the “R1-A” and “R1-B” terminals. The resistor can be wired in either direction.

Figure 2: A diagram of the completed wiring for the voltage clamp board.

The improve the performance of the voltage clamp the resistor should be mounted to a metal surface to help cool it.

6. Apply power to the RoboClaw and connect it with a USB cable to a computer with Motion Studio installed. Connect the RoboClaw by clicking on “Connect Selected Unit”. Click on “General Settings” on the left-hand side of the application to open the windows that will be used for configuring the voltage clamp. Find the pane labeled “Battery”. Select “Use User Settings” from the dropdown and set the “Max Main Battery” setting to 1-2 volts above the “Main Battery” voltage displayed in the upper right-hand corner of the application. Finally move to the pane labeled “I/O”. Locate the setting labeled “S3 Mode”, “S4 Mode” or “S5 Mode” depending on which pin the control wire was wired to. Select the option “Voltage Clamp” from the dropdown for the selected pin. Lastly, check the box labeled “Invert” for the selected pin.

Figure 3: Image showing the applicable settings for the voltage clamp board in Motion Studio.

7. Finally the voltage clamp should be tested to ensure its working properly. First make sure the voltage clamp is off when no motors are moving.
Next open Motion Studio click on “PWM Settings” on the left-hand side of the application. Using the slider for the appropriate motor channel start a motor spinning and slow it down rapidly or stop it rapidly. When the voltage rises 1V above the limit set in the battery settings the voltage clamp should turn on. There is an LED on the voltage clamp board that turns on when the voltage clamp is active. The voltage clamp should turn back off when the voltage returns to 1V below the maximum voltage setting.
Once again testing the system as before make sure that an excessive voltage is not still occurring. This can be done by watching the voltage reading in Motion Studio or by using the graphing feature in the PWM Settings window. If an excessive voltage spike is still occurring a lower resistance resistor should be substituted for the one in use. Repeat this process until the voltage clamp works as it should.
Lastly check to make sure the resistor is not becoming excessively hot. If it is a physically larger resistor can be swapped in. A resistor with a higher power rating can also be swapped in.

Voltage Clamp Without the VClamp Board

1. As with using the voltage clamp board the motor controller should already be wired for power and connected to a motor.

2. When not using the voltage clamp board all of the components of the voltage clamp circuit will have to be connected with wire and soldered together. Use the diagram below as a reference when constructing the circuit. In the diagram below Q1 is the MOSFET. The current recommendation is to use DigiKey part number BUK965R8. R2 is a resistor used to keep the MOSFET off when not in use. A 10kohm resistor should be used for R2. R3 is the power resistor used to dissipate energy and should be sized according to the chart in step 3 of the previous section.

Figure 4: The wiring diagram for using a discrete MOSFET.

The improve the performance of the voltage clamp the resistor should be mounted to a metal surface to help cool it.

3. Configuring the voltage clamp in Motion Studio is the same as in step 6 form the previous section with the exception of not setting the “Invert” option for the chosen I/O pin.

Figure 5: Motion Studio setting for using a discrete MOSFET.

4. The finished voltage clamp circuit should be tested in the same way as in step 7 from the previous section.