Sign in to follow this  
Followers 0
jholmes

Slope Comparison in CX-Programmer

2 posts in this topic

I am looking for some input on how to proceed with programming some logic in CX-Programmer. The set-up that I am faced with is a calibration machine that has a flow meter that will give me a 0-10v signal input. I need to turn an adjustment screw with a small DC motor until a proper flow rate is reached. If it were just a set-point value, we would be away to the races - but the customer has requested that I compare also a few scenarios to wield out bad parts. An ideal calibration would be a straight 45 degree angled line on a chart of flow over time, the more I adjust the screw the more flow, in an even manner until my set-point is reached. I also need to catch a flow spike and flag it as a blocked unit, a relativity unchanged horizontal slope as a leaking unit, and a parabolic-styled slope that indicates a stripped unit. As for collecting my data, the current code I have is: on the start of the test, flag a 0.2 second pulsing timer that will move the scaled voltage input through a series of 30 data registers at a time - so I will have 6 seconds of data and 30 data points to work with. I was hoping to use a limit function to ensure that it is within a margin of error range from the ideal setting. The ideal setting I would like to calculate as a y=mx+b slope function - but that would entail making 30 calculations and making 60 total new data registers of a min and max value for each of my 30 data input points. To catch a leaking unit, I will add a plus/minus offset to the current data point and compare it to the previous 5 points, if it is within range than we know it is a leaking unit. The issue that I have with this code is it does not catch the blocked and stripped unit parameters I was hoping that someone has had some experience with using slope-related math and could provide some insight on to the best way to make a simple code for this application. I have attached what the four possible slope graphs that we are looking to catch. Edited by jholmes

Share this post


Link to post
Share on other sites
would you not just do a p/i/d loop driving a stepper motor a dc motor really does not do positioning all to well. what does the screw operate ? a vsd, pot, pot valve or something ? A vsd by chance? as these can do p/i/d and have no flow high flow and low flow control built in as feed back from current and power vrs speed, the danfoss fc202 aqua drive also has a derag function that can reverse for a short time to unblock nozzles or something if something goes wrong sort of like a washing machine agitator back forward until the blockage is cleared. To me it looks like you have a straight line a horozontal line and two tangent curves but it seems a silly way to attack it , but you dont show a flow spike picture you mention in your txt. if you have more info on your process you might be able to do it a better maybe using a apr table storing in expected flow at a given work point and an above and below comparison then adding the error's together to find an over all error above and below over time. you could do a mean or median across 5 points of data or something ? also im guessing if you over lap the flow lines ontop of each other on a graph blocked would mean low flow (flat line at bottom of graph), leaking would mean full flow (flat line on top of graph). if so this is easy just do a comparison over time and if it is above or below for a period of time flag a bit. idealy the flow line would be a set point and be a flat line in the middle that is a deviation from set point easy also as the set point changes you would change the error greater than less than margin. stripped i have no idea what you are talking about it looks like leaking then sudden blocking. if you are trying to capture flat lines in the middle of the graph you have to compair over time to set point change not a defined flow rate and it gets tricky as every thing then becomes relative say if it become blocked at half open or leaking at half open the comparison changes over time and process lag time needs to be accounted for. i have seen a flood gate control system for a small power station that was a simular to what you are trying to acheive. it has actuators that lifted the gates to supply water to the generator to keep the flow in the race a defined point as lake level effects the flow rate down the flood race. Edited by professor_jonny

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