How fast can I get away with switching the value on an analogOut-pin .. for generating a pwm to work together with steppers? The max-speed on the steppers uses 1200 micros (1.2 millis) and the pwm pulse should be in the range of 1/10'th of that. Can it switch so fast?
Steppers with PWM - do you mean that?
Hi MarkT,
Yes .. I think that it's called a chopper-circuit, but I could have got it wrong.
The idea is to smooth the movement of the stepper. Going from full- to half-stepping helps that, but it pulls more power and the drivers get hot. All coils has a custom resistor that can be disposed of if I 'model' the voltage in a sinusoidal curve over the 4 steps of full-stepping. But I'm uncertain of how fast I can switch the analog Enable pins. Going in halfStep gives a good (necessary) torque, but the max-speed is halved and the angular movement is in the very low end. The 'delay' is pushed to 1.5 millis and that pushes the sinusoidal increments very low (500 micros giving 12 pwm over a full cycle (6millis) ? )
defualt speed for PWM from analogwrite is ~490Hz, with pulse widths a small as 1/255 of 490Hz period, up to 254/255 width, and of course full off and full on.
PWM frequency can be manipulated, there are a lot of playground articles on doing that.
hi CrossRoads,
... 450 hz, that equals 2millis. Meaning that one pulse .. the width that may be down to 1/255 of the 2millis passes every 2 millis as the fastest. hm .. I could still take away the current-limiting resistor, and perhaps controle the pmw-width with feedback from the sensor-pins?
Thanks
Search the playground - there are several articles on increasing the PWM much faster.
CrossRoads:
Search the playground - there are several articles on increasing the PWM much faster.
I will.