How to use DERV bloc in RSLogix

pbr_forum

Member
Join Date
Aug 2010
Location
Rimouski
Posts
15
Hello
I want to derive a signal in RSLogix. I see there is a bloc called DERV that seems to derive. I have read the instructions but I need a little bit of help. Here is my probleme: I would like to have the derivative of my signal at each 10 secondes, but with different DeltaT (I want to find the best DeltaT, so I have 3 blocs with 3 different DeltaT). I would like to know how to set these properties.

Thank You!

Have a good one!

Pierre
 
I'm not 100% sure I understand your question but I'll take a stab at it.

DeltaT is the measured amount of time that has elapsed between one execution of the block and the next. It is not an adjustable input parameter. You will most probably want to use DERV in a program under a periodic task and set .TimingMode to 0 for periodic. Set the task period to 10 seconds so that the program executes once every ten seconds. The DERV instruction returns .Out, or dIn/dT in units per second. If you need something else then adjust the gain. eg, a gain of 60 would be units change/minute, a gain of 3600 would be units change/hour, etc.
 
Ok I see, thank you.
I don't think I can set a period of 10 secondes because I am monitoring the signal continuously...or I don't understand what you mean by «Set the task period to 10 seconds so that the program executes once every ten seconds».

Hope to hear from you soon!

Pierre
 
Ok well here is the info:

I am monitoring in real-time the concentration of microalgaes (that I call ''X'') in a photobioreactor, usually for a period of 7 days. I would like to be able to mesure de growth rate, in others words, dX/dt. So I would like to find a way, with RSLogix, to derive my signal in order to monitor the growth rate continously.

Thanks again!

Pierre
 
Well, at first I thought I could set de DeltaT, but then Alaric told me I can't set it myself. I want my resulting signal to have the less noise possible, but still representative of the growth curve.

Thanx and have a good one,

Pierre
 
So how does the DERV block compute a derivative? It would have been good to post a link to the pdf file.

There are many different ways of calculating derivatives.
IIR and FIR filters of different types. A simple rate calculation with a low pass filter may do but you haven't mentioned anything about bandwidth.

If you want the least amount of noise you are talking about a Kalman filter or H Infinity filter but I doubt you want to do that much work in a PLC.

How about a simple Savitsky-Golay filter? It is kind of a weight moving average that generates average values and derivatives that should minimize the squared error.
http://en.wikipedia.org/wiki/Savitzky–Golay_smoothing_filter
http://en.wikipedia.org/wiki/Numerical_smoothing_and_differentiation
http://www.holoborodko.com/pavel/?page_id=245
The last filter, the Holoborodko filter, is kind of novel. I would consider that one or the Savitsky-Golay filter because they are relatively simple to implement. If you read the comments you can see I am helping Pavel compare his filter with the Alpha-Beta-Gamma filter which is a very simplified form of Kalman filter. I just like to know algorithms.
http://www.deltamotion.com/peter/Mathcad/Mathcad - holoborodko.pdf

I was going to drag this on by just asking one question at time just to make a point.
 
Originally posted by Peter Nachtwey:

So how does the DERV block compute a derivative? It would have been good to post a link to the pdf file.

I thought you guys had a copy or 5 of Logix5000 at your place? DERV is in the instruction help.

It is a simple digital differential with gain. Nothing fancy. No filtering that I can see.

With a very slowly changing signal I think you will need something a little more sophisticated than DERV if you want a decent update rate.

Keith
 
The Logix5000 DERV is

Gain*(Inn - Inn-1)/DeltaT where DeltaT is the measured amount of time that elapsed between the Inn and Inn-1 values.
 
I thought you guys had a copy or 5 of Logix5000 at your place? DERV is in the instruction help.
We have 5 copies around some place but many are in the production area so I don't always have access to RS5000. I haven't played with RS5000 now for about 8 years except to show how to setup Ethernet communications with our controller for training classes.

It is a simple digital differential with gain. Nothing fancy. No filtering that I can see.
I don't see the point unless it can accurately time the difference between two readings to eliminate the sample jitter.

With a very slowly changing signal I think you will need something a little more sophisticated than DERV if you want a decent update rate.
The obvious thing is to do is to run the DERV block every 0.1 seconds or so and simply apply a low pass filter to the output of the DERV block. I believe there is a LEADLAG block that implements a the low pass filter to remove noise.

I like to run simulations and compare the estimated value to the actual value and tweak things to reduce the squared error. This way I can tell what parameter provide the best results. I have no idea how pbr_forum was going to tell which DeltaT was providing the best results without doing something similar.
 

Similar Topics

hello, I'm new in automatics, and i'm working on a speed control project for a hydraulic turbine. i'm using FB41 pid bloc, but the LMN give me 0...
Replies
3
Views
2,262
Hi All; I'm new to PLC. I want to buy a CUBLOC CB405 and i would like to connect a display and a keypad to the unit and control them using...
Replies
0
Views
2,033
I was wondering if anyone here has or is using the CUBLOC products from Comfile Tech. What I would like to know is if it can be connected to an...
Replies
0
Views
1,831
We are using CONTROBLOC T20 controller from Alsthom, France. It is used for circuit breaker automatic opening and closing purpose. When i have...
Replies
0
Views
2,701
Does anyone know how to connect earthLCD.com's color LCD to Comfiletech.com's CUBLOC? It runs Basic so if you have any basic stamp experience this...
Replies
0
Views
1,674
Back
Top Bottom