
adccommunitymod (AutomationDirect) asked a question.
Created Date: March 18,2009
Created By: flux70
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
Anyone have an easy way to ramp up an analog output 4-20mA signal? PID is too complex for the simple task I have. I am using a D-260 CPU and F2-8AD4DA-1 (8Ch. in and 4Ch. Out). The output resolution is 16 bit. I am controlling an ozone generator output from 0-100% and the mfr. reccomends bumping up the output in 5% increments every 15 seconds up to the remotely designated setpoint. The level will be set via C-More panel anywhere from 0-100%. Can anyone help me with the code for this app?
Created Date: March 18,2009
Created by: bcarlton
1. Create a ramp timer - any old TMRXX - preset 3000 (300 seconds)
2. Enable it to start the ramping
3. In the program
LD TAXX (pick up the current accumulated value)
MUL Final Analog Value
DIV K3000
OUT to your analog output location
Created Date: March 18,2009
Created by: bfitz
Bernie, that formula will ramp from the current setpoint (what ever that is) to the remote setpoint (what ever that is) in 5 minutes. Say he wanted 50% output and is at 0%. According to the manufacturer, he should be able to reach his setpoint in 150 seconds. With that program, it will take 300 seconds.
I'm not sure offhand what the logic would be to limit the rate of change; I'll have to think about it for a bit.
Brian
Created Date: March 18,2009
Created by: flux70
Thanks for the reply guys.
The output can be adjusted from panel at any time from any level it is currently at, whether that be 0%, 5% or 77%. When that change in desired output is sent then it would need to ramp up to the new value in the same manner, 5% every 15 seconds.
Created Date: March 18,2009
Created by: bfitz
I have attached a ladder program that should do what you require. V400 is a register that holds the 16 bit binary value of the current analog output. You would copy this value directly to your output register. V401 is a register that will hold the 16 bit scaled value of your setpoint. You will need to scale your setpoint register from 0-65535 and put that value here.
The add and subtract constants (Kb) come from the rate you specified. The calculated value was close to 11 counts per 50ms, so that's what I used (actual value was 10.92266666.) So this will change slightly faster than the manufacturer's recommendation, but not much.
This should work fine as long as your scan times aren't excessive (>25 ms). If they are, you can use one of the longer time base clock signals with a little more stair stepping; or we can rig a timer similar to bernie's original proposal.
Let us know if you have any questions.
Brian
Created Date: March 19,2009
Created by: flux70
Wow, thanks bfitz and all. This is very helpful and very close to what I had in mind. coming back down is not as crucial and could drop to zero instantly without any harm to the power supplies, as it sometimes does in an alarm condition if there is an ozone leak.
Thanks again!
Created Date: March 19,2009
Created by: flux70
That jpg came out pretty blurry. I'm having a hard time reading some of the registers but hopefully I can figure it out.
Created Date: March 19,2009
Created by: flux70
Nevermind,
I zoomed in on it and can make it out perfectly.
Created Date: March 19,2009
Created by: flux70
OK,
This is what I have so far. I have scaled the incoming data for 0-100 and stored it in V mem location V401. I then referenced that data location in your logic you suggested. Does it look right?
Created Date: March 19,2009
Created by: bfitz
I pdf'd your doc so I can read it at home. I'm headed out the door, but your math for scaling will need attention. It has to do with single vs. double instructions. More later.
Brian
Created Date: March 19,2009
Created by: bfitz
Interesting... You followed the example on scaling on page 15-28 exactly. My initial reaction to reading your ladder was that the DIVB wouldn't give you the results you wanted as the manual states that it is a 16 bit instruction, not a 32 bit one. However, the analog manual has the example using the DIVB instruction. If the example is correct, then your logic is correct. If their example is wrong, than your logic will need adjusting too.
Maybe someone from AD can chime in and clear this up.
Brian