Hey guys, I'm pretty new at programming but I heard an Arduino is a great micro controller to help me get started.
I need the proper PWM code to implement a soft starter to control a DC motor. An SCR configuration will be used to drive the motor, but I need to use my Arduino Uno to adjust the duty cycle in order to control the phase angle of the SCR. I have been playing with a general PWM code shown below:
#include "SoftPWM.h"
void setup()
{
// Initialize
SoftPWMBegin();
// Create and set pin 10 to 0 (off)
SoftPWMSet(10, 0);
// Set fade time for pin 10 to 100 ms fade-up time, and 500 ms fade-down time ( I do not know the relevance of this )
SoftPWMSetFadeTime(10, 100, 500);
}
void loop()
{
// Turn on - set to 100%
SoftPWMSetPercent(10, 100);
delay(2000);
SoftPWMSetPercent(10, 50);
delay(2000);
SoftPWMSetPercent(10, 0);
delay(2000);
}
///////////////////////
This is just to get the feel of how I can adjust the duty cycle for my application. I'm unsure what I need to know about the Arduino's frequency specifications and what not.
If you guys have any suggestions or a better PWM code to try out I would greatly appreciate it. Thanks a lot!!