Jump to content
Sign in to follow this  
qassim93

Creating ON/OFF controller with analog IN/OUT using VisiLogic

Recommended Posts

Greetings,

I'm new to this form and to Unitronics PLCs and I would like to ask for some help/

I previously programmed "allen bradley" PLCs using a software called "RSLogics". The were 4 programming languages that I can use to build the PLC program. However,  VisiLogic doesn't have "Structure text" language. I already have done the analog conversion using formulas and created the HMI, but I'm stuck now :(

The program that I am trying to make is simply as follows:

  1. A number is written using the HMI and stored in a variable.
  2. This number is then compared to analog reading of the pressure sensor.
  3. If the numbers were different, then one analog output will be changed to reflect the number entered using the HMI - which will control a pressure regulator.

Could anyone please help me with this issue ?

 

Many thanks,

Qassim

Share this post


Link to post
Share on other sites

Greetings Qassim, basics first please.

For both the pressure regulator and the pressure sensor, what types of signals do they work with?  0-10 V?  4-20ma?  PWM?

What PLC & I/O are you using?

Can the system mechanically tolerate immediately changing to the new setting, or does it need to ramp?

cheers,

Aus

Share this post


Link to post
Share on other sites

You need to close the loop.

It sounds like you want to enter a new pressure setpoint.  You have no guarantee that adjusting the analog output by a certain amount will result in the pressure you want.  Rather, you need some code that will adjust the analog output accordingly until the pressure is equal (or close to) the number entered on the HMI.

This could be done with a PID block or some simple compare blocks.  Post the PLC ladder program (the .vlp file) that you've worked on so far so we can see the hardware you're dealing with the the scaling you've done.

Joe T.

Share this post


Link to post
Share on other sites

Hi,

Many thanks for the reply @Ausman & @Joe_Tauser.

I spoke to the guy responsible for the project and it turned out that he was mistaken. 

There is no set point required by the user. The functions looks like a simple linearization. 

The pressure read by the pressure sensor will directly drive the pressure regulator with a given formula. 

 

Currently I'm trying to create this simple program. But since I don't have any experience in using this program, I think it will take me some time to learn it.

 

Many thanks,

Qassim

Share this post


Link to post
Share on other sites

Here's what you/we need to know for this application, regardless of whether it's a Unitronics or Allen Bradley PLC- 

1.  The range of the pressure sensor and it's electrical output - 4/20 mA, 0-10V, 0-5V, or other

2.  The model number of the analog input module or PLC it's connected to - required to determine the number of bits in the A/D

3. The "given formula" in detail

4.  The model number of the analog output module - once again, the scaling code will be dependent on the module's D/A

 

On 6/21/2018 at 4:17 AM, qassim93 said:

VisiLogic doesn't have "Structure text" language.

It sounds like the majority of your challenge will be learning how to program in ladder.

Actually, very few of the small PLC manufacturers have spent the time, money and effort to conform to IEC-61131-3, regardless of what you read in the online trade articles.  There's a reason why Visilogic is a free download and RSLogix 5000 is a $3,000 US software package, with an $800 US annual support subscription.

Take a swing at it and post your code.  We will do the best we can to help.

Joe T.

 

 

Share this post


Link to post
Share on other sites

Hi,

Many thanks for your reply Joe :)

The PLC model I'm using is "Unitronics SM43-J-RA22". I will answer the questions you listed and we need to know their answers:

  1. the range of the pressure sensor is from 2 - 30 Psi(abs). Its sensitivity is 3mV/psi. Full scale span is 90mV.
  2. The analog input of this PLC 14bit (16384units). Its Input is set to 0-10v.
  3. The analog output is 12bit  - from 0-10v. 
  4.  The relationship between the pressure sensor reading and the output that will drive the pressure regulator is pretty simple: the pressure reading will be from -0.5Bar to 0Bar. and the pressure regulator should start at 3Bar @ (-0.5Bar sensor reading) and ends at 0Bar @ (0Bar sensor reading).

I used "Linearization" block to create the relationship between the pressure sensor input and pressure regulator driving output - as shown in the figures below. 

image.png.f1998785dfbd33ff224a2f7ef65dd020.png

image.png.0842f2a9879e6389668c833f8249db98.png

BR,

Qassim

 

Share this post


Link to post
Share on other sites

I don't think you are going to need it, but keep in mind that you may need to have further ladder work to set max and min outputs from the Linearization.   It may not be a problem, but unless you do this the output numbers will keep on being done, regardless of whether they are outside the control span you need.  This is an annoying quirk of Linearization that if needed, needs to be factored into every use by using compare blocks.

cheers,

Aus

Share this post


Link to post
Share on other sites

Thanks for your reply @Ausman

I removed the linearization block - because I cannot use float and created a formula instead. 

The attached image shows the way I did it.

I will test the thing and post an update about it.

BR

IMG_20180628_101654[1].jpg

Share this post


Link to post
Share on other sites

Hi Qassim

If you want to use the linearization  block just use MI or ML without the decimal place.

For example if the input range is 15.25 to 95.35 just use 1525 to 9535.

When it comes to display the result use the input screen to determine the decimal position.

Regards

Denis

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...