robert_ Posted January 30, 2015 Report Posted January 30, 2015 Hello, anyone know how to make a logic that monitors the change in position of a carriage through some rails ?. In my application I measure the position of the carriage by means of a laser sensor and I have to detect if the laser beam is interrupted when the carriage is stationary or moving. I have implemented a logic as the adjunct file, but doesn't work. Quote
MrAutomation Posted January 30, 2015 Report Posted January 30, 2015 (edited) You should put this in the allen bradley forum. It looks like RSLogix 5000. I don't really understand your logic, it doesn't make sense to me (it just seems to go in circles and not really accomplish anything). Can you answer a few questions? What is the typical reading of the sensor? What is the reading of the sensor when it's interrupted? What do you want to do under normal operations? What do you want to do when it's interrupted? Answer these 4 questions and it will be much easier to help. Edited January 30, 2015 by MrAutomation Quote
robert_ Posted January 31, 2015 Author Report Posted January 31, 2015 the carriage is moved by electric motor, and I want to monitor its position to know when the car loses its position. I don't use encoder for this application, I use laser sensor and I wanna know when the carriage lost his position because of an interruption in the laser beam or a sudden change in accounts analog signal. someone had recommended me to program a logic that monitors the position of the carriage every so often (perhaps every two seconds) and when it detects that there was a change in position from the previous scan, then generate the error bit in the laser. Go storing the position from time to time and compare it with the previous, could be something ?, but I have doubts of how to implement it Quote
MrAutomation Posted January 31, 2015 Report Posted January 31, 2015 (edited) Oh I understand. It takes a sample of the current position, and later it takes a sample of the position again. If the error is too great in either direction, flag an alarm. What's not working with it? It actually seems like it should work, now that I understand what it is. The one question I have is the "%s6" tag. I don't know if that would work. What PLC is this? Try replacing that with a real timer. Edit: Also, change the scan order of your blocks. Right now it's all out of order, and that could be causing the problem. The numbers at the top left of each block should go from 1 to 6, reading left to right, then down to the next row, like a book. This way the blocks will be executed in the order that makes logical sense according to the program. Sometimes the scan order doesn't really make a difference, but sometimes it makes a big difference. Edited January 31, 2015 by MrAutomation Quote
cHud Posted February 2, 2015 Report Posted February 2, 2015 (edited) This is a schneider plc written in Unity Pro The numbers of the block doesnt make a difference at all. Your code looks fine....I think the problem is with using the enable pins on the blocks. I would let the subract abs and gt blocks calculate on every scan so take out the enable pins. Use the %s6 on your move block's enable pins . I would use the same %s6 bit to trigger that and again the last move aswell. Use not alarm and %s6 to trigger the move for the last block Edited February 2, 2015 by cHud 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.