PWM and Velocity Setting

General discussion of the MCP motion controller product line
Post Reply
fausto.tromba
Posts: 8
Joined: Wed Jul 31, 2019 7:24 am

PWM and Velocity Setting

Post by fausto.tromba » Thu Sep 12, 2019 3:13 am

I connected a brushed motor and the encoder with MCP236.

The encoder pin enc_A is connected with the pin 14 and enc_B with pin 15 (and the power supply).
Also from BasicMicor Motion Studio I can see the encoder value to be incremented or the opposite.

When I set the PWM, it goes directly to +100% or -100%. To stop the motor I have to press the STOP ALL.

The same for the velocity setting.

Thank in advance for any suggestions

Fausto
Attachments
Unbenannt.PNG
Unbenannt.PNG (19.94 KiB) Viewed 97 times

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

Re: PWM and Velocity Setting

Post by Basicmicro Support » Thu Sep 12, 2019 10:07 am

1. Encoders have no effect on PWM commands.
2. You have set an L and R value in PWM Settings which tells the MCP you are trying to use torque control mode. In torque control mode if there is no load the motor will go to 100% duty. Delete the L and R settings from PWM settings. That will put PWM mode back into voltage control mode.
3. Once you have setup the encoder input pins and you are seeing encoder vlues chaning in the Pin Status subwindow in General Settings you then need to select one of the Quadrature pins in the Motor1/Motor2 Encoder selection dropdown to link the encoder inputs to a particular motor. That is on the left/middle side of General settings.

Once you have done that you should see the enocder count changing at the top of the screen whenever you move the motor(eg use PWM settings to move the motor forward and backwards to check this is working). You still have to tune the PID settings for speed or position control to actually use the Velocity or Position Settings sliders to control the motor. That is documented in the user manual as well as in several articles on the website. Let me know if you need help with it.

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

Re: PWM and Velocity Setting

Post by fausto.tromba » Fri Sep 13, 2019 12:49 am

Thank you very much for your reply. Now it works. I don't see what the measures unit of speed (RPM or pulse per second or per minute), but will try to figure it out. I think is pulse per second. Please confirm it.
Thanks

Fausto

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

Re: PWM and Velocity Setting

Post by Basicmicro Support » Fri Sep 13, 2019 11:05 am

Encoder counts per second per second for acceleration/deceleration.
Encoder counts per second for velocity.
Encoder counts for position.

benignfun
Posts: 2
Joined: Fri Oct 18, 2019 10:05 am

Re: PWM and Velocity Setting

Post by benignfun » Fri Oct 18, 2019 10:15 am

I have a similar issue. Motor 1 has a 0.0000 in the PMW/Torque settings and on the Velocity tab pegs Velocity at 100% to start, on PWM, raising or lowering the Control spikes the amps to 1.7 and never moves the motor.

Motor 2 has a 0.00 in torque and works as expected.

PROBLEM: My PMW/Torque section is greyed out and doesn't allow any changes.... so where do I enable that section or reset that to blank/zero?

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

Re: PWM and Velocity Setting

Post by Basicmicro Support » Fri Oct 18, 2019 10:30 am

Torque options are not available for Roboclaw controllers, hence the reasons the R and L settings are grayed out. This thread was asking questions about MCP controllers which does support torque(current) control. Roboclaw only supports PWM(Voltage) control mode.

Note if moving the PWM slider doesn't move the motor there may be something wrong with the motor or the motor channel. Move the working motor to the channel that may not be working and re-test. Also be sure you aren't shorting out the motor channel some other way(loose wire for example). If you have further questions please ask them in a new thread or email support@basicmicro.com.

Post Reply