Sign in to follow this  
Followers 0
Mark The Spark

PWM CJ1M

7 posts in this topic

Anyone know of any restrictions to using the PWM command? Im running some 'direct' servo motors (PWM - DIR control) where I set the PWM duty cycle to alter the speed (frequency is constant), I've got some interupts called by prox sensors and positions and wish to slow down the motor by shoving in a new PWM duty cycle (I rerun the PWM command after changing my duty ratio value). I found that if the PWM command is within an interupt nothing changes, if I set a flag and use the main program to change the PWM it works!? This is not mentioned in any manual I can find, it also makes it rather slow to change the speed of a servo motor, anyone know any facts on PWM? also does the same limitation occur when using a proper 'motion control' module instead of the CPU22 I have? And 'Morgen' to those folks in 'den Bosch' Tashinz visited the other week....

Share this post


Link to post
Share on other sites
...how 'bout us here in the UK? ...can't answer your question though Mark. Sorry. Regards anonymous

Share this post


Link to post
Share on other sites
FROM W340-E1-12_CS & CJ PLC Instructions Reference Manual.pdf

Share this post


Link to post
Share on other sites
This could be off track, but is it possible that something is still writing to the PWM in the main program? I don't know anything about the PWM yet, so I could be well wrong.

Share this post


Link to post
Share on other sites
How many times did I read that section & not see that!!! Well I only call my PWM ins with @ so it should'nt be getting more calls but I'll set some traps to check... Seems odd to have a In/Out of an interupt task instruction error? I set my motion off in the main cyclic program and wish to change the duty factor to slow down the motor from interupt tasks, looks like I may have to call all my PWM commands from interupt tasks?? And I'll have a hoover up of any other pulse commands that may still be lying about in my cyclic (I was playing with frequency stuff earlier). Thanks all. Edited by Mark The Spark

Share this post


Link to post
Share on other sites
I've tried putting my PWM 'on' signal into an interupt task (255) which is called by a TKON instruction - no joy, no output at all now. I've also got P_ER flags on my PWM commands in my interupts (which I know are being called as I have activity flags) and they DO NOT come on even if I call the first @PWM from a cyclic task. Methinks the big book may be wrong as it states that PWM commands can be within all types of program area - it would appear that within an interupt task they are ignoored? Anyone know a way round this? I need a very quick change in the PWM duty factor when anyone of 10 interupt tasks are called.

Share this post


Link to post
Share on other sites
After more tests I'm now pretty sure that PWM commands do not work at all in anything other than the main cyclic programs - although an INI that turns them off does? If anyone knows otherwise please tell me how......

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0