Overclockers Australia Forums

OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Specific Hardware Topics > Electronics & Electrics

Notices

Reply
 
Thread Tools
Old 24th May 2012, 3:16 PM   #1
ToanIsAnIdiot Thread Starter
Member
 
Join Date: Oct 2010
Location: Sydney
Posts: 552
Default Guide to I/O and PID controllers?

Hi All,

I was wondering if anyone knew of any good resources on information about I/O and controller standards and such?

Ive been playing around with electronics and Arduino's, and my back ground in Chem Eng helps with my programming and control knowledge, but I am finding it hard to find information about understanding and implementing the connections sensors/equipment to controllers. (like pumps that have I/O that can be used to control and monitor their operation, but their manual only list the electrical terms for what each I/O line is, rather how to use them)

Things like RS-485 communication standards, Baud rates, Serial stuff and 4-20mA I/O... and then getting the controller to communticate to a computer via a GUI software....

Otherwise, would anyone know of any good short courses/tafe courses/uni courses that would delve into this sort of knowledge and skill?
__________________
Flickr Blog FB
ToanIsAnIdiot is offline   Reply With Quote
Old 24th May 2012, 3:43 PM   #2
paulvk
Member
 
Join Date: Mar 2010
Posts: 1,022
Default

So do you want a web-server type micro device that you can talk to and get from it information about its ports analog, digital and rs232/485?

Regards Paul
paulvk is offline   Reply With Quote
Old 24th May 2012, 3:58 PM   #3
ToanIsAnIdiot Thread Starter
Member
 
Join Date: Oct 2010
Location: Sydney
Posts: 552
Default

Thanks for the reply Paul,

I guess I am more after information about wiring said micro device to sensors that have output analogue/digital/RS485 ports on them... And then what each of the lines in the port actually means so that I can better program and control them with the micro controller.

Like a device will have a diagram that defines what each of its electrical connections are in its manual, but the varying types of connectors and terms used to denote what they do is beyond my scope of knowledge and understanding at the moment...
__________________
Flickr Blog FB
ToanIsAnIdiot is offline   Reply With Quote
Old 24th May 2012, 4:11 PM   #4
mtma
Member
 
Join Date: Aug 2009
Posts: 4,318
Default

For how I read it your second question is somewhat different to your initial question.

I think it would be clearer if you posted an example of what you're trying to do.

From what I read I would think that you're trying to find out more about interfacing to specific devices, in which case there's not much you can do but look at what the device says in their manuals. You will find that a lot of devices will have about three different documents describing what they do, usually a catalog datasheet with just a generic blurb, then an installation manual that goes over how to install the device, which may or may not contain 'programming' or application of the device itself, which might be a third document.

The magic is unfortunately in finding the right documents. You can learn about (for example) how RS485 works as a bus, but without known which bits to spit out at the device (which would probably be in the application or programming manual) to get a meaningful action or reply, then there's really nothing you can do with it.


Connector terminology, like D9, M12, etc and cable coding 'standards' (like DESINA) also vary greatly. Generally something will be 'standard' amongst a certain device because competing manufacturers are copying successful manufacturer's pin configurations so that their devices will be a drop in replacement. So on that count it is a real mess.

Last edited by mtma; 24th May 2012 at 4:14 PM.
mtma is offline   Reply With Quote
Old 24th May 2012, 4:15 PM   #5
dakiller
(Oscillating & Impeding)
 
dakiller's Avatar
 
Join Date: Jun 2001
Location: Gippsland
Posts: 7,297
Default

Sounds like you need to get the basics of what is digital signaling, try this - http://www.allaboutcircuits.com/vol_..._14/index.html
dakiller is online now   Reply With Quote
Old 24th May 2012, 5:55 PM   #6
ToanIsAnIdiot Thread Starter
Member
 
Join Date: Oct 2010
Location: Sydney
Posts: 552
Default

I will have to admit my knowledge in Electrical is limited to my degree's basic first year introduction to and what ive learnt in DIY/Arduino electronics kits...

so any information/resources about analogue and digital signal would be great!

I have also never been great at asking the right question haha...


As an example I guess, I have this micro PID controller:

http://www.novusautomation.com/downl...?FileID=517350

I have a pressure sensor

http://www.dwyer-inst.com/PDF_files/616w_iom.pdf

and I have a USB to RS425 Converter (that has 8 electrical connections - Rx-, Rx+, Rt2, Mod, GND, TX-, TX+, RT1 - I have no idea what these mean...)

I understand that I need to connect the 4-20mA signal output of the pressure sensor to my controller.

I would also need to power both units with my variable power supply.

I then connect the micro controller to the "USB to RS485" device via the RS485 so that a software can interface with it.

But by looking at the diagrams in the manuals im not actually sure on how to wire them together...

Is there a 101 guide to electronics and electrical wiring that would help with these? or does it just come with experience as all manuals and electronics are different?
__________________
Flickr Blog FB
ToanIsAnIdiot is offline   Reply With Quote
Old 24th May 2012, 7:02 PM   #7
Fred Nurk
Member
 
Join Date: Apr 2002
Location: Cairns QLD
Posts: 2,079
Default

It depends on what you want to achieve. Sounds like you're heading into process control territory which while fundamentally similar to microcontrollers, in implementation tends to get rather different quite quickly.

Industry standard IO often consists of discrete inputs and outputs (most often relays, but transistor IO is also common) usually found in PLCs and RTUs. Same with your PID controller, it might come with a couple of relay contacts configurable for alarms.

As you've discovered, most of them also come with some sort of analogue input, most often 4-20mA but 0-5V, 0-10V and so on are also not unusual.

Finally, theres often a comms interface, as you'll need to configure your controller. Some are configured by the front panel wuth pushbuttons, a lot more these days have some sort of comms interface to talk to it.

Most fancier controllers also include some sort of industrial comms capability, physical interface ranges from RS232, RS485, often ethernet, and sometimes things like CANBus. Depending on a number of factors, various physical interfaces support different communications protocols, such as Modbus, CANOpen, Profibus and others. The OSI model has some details on what these are and why they're different.

I've got a manual that goes into some depth on the above, pm me your email address and I can pass it on.
__________________
Insanity is doing the same thing every day and somehow expecting a different result.
People measure effort when they can't measure results. When someone complains of a lack of effort on your part, you've already won as they don't know what you are doing, and they don't know what you should be doing.
Quote:
Originally Posted by Luke212 View Post
im an idiot savant.
Fred Nurk is offline   Reply With Quote
Old 24th May 2012, 9:47 PM   #8
ToanIsAnIdiot Thread Starter
Member
 
Join Date: Oct 2010
Location: Sydney
Posts: 552
Default

Quote:
Originally Posted by Fred Nurk View Post
It depends on what you want to achieve. Sounds like you're heading into process control territory which while fundamentally similar to microcontrollers, in implementation tends to get rather different quite quickly.

Industry standard IO often consists of discrete inputs and outputs (most often relays, but transistor IO is also common) usually found in PLCs and RTUs. Same with your PID controller, it might come with a couple of relay contacts configurable for alarms.

As you've discovered, most of them also come with some sort of analogue input, most often 4-20mA but 0-5V, 0-10V and so on are also not unusual.

Finally, theres often a comms interface, as you'll need to configure your controller. Some are configured by the front panel wuth pushbuttons, a lot more these days have some sort of comms interface to talk to it.

Most fancier controllers also include some sort of industrial comms capability, physical interface ranges from RS232, RS485, often ethernet, and sometimes things like CANBus. Depending on a number of factors, various physical interfaces support different communications protocols, such as Modbus, CANOpen, Profibus and others. The OSI model has some details on what these are and why they're different.

I've got a manual that goes into some depth on the above, pm me your email address and I can pass it on.
Hi Fred!

PLC's are definitely where I'd like to go one day, but that is far beyond my knowledge at the moment... I guess I didnt realize how different it may be to microcontrollers.

I'll PM you!, thanks for the help!
__________________
Flickr Blog FB
ToanIsAnIdiot is offline   Reply With Quote
Old 24th May 2012, 11:35 PM   #9
aXis
Member
 
aXis's Avatar
 
Join Date: Jun 2001
Location: Kalgoorlie, WA
Posts: 4,963
Default

Quote:
Originally Posted by ToanIsAnIdiot View Post
As an example I guess, I have this micro PID controller:

http://www.novusautomation.com/downl...?FileID=517350

I have a pressure sensor

http://www.dwyer-inst.com/PDF_files/616w_iom.pdf

and I have a USB to RS425 Converter (that has 8 electrical connections - Rx-, Rx+, Rt2, Mod, GND, TX-, TX+, RT1 - I have no idea what these mean...)

I understand that I need to connect the 4-20mA signal output of the pressure sensor to my controller.

I would also need to power both units with my variable power supply.

I then connect the micro controller to the "USB to RS485" device via the RS485 so that a software can interface with it.

But by looking at the diagrams in the manuals im not actually sure on how to wire them together...
The manuals are fine:

For the PID controller, pins 10, 11 and 12 are the sensor inputs. They say it supports 4-20ma inputs, so go down to figure 5 on page 2, where it shows the wiring diagram for 4-20 operation. In this case the negative side of the 4-20 iput goes to pin 10, the positive is pin 12.
For the pressure sensor, you can use the 4 wire system where power and 4-20 are seperated. Figure B on page 2 shows the terminals, and fgure C also help with the polarities - Terminal 1 is supply positive, 2 is supply negative, 3 is the 4-20 output positive, and 4 is 2-40 negative.

So.... wire terminal 3 from the pressure sensor to pin 12 on the PID controller, 4 on the sensor to 10 on the controller. What was so hard about that?


For the 485 it's a bit trickier. The PID controller only has 2 data lines and a common ground - so this is called a 2-wire system. Have a look in your USB converters manual and it will tell you how to wire it for 2-wire mode. I googled around and I think I have the manual for the device (USB-i485) and on page 5 it says you can use either the two RX pins or the two TX pins, and what the matching common names are (eg D1 and D0) - the positive terminals and D1, and the negative are D0. The C on the PID controller is "common" or ground.

So... wire 485 terminal 1 (RX-) to PID terminal 17 (D0), and 485 terminal 2 (RX+) to PID terminal 16 (D1). 485 Terminal 5 (Ground) goes to PID Terminal 18 (C). Turned out to be pretty easy too.


I'm afraid you probably wont get taught this stuff directly in a manual, it's just logical analysis of the diagrams along with an understanding of the signaling standards.

Edit: I've been doing this stuff for years, and by "this stuff" i mean getting a new piece of equipment, reading the manuals and figuring out how to integrate it with other systems. I'm now employing a team of people who have to do that regularly - some people just get it, and others dont and need to be spoon fed. It's not just about experience, it's your ability to logically decipher information - and if there are gaps in your knowledge go off and do some research until it makes sense. With google these days it's super easy. Not sure how it gets taught but you will need to develop a personal problem solving methodology.

Last edited by aXis; 25th May 2012 at 1:27 PM.
aXis is offline   Reply With Quote
Old 25th May 2012, 12:10 PM   #10
ToanIsAnIdiot Thread Starter
Member
 
Join Date: Oct 2010
Location: Sydney
Posts: 552
Default

Thanks for that aXis!

I guess the way I learn is by examples, and seeing how things are done prior, and then understanding why that works and then applying them myself in that and other situations. Its also how I learnt things at Uni.

For me, I havent actually seen or watched someone wire something like this up, and so what may seem logical sounds foreign to me sometimes. Its also so fundamental and logical that I was finding it hard to find resources online that does delve into it. Which is why I went to the forums for a bit more specific help.

Reading through your description on how to wire it up though, I do understand it now, kinda feeling silly that its that simple! Thanks for that though! I think I will be better equipped when I come across this with other equipment!

One clarification though, with the controller, you mentioned a 100 ohm resistor. Looking back at the manual, the diagram that specifies the 100ohm resister is for remote SP input (Figure 6). I assume, I'd be wiring it up as shown in Figure 5 though for 4-20mA inputs?

Thanks again for your help aXis!
__________________
Flickr Blog FB
ToanIsAnIdiot is offline   Reply With Quote
Old 25th May 2012, 12:37 PM   #11
mtma
Member
 
Join Date: Aug 2009
Posts: 4,318
Default

SP or set point normally refers to the parameter that represents the value that you desire what you're controlling to be equal to. In this case, Remote SP refers to being able to modify this from an external analogue source, and the diagram shows the connections needed for this to occur.

Process Variable is the usual term for the variable that you are measuring (from the process), in this example it would be the signal measured by your pressure transducer.

These are two separate input variables. If you don't need or are not using a remote set-point, then you don't need to connect it.
mtma is offline   Reply With Quote
Old 25th May 2012, 1:23 PM   #12
aXis
Member
 
aXis's Avatar
 
Join Date: Jun 2001
Location: Kalgoorlie, WA
Posts: 4,963
Default

Quote:
Originally Posted by ToanIsAnIdiot View Post
One clarification though, with the controller, you mentioned a 100 ohm resistor. Looking back at the manual, the diagram that specifies the 100ohm resister is for remote SP input (Figure 6). I assume, I'd be wiring it up as shown in Figure 5 though for 4-20mA inputs?
Sorry, my mistake. I was in a bit of a hurry and until halfway though my post I was looking at figure 6. Eventually I realised and changed the terminal numbers as per figure 5, but forgot about the resistor. For the standard sensor input on pins 10 and 12, no resistor is required. My bad, I'll fix my post.

Last edited by aXis; 25th May 2012 at 1:30 PM.
aXis is offline   Reply With Quote
Old 26th May 2012, 10:06 AM   #13
ToanIsAnIdiot Thread Starter
Member
 
Join Date: Oct 2010
Location: Sydney
Posts: 552
Default

Quote:
Originally Posted by aXis View Post
Sorry, my mistake. I was in a bit of a hurry and until halfway though my post I was looking at figure 6. Eventually I realised and changed the terminal numbers as per figure 5, but forgot about the resistor. For the standard sensor input on pins 10 and 12, no resistor is required. My bad, I'll fix my post.
Thanks for that aXis! I thought so.

As a follow up question, if I also wanted to read the 4-20mA current on an arduino, can I just connect the pressure sensor connections to my ground and an analogue i/o on my arduino? or is it non advisable to run two things off one output?
__________________
Flickr Blog FB
ToanIsAnIdiot is offline   Reply With Quote
Old 26th May 2012, 5:18 PM   #14
paulvk
Member
 
Join Date: Mar 2010
Posts: 1,022
Default

The voltage must not exceed 5volts on any pin of an AVR (arduino). With the sensor it would depend if it draws the 4-20ma or outputs it but either way it will not be that simple. Here is some reading http://www.sensorland.com/HowPage028.html

Regards Paul
paulvk is offline   Reply With Quote
Old 27th May 2012, 9:02 AM   #15
Fred Nurk
Member
 
Join Date: Apr 2002
Location: Cairns QLD
Posts: 2,079
Default

Quote:
Originally Posted by ToanIsAnIdiot View Post
Thanks for that aXis! I thought so.

As a follow up question, if I also wanted to read the 4-20mA current on an arduino, can I just connect the pressure sensor connections to my ground and an analogue i/o on my arduino? or is it non advisable to run two things off one output?
You can't do what you're asking specifically for a number of reasons. Firstly, the pressure sensor appears to be loop powered, and your connection doesn't allow for power in the loop.

Secondly, the Arduino (and most likely just about all equivalent microcontrollers) has a 0-5V input whereas you're attempting to connect a current source to it. You can get around this issue by connecting a resistor across the input, but its not a good idea to consider this appropriate practice for industrial plant.

As an aside, one of the benefits of 4-20mA (as opposed to 0-5V or 0-20mA) is that you can use it for loop break detection. Minimum value for the transmitter is set at 4mA, so if your input reads 0mA chances are the loop is broken. You can't do that with a voltage input, 0V might be minimum value, but it also might be the transmitter has died.
__________________
Insanity is doing the same thing every day and somehow expecting a different result.
People measure effort when they can't measure results. When someone complains of a lack of effort on your part, you've already won as they don't know what you are doing, and they don't know what you should be doing.
Quote:
Originally Posted by Luke212 View Post
im an idiot savant.
Fred Nurk is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

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


All times are GMT +10. The time now is 8:24 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Micron21!