Community Robot Questions How To Gradually Increase And Lower The Value Of Pwm reaktor France Asked May 2014 — Edited May 2014 Resolved by Rich! How To Gradually Increase And Lower The Value Of Pwm Skip to comments Jump to end Hello, I would like to gradually increase and lower the value of PWM. Does anyone know how to do? thank you Jump to end Upgrade to ARC Pro Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming Compare Pro Features View Subscription Plans Rich United Kingdom #1 May 2014 You could script it quite easily. $pwm_target = 100 # Set for target speed $pwm_start = 0 # Set for start speed PWM(D0,$pwm_start) :loop IF(GetPWM(D0) < $pwm_target) PWM(D0,$pwm_start) $pwm_start= $pwm_start + 5 # Change 5 to required amount for speed of increase ELSE Halt() # PWM at required level, stop script. ENDIF Sleep(10) # Change sleep to suit speed. GOTO(loop) Apologies if the code is a bit messy and not explained too well I'm strapped for time but it should give an idea (hopefully) reaktor France #2 May 2014 Ok, I understand how the code works. Now it's clear. Thanks DJ Sures PRO Synthiam #3 May 2014 Or you can servospeed() command. It applies to PWM as well for example ServoSpeed(d0, 4) PWM(d0, 5) Sleep(3000) PWM(d0, 90) Rich United Kingdom #4 May 2014 Even I learn something new from time to time, I did not know ServoSpeed() applied to PWM too, that's much easier Login to post a comment
reaktor France Asked May 2014 — Edited May 2014 Resolved by Rich! How To Gradually Increase And Lower The Value Of Pwm Skip to comments Jump to end Hello, I would like to gradually increase and lower the value of PWM. Does anyone know how to do? thank you Jump to end
Rich United Kingdom #1 May 2014 You could script it quite easily. $pwm_target = 100 # Set for target speed $pwm_start = 0 # Set for start speed PWM(D0,$pwm_start) :loop IF(GetPWM(D0) < $pwm_target) PWM(D0,$pwm_start) $pwm_start= $pwm_start + 5 # Change 5 to required amount for speed of increase ELSE Halt() # PWM at required level, stop script. ENDIF Sleep(10) # Change sleep to suit speed. GOTO(loop) Apologies if the code is a bit messy and not explained too well I'm strapped for time but it should give an idea (hopefully)
You could script it quite easily. $pwm_target = 100 # Set for target speed $pwm_start = 0 # Set for start speed PWM(D0,$pwm_start) :loop IF(GetPWM(D0) < $pwm_target) PWM(D0,$pwm_start) $pwm_start= $pwm_start + 5 # Change 5 to required amount for speed of increase ELSE Halt() # PWM at required level, stop script. ENDIF Sleep(10) # Change sleep to suit speed. GOTO(loop) Apologies if the code is a bit messy and not explained too well I'm strapped for time but it should give an idea (hopefully)
DJ Sures PRO Synthiam #3 May 2014 Or you can servospeed() command. It applies to PWM as well for example ServoSpeed(d0, 4) PWM(d0, 5) Sleep(3000) PWM(d0, 90)
Or you can servospeed() command. It applies to PWM as well for example ServoSpeed(d0, 4) PWM(d0, 5) Sleep(3000) PWM(d0, 90)
Rich United Kingdom #4 May 2014 Even I learn something new from time to time, I did not know ServoSpeed() applied to PWM too, that's much easier
Even I learn something new from time to time, I did not know ServoSpeed() applied to PWM too, that's much easier
You could script it quite easily.
Apologies if the code is a bit messy and not explained too well I'm strapped for time but it should give an idea (hopefully)
Ok, I understand how the code works. Now it's clear. Thanks
Or you can servospeed() command. It applies to PWM as well
for example
Even I learn something new from time to time, I did not know ServoSpeed() applied to PWM too, that's much easier