Arduino DC Motor Speed Motor Control

Use an Arduino to manage a DC motor speed controller.

Apr 16, 2017

10513 views

0 respects

Components and supplies

1

Arduino Mega 2560

1

MST_K12 - speed regulator for DC motor

Project description

Code

MST_K12 arduino control software

arduino

Here is the Arduino code. Using the serial interface of the Arduino IDE it is possible to control the MST_K12 regulator. The commands are sent to the Arduino card that translates them into commands for MST_K12. The commands are: a: turn on the controller to the speed regulation value set by rxxx command. At the first power on, the speed regulation value should have set before through rxxx command; s: switch-off of the regulator. The speed regulation value is set to zero while the value set via the rxxx command is not lost but stored because it will be used at the next ignition; rxxx: sets the speed regulation value: xxx is the percentage of adjustment which can vary from 0 to 100; q: returns the status of the motor (on or off) and of the current speed regulation value;

Downloadable files

MST_K12 & Arduino

The hardware implementation is performed using the Arduino MEGA 2560 card and the MST_K12 regulator without the potenziometerreplaced by a screw connector: It is needed to connect the positive input VCNT to the pin 13 pf the arduino card and the negative input pin GND to the gnd of the card as shown in the figure. The principle of the control is very simple: in normal operation the MST_K12 takes the voltage, set by potentiometer, to control of the regulation value. To replace the potentiometer it is needed something that can generate a variable voltage from 0 to 5V into 256 levels. There comes to the aid of the PWM Arduino that has the ability to generate a PWM signal, via command, for some pin (2-13) with a value that ranges from 0% to 100%. As described in the tutorial on the use of the PWM it is possible to generate a DC voltage by a PWM signal. The value of this voltage that call VCNT = D / 100 VDC. where D is the duty cycle in% and VCC is the maximum voltage of the PWM signal. In our case, for the Arduino, VCC = 5V that is compatible with the internal operation of the MST_K12 voltage while D may vary from 0% to 100%. For example, if you want a 50% speed regulation enough to set the duty cycle of the pin 13 to 50% because at this corresponds to a voltage VCNT = 5 * 50/100 = 2.5V which is for the MST_K12 the voltage value for 50% of control level. To switch off the controller just put the duty cycle to zero while to turn it on just put the duty cycle of the pin 13 to the previous value or a new value different from zero.

MST_K12 & Arduino

MST_K12 & Arduino

The hardware implementation is performed using the Arduino MEGA 2560 card and the MST_K12 regulator without the potenziometerreplaced by a screw connector: It is needed to connect the positive input VCNT to the pin 13 pf the arduino card and the negative input pin GND to the gnd of the card as shown in the figure. The principle of the control is very simple: in normal operation the MST_K12 takes the voltage, set by potentiometer, to control of the regulation value. To replace the potentiometer it is needed something that can generate a variable voltage from 0 to 5V into 256 levels. There comes to the aid of the PWM Arduino that has the ability to generate a PWM signal, via command, for some pin (2-13) with a value that ranges from 0% to 100%. As described in the tutorial on the use of the PWM it is possible to generate a DC voltage by a PWM signal. The value of this voltage that call VCNT = D / 100 VDC. where D is the duty cycle in% and VCC is the maximum voltage of the PWM signal. In our case, for the Arduino, VCC = 5V that is compatible with the internal operation of the MST_K12 voltage while D may vary from 0% to 100%. For example, if you want a 50% speed regulation enough to set the duty cycle of the pin 13 to 50% because at this corresponds to a voltage VCNT = 5 * 50/100 = 2.5V which is for the MST_K12 the voltage value for 50% of control level. To switch off the controller just put the duty cycle to zero while to turn it on just put the duty cycle of the pin 13 to the previous value or a new value different from zero.

MST_K12 & Arduino

Comments

Only logged in users can leave comments