Hello,
We are using a picaxe 18x for pwm control of a varying motor and are having problems. The pwm duty cycle is varied based on the analog input from a NI DAQ card. The pulse works fine and shows up great on the scope, the problem is when we are trying to run the motor. The PWM kicks on for about 3 seconds and then the pulses stops for about (like an overload) and then kicks back on. We are running the pwm at 10K and runs to a H-bridge. We used a transistor to clean it up a bit but still the same problem occurs. Here is the code:
We are using a picaxe 18x for pwm control of a varying motor and are having problems. The pwm duty cycle is varied based on the analog input from a NI DAQ card. The pulse works fine and shows up great on the scope, the problem is when we are trying to run the motor. The PWM kicks on for about 3 seconds and then the pulses stops for about (like an overload) and then kicks back on. We are running the pwm at 10K and runs to a H-bridge. We used a transistor to clean it up a bit but still the same problem occurs. Here is the code:
Code:
init:
let b1 = 0
let w0= 0
main:
gosub checkVoltage
if pin1 = 1 then
gosub dynamicPWM
pwmout 3 , 249, w0
elseif pin1 = 0 then goto shutOff
end if
goto main
shutOff:
pwmout 3,off
goto main
checkVoltage:
readadc 0,b1
return
dynamicPWM:
if b1 <= 225 then
let w0 = b1*4
elseif b1 > 250 then
let w0 = 1000
endif
return