Guide to I/O and PID controllers?

Discussion in 'Electronics & Electrics' started by ToanIsAnIdiot, May 24, 2012.

  1. ToanIsAnIdiot

    ToanIsAnIdiot Member

    Joined:
    Oct 22, 2010
    Messages:
    552
    Location:
    Sydney
    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?
     
  2. paulvk

    paulvk Member

    Joined:
    Mar 10, 2010
    Messages:
    1,031
    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
     
  3. OP
    OP
    ToanIsAnIdiot

    ToanIsAnIdiot Member

    Joined:
    Oct 22, 2010
    Messages:
    552
    Location:
    Sydney
    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...
     
  4. mtma

    mtma Member

    Joined:
    Aug 12, 2009
    Messages:
    4,404
    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: May 24, 2012
  5. dakiller

    dakiller (Oscillating & Impeding)

    Joined:
    Jun 27, 2001
    Messages:
    7,461
    Location:
    Gippsland
  6. OP
    OP
    ToanIsAnIdiot

    ToanIsAnIdiot Member

    Joined:
    Oct 22, 2010
    Messages:
    552
    Location:
    Sydney
    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/downloads/downloads.asp?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?
     
  7. Fred Nurk

    Fred Nurk Member

    Joined:
    Apr 5, 2002
    Messages:
    2,123
    Location:
    Cairns QLD
    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.
     
  8. OP
    OP
    ToanIsAnIdiot

    ToanIsAnIdiot Member

    Joined:
    Oct 22, 2010
    Messages:
    552
    Location:
    Sydney
    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!
     
  9. aXis

    aXis Member

    Joined:
    Jun 27, 2001
    Messages:
    4,963
    Location:
    Kalgoorlie, WA
    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: May 25, 2012
  10. OP
    OP
    ToanIsAnIdiot

    ToanIsAnIdiot Member

    Joined:
    Oct 22, 2010
    Messages:
    552
    Location:
    Sydney
    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!
     
  11. mtma

    mtma Member

    Joined:
    Aug 12, 2009
    Messages:
    4,404
    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.
     
  12. aXis

    aXis Member

    Joined:
    Jun 27, 2001
    Messages:
    4,963
    Location:
    Kalgoorlie, WA
    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: May 25, 2012
  13. OP
    OP
    ToanIsAnIdiot

    ToanIsAnIdiot Member

    Joined:
    Oct 22, 2010
    Messages:
    552
    Location:
    Sydney
    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?
     
  14. paulvk

    paulvk Member

    Joined:
    Mar 10, 2010
    Messages:
    1,031
    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
     
  15. Fred Nurk

    Fred Nurk Member

    Joined:
    Apr 5, 2002
    Messages:
    2,123
    Location:
    Cairns QLD
    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.
     
  16. OP
    OP
    ToanIsAnIdiot

    ToanIsAnIdiot Member

    Joined:
    Oct 22, 2010
    Messages:
    552
    Location:
    Sydney
    Thanks for that Paul, Fred!

    Some really great info there in your replies I will need to look into! There's still so much I have yet to learn and am greatful for the guidance!

    Cheers,
    Toan.
     
  17. aXis

    aXis Member

    Joined:
    Jun 27, 2001
    Messages:
    4,963
    Location:
    Kalgoorlie, WA
    The Pressure sensor has 4 terminals and can be loop powered or field powered.

    Edit: Whilst it's not my preferred configuration, there is nothing inherently wrong with using voltage based schemes at the input and it's not uncommon to see this in certain industrial scenarios. I have packs of 250ohm 0.5% resistors on my minesite expecially for this purpose - that gives you a 1-5V signal. The main issue is that voltage based schemes are more succeptible to interference, plus inaccuracies caused by resistance in the wiring - so you need to keep the wiring runs short and in good condition. A current loop with a resistor right at the input terminals (or close to) will work just fine.

    Half right. I've used plenty of voltage based gear (usually lab/online analysers) and as long as you can have a non-zero datum, like 1-5 volts, you can still do underrange/open loop detection. Using a resistor on a current loop will achieve just that.
     
    Last edited: May 28, 2012
  18. Fred Nurk

    Fred Nurk Member

    Joined:
    Apr 5, 2002
    Messages:
    2,123
    Location:
    Cairns QLD
    You're correct, resistors across a voltage input will work fine, but if it were a new design I'd not accept it unless there was some sort of strange unit that wouldn't work. If you've got a dud current loop card and all you've got is voltage inputs, for sure. If theres an option to specify it as a current loop in the first place, I'd do that first.

    Same with the 1-5V connection, its perfectly functional, I'd rather specify current loop inputs whereever possible. Most of the time I get to do that. Actually, I'd rather specify comms for data extraction but thats a discussion for another whole thread.
     
  19. aXis

    aXis Member

    Joined:
    Jun 27, 2001
    Messages:
    4,963
    Location:
    Kalgoorlie, WA
    I fully agree, but for this hobbyist application I dont think it really matters.
     
  20. Fred Nurk

    Fred Nurk Member

    Joined:
    Apr 5, 2002
    Messages:
    2,123
    Location:
    Cairns QLD
    You're right, but I suspect the OP's leaning towards an industrial consideration, just that the Arduino has come into play as a test bed. Its sure cheaper than a PLC...
     

Share This Page