Shop OBEX P1 Docs P2 Docs Learn Events
4-20 ma or 01-10 VDC — Parallax Forums

4-20 ma or 01-10 VDC

gcarlsongcarlson Posts: 8
edited 2006-04-30 06:36 in BASIC Stamp
Hi - I need a 4-20 ma or 0-10 VDC output from a PC
to an external device. I'm wondering if a a BS1USB
with some additional circuitry (?) might suffice? Any
ideas on how to generate this output will be welcome.

BTW, I *might* also have a modbus option, but that's
last choice.

Thanks, Gregg

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-04-28 15:52
    Well, if you need an RS-232 to 4-20mA converter, a STAMP has no real way of doing that.· 4-20mA converters of many stripes can be found at www.bb-elec.com, not to say that one couldn't make his own.

    As for the 0-10V -- continuously variable, or switching 0 & +10V?· Don't know what you have in mind.· Again, the STAMP's not the thing, exactly.

    Just don't have a clear idea what it is you're driving at.

    More (specific) info, please.
  • gcarlsongcarlson Posts: 8
    edited 2006-04-29 04:23
    Thanks!

    I'm trying to control the speed of an AC motor with a VFD (var-freq drive) that
    has both 4-20 ma and 0-10 VDC input options from a PC program. I'm surprised
    that USB D to A converters (or 4-20> converters aren't more common for controlling
    industrial devices (maybe I haven't looked hard enough.) Either output has to be variable.

    Gregg
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-04-29 08:59
    Hi Gregg -

    Let's break this apart a bit, from a systems point of view, just so you can see your options here. You correctly note:

    "I'm surprised that USB D to A converters (or 4-20> converters aren't more common for controlling industrial devices ..."

    The rationale for this is really pretty simple and two-fold. Here is what you really have, once you analyze it.

    First, more often than not, the industrial devices (variable speed AC drives, and similar devices) are being controlled by a programmable logic controller (PLC) and the standard outputs from such controllers are often 4-20 mA or 0-5/0-10 VDC. This is a restriction·which is put in place by the·AC drive manufacturers (and other manufacturers as well), and nothing else. If you think about it, many if not most, of the companies offering varable speed AC drives and similar equipment, also sell PLC's! Where's the surprise now? :-)

    Second, I suspect the USB restriction is being placed on this artifically, possibly by your observation that many computers today (especially laptops) are coming through without the former DB-9 serial ports. This too is purely an artifical constraint, as many USB ==> RS-232 adapters are readily available, including right on the Parallax web site(1). By using such a companion, "dongle"·or adapter device on your proposed project, you remove the USB restriction and permit·either USB or RS-232 asynchronous serial input. Thus,·any PC can then be used to control this AC drive controller.· Much better overall design, at a reasonable cost increment, if you ask me.

    (1) The USB ==> Serial adapters that Parallax sells come highly recommended for reasons discussed elsewhere.

    All that said, you seem to have chosen the Stamp BS-1 to investigate, for this project. If I were being asked to recommend a particular PBASIC Stamp for this·project, it would be a BS-2, not a BS-1. The BS-1 is very capable, but since it is the low-end member of the PBASIC family, it also has the most limited instruction set, and is the slowest. You will see why this is important in a moment.

    Can·the PBASIC Stamp BS-1·be used for a project like this? - YES.

    Is it the easiest Stamp to use in this application for a newcomer? - NO.

    With that in mind, I'll let you make up your own mind and not try to do a "sales job" on you ;-)
    BTW - I am not a Parallax employee.

    We'll skip the PBASIC Stamp input requirements, as all you are going to do is transmit some numerical value from the PC to the PBASIC Stamp using an asynchronous serial transmission protocol (RS-232 like), via the SERIN command. This is really quite trivial.

    All you will then need to produce the output you're looking for is an outboard digital to analog (DAC) IC. The Stamp will fetch the numerical data from the PC and then pass it along to the DAC. This would ordinarily produce a 0-5 VDC variable analog output from a 0-255 (or greater resolution) digital input. The PBASIC Stamp would be providing·a digital output (input to the DAC) by use of a standard synchronous serial protocol, via the SHIFTOUT instruction. Here's the small rub I mentioned·above, inre the PBASIC Stamp BS-1.

    This particular·instruction (SHIFTOUT) does not exist in the BS-1 instruction set, although it can be simulated, thus the BS-2 becomes a friendlier platform for this project. The choice of Stamp platforms still remains yours.

    We're almost there, but our voltage is now 1/2 of what's specified. I stand to be corrected by the hardware guys, but I see no reason why the 0-5 VDC variable signal can't be input to a simple op-amp to provide a 2X signal of 0-10 VDC, but I'll leave those details to those better qualified than myself.

    That's pretty much it, unless there is something I've overlooked. Oh yeah, good luck with it, no matter which direction you plan to take. BTW - You might enjoy reading this particular section of the FREE Parallax Educational Series "Stamps in Class"·texts entitled "Industrial Control·":
    http://www.parallax.com/html_pages/downloads/siccurriculum/documentation_sic_curriculum.asp

    Regards,

    Bruce Bates


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2006-04-30 01:16
    Hi · Bruce Bates

    I could not have said this any better·than that·


    First, more often than not, the industrial devices (variable speed AC drives, and similar devices) are being controlled by a programmable logic controller (PLC) and the standard outputs from such controllers are often 4-20 mA or 0-5/0-10 VDC.

    This is a restriction·which is put in place by the·AC drive manufacturers (and other manufacturers as well), and nothing else. If you think about it, many if not most, of the companies offering varable speed AC drives and similar equipment, also sell PLC's! Where's the surprise now? :-)

    Second, I suspect the USB restriction is being placed on this artifically, possibly by your observation that many computers today (especially laptops) are coming through without the former DB-9 serial ports. This too is purely an artifical constraint, as many USB ==> RS-232 adapters are readily available, including right on the Parallax web site(1).

    That's pretty much it, unless there is something I've overlooked.

    No i do not think that you over looked·any thing that says it all in nut shell (NO PUN Intended)

    Thank for your reply

    Sam



    Post Edited (sam_sam_sam) : 4/30/2006 1:21:11 AM GMT
Sign In or Register to comment.