You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 8th, 2018, 10:14 AM   #1
Osias1970
Member
Singapore

Osias1970 is offline
 
Join Date: Sep 2010
Location: Singapore
Posts: 10
second order equation implementation if controllogix

Hello,
I want to implement second order differential equation in controllogix using RSlogix 5000. The equation as attached.
How to implement it?

Thanks.
Attached Files
File Type: docx second order differential equation.docx (25.9 KB, 76 views)
  Reply With Quote
Old February 8th, 2018, 10:22 AM   #2
jstolaruk
Member
United States

jstolaruk is offline
 
Join Date: Dec 2004
Location: Detroit, SE Michigan
Posts: 3,087
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.
__________________
"You can live to be a hundred if you give up all the things that make you want to live to be a hundred." Woody Allen
  Reply With Quote
Old February 8th, 2018, 10:42 AM   #3
Tom Jenkins
Lifetime Supporting Member
United States

Tom Jenkins is offline
 
Tom Jenkins's Avatar
 
Join Date: Apr 2002
Location: Milwaukee, WI
Posts: 5,836
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.
  Reply With Quote
Old February 8th, 2018, 11:08 AM   #4
Osias1970
Member
Singapore

Osias1970 is offline
 
Join Date: Sep 2010
Location: Singapore
Posts: 10
I have math formula for application that required second order equation.
  Reply With Quote
Old February 8th, 2018, 02:11 PM   #5
Tom Jenkins
Lifetime Supporting Member
United States

Tom Jenkins is offline
 
Tom Jenkins's Avatar
 
Join Date: Apr 2002
Location: Milwaukee, WI
Posts: 5,836
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.
Attached Files
File Type: docx substitution second order differential equation.docx (26.3 KB, 48 views)
  Reply With Quote
Old February 8th, 2018, 02:20 PM   #6
Aardwizz
Member
United Kingdom

Aardwizz is offline
 
Aardwizz's Avatar
 
Join Date: Dec 2017
Location: Swindon
Posts: 76
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 by Aardwizz; February 8th, 2018 at 02:23 PM.
  Reply With Quote
Old February 8th, 2018, 02:32 PM   #7
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,320
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?
  Reply With Quote
Old February 8th, 2018, 07:14 PM   #8
Osias1970
Member
Singapore

Osias1970 is offline
 
Join Date: Sep 2010
Location: Singapore
Posts: 10
Thank you for reply.
d2y(t)/dt2 = ab 2 e bt (second order differential as attached image)
How to solve y(t)?
Attached Images
File Type: jpg second order differential equation.jpg (9.0 KB, 149 views)
  Reply With Quote
Old February 9th, 2018, 09:38 AM   #9
Tom Jenkins
Lifetime Supporting Member
United States

Tom Jenkins is offline
 
Tom Jenkins's Avatar
 
Join Date: Apr 2002
Location: Milwaukee, WI
Posts: 5,836
This isn't really a PLC problem, is it?
  Reply With Quote
Old February 9th, 2018, 10:51 AM   #10
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,591
bingo!!! It took this long to figure that out.

Quote:
Originally Posted by Tom Jenkins View Post
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.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old February 9th, 2018, 12:46 PM   #11
Kevbo
Member
United States

Kevbo is offline
 
Join Date: Aug 2006
Location: Albuquerque,NM
Posts: 27
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.
  Reply With Quote
Old February 9th, 2018, 02:17 PM   #12
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,591
Quote:
Originally Posted by Kevbo View Post
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.

Quote:
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.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old February 9th, 2018, 07:27 PM   #13
Osias1970
Member
Singapore

Osias1970 is offline
 
Join Date: Sep 2010
Location: Singapore
Posts: 10
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.
Attached Images
File Type: jpg Voltage Vs Alumina Concentration.jpg (25.3 KB, 84 views)
  Reply With Quote
Old February 9th, 2018, 09:55 PM   #14
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,591
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.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old February 9th, 2018, 10:35 PM   #15
Osias1970
Member
Singapore

Osias1970 is offline
 
Join Date: Sep 2010
Location: Singapore
Posts: 10
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.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
RedLion to A-B ControlLogix 2stepsforward LIVE PLC Questions And Answers 1 July 18th, 2011 10:47 AM
Controllogix / Panelview Plus 600 question tinyku LIVE PLC Questions And Answers 8 May 29th, 2011 06:16 PM
ControlLogix Learning Curve? peterjung LIVE PLC Questions And Answers 20 May 25th, 2011 05:50 PM
Need Help for ControlLogix System gherz817 LIVE PLC Questions And Answers 0 September 14th, 2010 10:09 AM
unstable redundant controlnet communication for controllogix Mohamed El-khateb LIVE PLC Questions And Answers 2 July 12th, 2007 07:13 AM


All times are GMT -5. The time now is 01:26 AM.


.