Paul Ked Posted September 12, 2006 Report Posted September 12, 2006 I have an incremental encoder with A B & 0 outputs. Putting these into X0, X1 & X2 and rotating clockwise I get 0-359 and resetting every revolution, great! What I'd like to do when the motor reverses is to count back down to zero and then revert back to 359 so I can display the angle of rotation on the HMI. I am using the FX3u, is there a command I can use to do this? If not, any suggestions as to how I go about this? Best Regards Paul Ked Quote
panic mode Posted September 12, 2006 Report Posted September 12, 2006 only 360ppr? anyway, i didn't work with that plc but the idea is to configure those inputs for quadrature encoder. Quote
sid Posted September 13, 2006 Report Posted September 13, 2006 You can use the A/B Phase counter with reset input as your zero point signal of encoder. I have not woked with FX3u but after checking manual i found C252 can be used for your purpose. Quote
Paul Ked Posted September 13, 2006 Author Report Posted September 13, 2006 I'm only using a cheap encoder for this application (360ppp) as I only need to monitor the direction of rotation and the speed is only 6rpm. I am using C252 for this, but it is this counter that counts backwards once it gets to zero and is moving anti-clockwise. What I need to do is to somehow shift the data so that when I get -1 through to -359 is negate the number and invert it ie when C252 = -1 then D*** = 359 through to when C252 = -359 then D*** = 1. I always considered myself ok with maths but this has got me stumped! Best Regards Paul Ked Quote
Colin Carpenter Posted September 13, 2006 Report Posted September 13, 2006 Have you tried moving the value of C252 to a register then adding 360 to it? Quote
Colin Carpenter Posted September 13, 2006 Report Posted September 13, 2006 You're welcome, Paul. I've been stuck in my own "DO" Loop more times than I care to remember Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.