MCP236 close loop currrent control

General discussion of using Roboclaw motor controllers
Post Reply
fausto.tromba
Posts: 18
Joined: Wed Jul 31, 2019 7:24 am

MCP236 close loop currrent control

Post by fausto.tromba » Thu Aug 29, 2019 11:13 pm

Hi
I'm new with BasicMicro.
I have MCP236 and with the Motion studio, is possible to drive the motion driver in PWM, speed or position control, as far as I understand. Unfortunately, I cannot see current control. There is PWM but it is more "voltage" than current. is it possible to set in current with a current sensor to close the loop?

Thanks
Fausto

User avatar
Basicmicro Support
Posts: 1274
Joined: Thu Feb 26, 2015 9:45 pm

Re: MCP236 close loop currrent control

Post by Basicmicro Support » Fri Aug 30, 2019 9:35 am

MCP controllers support current control(using their own onboard current sensors). Setting the Inductance and Resistance settings(see PWM settings screen) enables current control mode on MCP controllers. Duty commands are mapped to current instead of voltage when in current control mode. The range of current is specified by the Min/Max Current limits set for the motor. For example if max current is 30amps and you set a duty of 16384 the MCP will increase power to the motor(in the forward direction) until 15amps is reached or 100% power has been applied. If -16384 is set MCP will increase power(in the reverse direction) until 15amps is reached or 100% power has been applied.

Note that the motor inductance is in Henries and the Resistance is in Ohms.

The more accurate the Inductance and Resistance settings the better the current control will function.

fausto.tromba
Posts: 18
Joined: Wed Jul 31, 2019 7:24 am

Re: MCP236 close loop currrent control

Post by fausto.tromba » Mon Sep 09, 2019 5:17 am

Hi
Thanks a lot for your mail. I set the inductance and the resistance (L = 0.0020 H and R = 2). In PWM-tab playing with the vertical bar, I can move the motor. Duty is only in read-mode and I cannot write on it. The bar code is really sensitive. There is one way to write it?
Now the current limit is +-15A.

Thanks
Fausto

User avatar
Basicmicro Support
Posts: 1274
Joined: Thu Feb 26, 2015 9:45 pm

Re: MCP236 close loop currrent control

Post by Basicmicro Support » Mon Sep 09, 2019 10:20 am

The text box for duty just shows the numeric value of the slider.

Remmeber when using current control mode if you have no load on the motor(eg its off the ground) it is going to go off to full speed(or until it reaches the current you requested.

Put a load on the motor(or stall it even) and you should be able to control the current via the slider accurately(eg all the way up or down will be 15amps(in the specific direction). Back to center should be 0 amps. Midway between center and up/down should be 7.5amsp etc...

This assumes your motor can pull at least 15amps under that load.

Post Reply