Sign in to follow this  
Followers 0
damaged

Ramping Instructions

13 posts in this topic

Is there any instruction in CX-Prog that I can use to ramp an analog out? The only thing I can think of doing is writing long codes doing some - / +. Any suggestions would be greatly appreciated.

Share this post


Link to post
Share on other sites
Yep.. although the code is not complicated... eg.. compare target to new if target > new then every scan add 1 else if target < new then every scan minus 1 You might want to put clamps on as well so as you don;t go out of range

Share this post


Link to post
Share on other sites
if you want a scan independent ramp, just program it in a time based interupt program. or increment on a pulse bit from the PLC

Share this post


Link to post
Share on other sites
Thanks Guys, ....Seems I just didnt think about it hard enough. LOL...

Share this post


Link to post
Share on other sites
Ok Guys, as easy as it sounded, it did not go over as well. The output was very jerky and unstable and the output was all over the board. Let me give some background info here. Hydraulic prop Valve + - 10VDC. max output data to the card +-2047 Signed Decimal (This also gives me a problem that I cant think of a solution with Indusoft, cant give me a negative display I have only 3 choices-Hex Dec Bi - No Signed) Anyway this is what I have: If "New Setpoint" = "Output" then "No Ramp" - This is my ramp condition. If "No Ramp" off is true then compare.... if "New Setpoint" is > "Output" then [(+410) "Ramp Variable = 10 (Dec)" to "Output"] If "New Setpoint" is < "Output" then [(- 420) "Ramp Variable = 10 (Dec)" to " Output"] The output is up and down round and round...LOL... I am thinking of taking BeeGee's advice and do a pulse to slow the data flow down alittle. Any suggestions.....on the code and the Indusoft issue? I can send you the actual ladder and let you guys look at it....

Share this post


Link to post
Share on other sites
You may need a deadband of say +/- 5 on your setpoint because if the setpoint is not a multiple of 10 then it will never be achieved. The PLC will end up hunting for the setpoint. Are you using the @+410 or @-420 with a timer for the ramp or are you just using +410 or -420 with every scan? If its every scan then the ramp from -10V to +10V would take about 410 scans which is probably less than 1 second. This is probably much faster than you want to have. Better to use the @+ or @- with a timer.

Share this post


Link to post
Share on other sites
... When ramping I typically simply ++INC or --DEC the value until the output matches the target. I control the speed of the INC or DEC with a recycling timer. Have a look at the attached Function Block Example ... Nibroc Ramp_Example_FB.cxp
1 person likes this

Share this post


Link to post
Share on other sites
Hey Corb's... did your example need to be a version 4 PLC... could you convert it to a version 3 mate so i can have a look at you FB... Never mind... manged to open it doh... i like it Corbin... thanks mate..

Share this post


Link to post
Share on other sites
... Thanks Sleepzie, No version 4 PLC's in NZ yet ... (aussies wouldn't let us have em ??) guess we have to burn up the stock of V3's ... I wouldn't normally use an FB just for this functionality ... however this code would be incorporated into an FB controlling any analog valve ... (including functionality for auto, manual, duty limiting, position error, slamshut, etc) ... FB's are great for 'devices' ... Damaged: I suggest for your problem with the 'Indusoft' that you strip the sign bit, and report the servo valve control as separate direction/amplitude variables ... Nibroc (aka Corbi, Tim, ...) Edited by Nibroc

Share this post


Link to post
Share on other sites
Only one remark: I tend to use this not with a TIMHX but on an interval timer or with + &step becauseif you use the full scale you cannot ramp up in less than a second using ++ combined with TIMHX.

Share this post


Link to post
Share on other sites
... Accepted. This solution will not work where any full scale change is required in less than 4095 (for 12 bit) program cycles. However is OK where the required ramp is slower than this. Many applications require slow output change. I also note that correct PID tuning can often negate that need for ramp control. (the physical system itself can provide sufficient damping etc) And also note that higher speed ramp controls can be provided either by improved algrythms (to that I offered) or can also be facilitated using higher level process controllers such as Omron suffix 'P' PLC process controllers. ALL GOOD FUN !! Nibroc

Share this post


Link to post
Share on other sites
we use it mainly in speed control with inverters maybe it would be great to have such a program cycle independent ramp up and down function in the PLC (a little bit like in the SPED, PLS and PLS2 function). Anyone with connections at Omron Japan?

Share this post


Link to post
Share on other sites
Hey Guys, I finally got it.... First Problem.....I forgot to put the "S" for "signed" compare. Duhhhh I put the "S" in and run into another problem....the variable for the ramping wasto much are too little. So I had to add a few comparisons in to smooth it out. This may be the long way to do it but I got there with better than expected results. I have attached a sample of the code. Since I am using conditions to MOV a value to a DM and comparing, to test last night I was just putting -2000 to +2000(since I am dealing with a +or- Output) in the "New Speed" DM Thanks for all your ideas, I could still use some ideas on the Indusoft situation. Nibroc, My Problem is trying to keep it simple for the guy who will be setting the values. He will be able to type "-2000" into the DM but it will show him "F830" or "63547", so how will he verify that the value took, better yet how will he know to even change it? Nibroc, Also I just realized that you uploaded a FB, I am going to try it now..... Test.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0