PWM and Velocity Setting

General discussion of the MCP motion controller product line
Post Reply
fausto.tromba
Posts: 7
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 34 times

User avatar
Basicmicro Support
Posts: 1247
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: 7
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: 1247
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.

Post Reply