hi all,
i wanted to drive a high voltage motor so i built a simple circuit to control its speed.
the circuit takes AC 220v at 50Hz, i then measure the zero crossover with an optocoupler (this works, scope tested)
after that i have a triac which is switched with another optocoupler. (this also works checked with scope, adjustable square wave coming out)
obviously on the arduino there is a potentiometer for speed control
the AC voltage then goes through a diode bridge and into a big ass capacitor and then on to a 220v DC motor. all of this circuit was pre existing for the motor.
the problem is that over 50% ish, the motor runs fine, its own momentum keeps it spinning nicely,
but at lower speeds it stutters, it feels like its getting a pulse of power approximately once every second but it is obvious from listening to it that it is unstable.
the scope shows a nice square wave on the output opto.
the motor is fine, the carbon brushes are ok, there is no carbon deposits on the pick up points, each coil checks out with a multimeter and the motor spins fine using something like a 24v battery
what could cause it to stutter at slow speeds? could it be glitch signals coming in from the crossover detection?
code is below,
any help would be great thanks!
#define triacPulse 3
#define aconLed 13
int triac = 3;
volatile int potval = 0;
int val;
int temp = 0;
void setup() {
pinMode(2, INPUT_PULLUP);
pinMode(triac, OUTPUT);
pinMode(aconLed, OUTPUT);
pinMode(A0, INPUT);
attachInterrupt(0, acon, CHANGE);
Serial.begin(9600);
}
void loop() {
potval = analogRead(0);
}
void acon() {
digitalWrite(aconLed, HIGH);
digitalWrite(triac, HIGH);
delayMicroseconds(map(potval, 0, 1023, 0, 10000));
delayMicroseconds(200);
digitalWrite(aconLed, LOW);
digitalWrite(triac, LOW);
}