Identify Analog Input reaching steady state

Moosetracks

Member
Join Date
Apr 2016
Location
Missouri
Posts
35
I have a analog laser distance sensor. It measures a pneumatic actuators position. I want to know when the actuator has stopped (its used as a clamp so I can't use a prox sensor because the position varies.

I have done this before using a timer. Each time the timer is done I compare the last value to current value and if the change is less than a set limit I call it stopped.

However sometimes the measurement update rates are not exact or the cylinder is moving a larger load and all the other real world variables get in the way. I am about to add a FIFO so I can look at several past measurements to get better performance, but I was curious how would you guys code this to decide when its actually stopped.
 
Setup a counter to 5 or so. Compare current read to previous read. If in range, increment counter. If false, reset counter.

When counter reaches preset, you are stopped.
 
Reached steady state is usually max(FIFO) - min(FIFO) < Tolerance
Length of FIFO buffer is the time it needs to be in tolerance for.

I have been using the CompactLogix 5370 lately and they have a moving standard deviation function built in which could be a nice easy one to slap in if you feel others that need to look at the code will find function block or structured text ok.
 
If the actuator is double acting and speed controlled pressure might be a better option. When the pressure on the exhaust side of the cylinder has reached atmospheric it has stopped moving unless your cylinder is marginal for the "larger loads". And if the cylinder is marginal whatever you do will work a whole lot better if the cylinder is upsized.
 

Similar Topics

I received an email from a student with the following code attached. This is supposed to control a floodgate system, and supposed to be written...
Replies
23
Views
793
Hey All. I am working on my home automation system (again). I want to tinker around with my irrigation system. The system itself is pretty...
Replies
9
Views
1,814
I have a CompactLogix 5280 a I am trying to figure out which of the Ethernet ports are A and B. Not finding it in the manual and this is a new...
Replies
2
Views
1,206
I have a project I am designing a quote for an upgrade on. Per the schematic, the PLC I saw and an upload I took, it is run by an AB MicroLogic...
Replies
6
Views
2,690
I have a Versapro project file for a Versamax PLC. Need to identify what type of variables are suitable and made available for BMS system to...
Replies
3
Views
1,711
Back
Top Bottom