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.
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.