Shop OBEX P1 Docs P2 Docs Learn Events
4-20mA output..... — Parallax Forums

4-20mA output.....

RichGRichG Posts: 2
edited 2006-07-28 23:33 in BASIC Stamp
What would be needed to generate a 4-20 mA analog current loop controlled by a basic stamp module? Is it possible for a stamp to control such a circuit on its own – or would some extra external electronics be needed??

Here’s the scenario - - - we are beginning to get into the area of industrial controllers. We analyze a sample stream through an automated process and as of now simply close / open an output relay. Most of these functions are already being performed by a stamp. However, some customers have asked about the possibility of a 4-20 analog output to proportionally control the output rather than just a digital on / off output relay. Was hoping that some stamp functionality exists to achieve this added feature…


What extra components would be needed? Would you happen to have a circuit diagram?? We would be looking to acquire a few of these soon to R&D them to see if they fit into out current platform.

Many thanks

Rich Geisler
R&D Engineer

Post Edited By Moderator (Ryan Clarke (Parallax)) : 6/29/2006 3:57:34 PM GMT

Comments

  • Tracy AllenTracy Allen Posts: 6,662
    edited 2006-06-29 18:13
    The Stamp can't be powered by the loop, because it draws more that 4 milliamps, but it can source the 4--20 ma. One way to do that, maybe the simplest, is with a PWM-to-current converter, which will have ~8 bit resolution. Is that good enough? The PWM-to_current converter is an op-amp circuit, controlled by PWM from a Stamp pin.

    Offhand, I don't know of a direct digital-to-current converter capable of 4-20 ma. However you do it, is going to require external electronics.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • stamptrolstamptrol Posts: 1,731
    edited 2006-06-29 18:53
    Rich,

    If you're trying to satisfy industrial clients, I'd suggest you use a commercial signal conditioner to generate the 4 to 20 mA side of the system. Automationdirect, for example, has several to choose from. Basically, you can set it up so the input side will be a voltage signal of say 0 to 4 volts and the output will be 4 to 20 mA.

    The voltage signal can be generated with the PWM command and a capacitor as shown in the Help file, or, if real precision is required, use the Stamp to drive an LTC1451 D/A chip and feed that voltage into the signal conditioner.

    Contact me by Private Message if you need more detail.

    Cheers
    Tom Sisk
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-06-29 18:55
    You might want to download and look at the manuals for the Industrial Control and Process Control courses. Process Control is newly released rewrite of Industrial Control, but here are links to both:

    Industrial Control:
    www.parallax.com/detail.asp?product_id=28156


    Process Control:
    www.parallax.com/detail.asp?product_id=28176
  • RichGRichG Posts: 2
    edited 2006-07-28 17:17
    stamptrol said...
    Rich,

    If you're trying to satisfy industrial clients, I'd suggest you use a commercial signal conditioner to generate the 4 to 20 mA side of the system. Automationdirect, for example, has several to choose from. Basically, you can set it up so the input side will be a voltage signal of say 0 to 4 volts and the output will be 4 to 20 mA.

    The voltage signal can be generated with the PWM command and a capacitor as shown in the Help file, or, if real precision is required, use the Stamp to drive an LTC1451 D/A chip and feed that voltage into the signal conditioner.

    Contact me by Private Message if you need more detail.

    Cheers
    Tom Sisk
    OK ...... So I've experimented with the PWM command and I'm able to manipulate the output voltage manually with what I hard code to the stamp.· So now I need to figure out how to pass the values into the stamp for the PWM command to ramp up or down the output voltage.

    Any thoughts???
    Many thanks.....!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-07-28 17:37
    RS-422 is the full duplex equivalent of RS-235 in twisted pair.

    If you don't have a lot of commitment to 4-20ma, I suspect you will find it freeing up the BasicStamp for other tasks besides communicaitions.

    It seems to me that PWM demands a lot of the BSs resources [noparse][[/noparse]clocks, interrupts, counters].

    Proportional control could still be involved.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • stamptrolstamptrol Posts: 1,731
    edited 2006-07-28 23:33
    RichG,

    Start with your existing system where the Stamp gets some information from your sample process and analysis. Right now you make a decision somehow to turn on the
    relay or turn off the relay. What you will do now is ramp up the 4 - 20 mA signal ( or ramp it down, as the case may be).

    Suppose the existing system tells the relay to close. What happens to tell the relay to open again? With the new system, one condition makes the PWM variable get bigger to give more output; the opposite condition makes the PWM variable give less output. You have control over the ramp up / ramp down because you decide how much to increment the PWM variable in each iteration.

    This type of system has a lot capability to make the response to the sample analysis very smooth and accurate, but will require a bit of work to decide on ramp ups, etc. Also involved is how the Stamp will know that the control action has been successful, or whether more output is required to control the system.

    Anyway, if you need specific help, let me know.

    Tom Sisk (stamptrol)
    www.siskconsult.com
Sign In or Register to comment.