
adccommunitymod (AutomationDirect) asked a question.
Created Date: March 25,2019
Created By: jking
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I have a manual pulse generator (MPG) handwheel, like you would find on a CNC machine, that I am attempting to use to jog servos using HSO outputs on a P2K. I am inputting differential voltage from MPG into HSI. The MPG has 4 outputs (A, B, and their inverses). My current method that I have figured out is to use the Every Other Scan bit (one rung NO and one rung NC) to take snapshots of the MPG position and then taking averages of those positions to determine if it is moving and in which direction. At which point I have OUTS for forward or reverse. My problem is it is not as accurate as I would like even though I have my average time constant set very low (ie... occasionally the OUT coil stays closed after I have released the MPG handle, which could cause a tool crash). Is there a better way to code a rotary input to jog servos?
Created Date: March 25,2019
Created by: jking
I have a manual pulse generator (MPG) handwheel, like you would find on a CNC machine, that I am attempting to use to jog servos using HSO outputs on a P2K. I am inputting differential voltage from MPG into HSI. The MPG has 4 outputs (A, B, and their inverses). My current method that I have figured out is to use the Every Other Scan bit (one rung NO and one rung NC) to take snapshots of the MPG position and then taking averages of those positions to determine if it is moving and in which direction. At which point I have OUTS for forward or reverse. My problem is it is not as accurate as I would like even though I have my average time constant set very low (ie... occasionally the OUT coil stays closed after I have released the MPG handle, which could cause a tool crash). Is there a better way to code a rotary input to jog servos?
Created Date: March 25,2019
Created by: quaizywabbit
i think the hsi's are asynchronous, so you shouldnt have to do every other scan, just catch it as it comes. treat it as an encoder.
Created Date: March 25,2019
Created by: ControlsGuy
Exactly. Make sure you can catch every edge, and like qw says, treat it exactly like an encoder. Watch the order of the edges, rising and falling, and A vs. B. That's what tells you when you 're changing direction. Here's the best part -- if the Productivity has an encoder input module or mode, that may even do the work for you. Look at the quadrature position of the handwheel and move to that same position on the servo.
Created Date: March 25,2019
Created by: jking
I am VERY new to PLC programming. I have never used an encoder before and am struggling to understand what instructions I need to use in order to accomplish what it is you 're telling me I should do.
Created Date: March 25,2019
Created by: MikeN
There are no instructions you need to use. In the HSI hardware setup, choose quadrature input and it will use the A/B on its own. It will track the position up and down by itself in hardware, independent of the scan. Whatever tag you decide to name the input channel in the position input will be the tag you use that tells you the current handwheel position.
You can use that position tag for all sorts of instructions, but the entire positioning itself is done on its own once you set a few parameters.
Created Date: March 25,2019
Created by: Todd Dice
Even though this video is referencing a P3K, since it and the P2K use the same software there should be some overlap on how it works. This video is part 2. Part 3 covers encoders.
https://www.youtube.com/watch?v=31nuHD93L0U