second order equation implementation if controllogix

Osias1970

Member
Join Date
Sep 2010
Location
Singapore
Posts
12
Hello,
I want to implement second order differential equation in controllogix using RSlogix 5000. The equation as attached.
How to implement it?

Thanks.
 
The math operations exist, break it down into smaller components. Epsilon may have to be hardwired. Down side? Floating point in Controllogix is only 32bit.
 
Why would you want to solve a differential equation in a PLC?

I suggest the first thing you do is substitute for the differentials in the first equation, and then solve for y - which I assume is your output value from a control algorithm. Then you can enter the equation in ladder logic as a straight algebraic equation using the ControlLogix math functions.
 
OK - but you also show the equivalents of the derivatives. So attached is the substitution. Now solve for your dependent (output) variable using ordinary algebra and, magically, the differentials are gone.
 
PLCs don't "solve" equations; they use equations to calculate values.

If you substitute your bottom 2 equations into your first, you get:

k²ekx - 3kekx + 2y = 0

or

y = - (k²ekx - 3kekx) ) / 2

Measure x with the PLC, you can calculate y.

If you're measuring y, well then god help you figure out how to solve the equation for x.

[EDIT: Tom beat me to the same answer]
 
Last edited:
Based on the equations for the first and second derivatives, you already know that y is equal to e to the power kx, so you can calculate the value of y for any value of x if k is a known constant. Is your need to find a value of k for each value of x to satisfy the differential equation?
 
bingo!!! It took this long to figure that out.

This isn't really a PLC problem, is it?
There are two poles. one at 1 and the other at 2. Both of the there will cause what ever it is to ''blow up" or go to infinity shortly.

On pole will be exp(t) and the other exp(2*t)

There is no forcing function of input to this differential equation either.
Yes, i can pretty much do simple diffEQs like this in my head.

A more realistic problem would be y``+3*y`+2*y=f(t)
notice that if f(t)=2 then y will be equal to 1 so the gain is 1/2.
Now the two poles are negative and will decay over time and there is a forcing function that makes the system do something.
 
Various transfer functions can be represented by differential equations. For example higher order (than just averaging...first order) filtering of noisy data to smooth it out with less delay than a first order solution.

My last/only experience with this was for aircraft flight control and stability augmentation systems in the late 1980's. We were just starting to use embedded microprocessors to replace the earlier analog circuits. Today's PLCs would be up to the computing task, but the redundancy requirements would be a problem.

In general, you need to convert the differential equation into an approximately equivalent difference equation. You need to take the sampling time (must be greater than plc scan time) into account to pre-warp the coefficients.

Beware that higher order equations may exhibit oscillatory response (limit cycling) when converted to discreet time form when the the continuous time form was stable. For this reason it is better to design the system with discreet time/difference equations from the outset.
 
In general, you need to convert the differential equation into an approximately equivalent difference equation.
Integrating the differential equations using Runge-Kutta is better because the differential equation can be non-linear and it is easier to model disturbances.

Beware that higher order equations may exhibit oscillatory response (limit cycling) when converted to discreet time form when the the continuous time form was stable. For this reason it is better to design the system with discreet time/difference equations from the outset.
I never had that problem because I know where to place the closed loop poles and the sample times on a motion controller are fast and deterministic.
 
Thank you for reply.
We want to implement the y(t) to model the anode voltage Vs alumina concentration to control anode voltage in smelting process.
We plan to implement this model in PLC.

can we use delta motion controller to implement this model?
This is non linear with second order of differential and exponential as can seen in attached curve.

Voltage Vs Alumina Concentration.jpg
 
Yes, the Delta RMC can do complex math real time.
It looks like you have solve the math and have the equations already so the RMC only needs to find the position as a function of Alumina concentration and the A/cm^2.

The RMC can also use cubic interpolation between points but if the A/cm^2 value is constantly changing you have a two dimensional problem so equations would be best.

What are the equations? I can enter them into RMCTools and show how long the calculations would take. That way the math part would be done.

The RMC can execute the equation faster and easier than a Control Logix. The lines in the graph do not match the simple differential equation present in the first post.
 
Hello Peter,
I have two different model:
1. Equation as previous post (d2y(t)/dt2) = a*(b^2)*(e^bt) where a and b is parameter that will define it as constant.

2. chart that I sent in last post. From this chart need to write or define the equation.
 

Similar Topics

I've become interested in code for digital filtering. I have read this excellent (and old) thread ...
Replies
3
Views
10,373
I have an interesting problem with trying to improve upon an existing control system to control a vehicle throttle (based on speed setting) that...
Replies
17
Views
5,560
Hello all I have the opportunity to buy some second hand unused components, they are Siemens motor modules, a CPU, inputs and outputs. I have...
Replies
16
Views
2,052
Hello all. I have a 1769-L16 that I inserted a 1769-L35E into. I was expecting it to create module defined tags automatically in my controller...
Replies
10
Views
1,753
Hey guys, I'm not super familiar with Cnet, so I'd like some insight from people with more ControlNet experience than I. We have a controllogix...
Replies
4
Views
844
Back
Top Bottom