Shop OBEX P1 Docs P2 Docs Learn Events
D/A 0-10V CTRL for BSII — Parallax Forums

D/A 0-10V CTRL for BSII

John ROOSEJohn ROOSE Posts: 3
edited 2004-09-16 16:34 in BASIC Stamp
Hello,

I'm looking for some help (schematic and code) about de way to control a 0-10V frequency motor drive.

If you have some experience in generating 0-10V signals from a BSII, I'm very interested.

If possible without the use of a symetrical power supply.

Thanks in advance !

JR

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-16 05:06
    You could use PWM to charge an RC circuit that is amplied by an opamp to provide the correct voltage output. Download the StampWorks book from our web site for an example that will get you started.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • John ROOSEJohn ROOSE Posts: 3
    edited 2004-09-16 06:43
    Thank you for your quick answer !

    As the power supply of the BSII is about 5V, we can generate analog signals from 0 to 5V with PWM.

    I made some tests with succes. But ...

    How can we get a drive to generate 0 to 10V ?

    I need a amplifier with a gain of 2 (if possible without symetric power supply for the amplifier).

    Can you help me with a schematic ?
  • AlWilliamsAWCAlWilliamsAWC Posts: 135
    edited 2004-09-16 13:09
    What you want is a non-inverting op amp (use google). However, there are a few practical things you should know.

    1) You will need a supply greater than 10V. The more power you try to draw from an opamp the less the maximum voltage will be.

    2) They do make rail to rail op amps that don't suffer from this problem. Many can go all the way to the ground rail at least. If this is not true, you'll need a negative supply to get to ground.

    3) If you need any current at all, I'd suggest putting a transistor on the output and keeping it in the feedback loop. However, this will give you a .7V offset.

    If you look up the LM324 on National's site you can download a data sheet. They have a schematic marked "Power Amplifier" that is what you want except the gain is X10 instead of X2.

    The voltage on the - terminal will be Vout*100/(910+100) =Vout*100/1010. However, we know the op amp will try to set the - terminal so that it is the same as the + terminal. We can assume the + terminal draws no current, so the voltage at the + terminal is the same as on the other side of the 91k resistor. So:

    V+=Vout*100/1010
    or
    V+ * 1010/100 = Vout

    or
    V+ * 10.1 = Vout


    If you make the two resistors in the - loop the same (say, 250k), then you get:

    V+ * 500/250 = Vout

    Or 2*V+ = Vout

    You'll have to pick a suitable transistor based on your current requirements and compute the head room you need on the power supply. Remember that the transistor cuts 0.6 to 0.7V from the output, so the op amp has to supply 10.7V to get to 10V.

    Regards,

    Al Williams
    AWC
    Kits
    http://www.awce.com/kits.htm




    ·
  • ecourtecourt Posts: 13
    edited 2004-09-16 13:19
    Al,

    I am not absolutely sure but if the transistor is included in the feedback loop,

    the 0.7V EB offset should be supressed. OK?

    Regards
  • AlWilliamsAWCAlWilliamsAWC Posts: 135
    edited 2004-09-16 13:27
    Yes, from the load's point of view, but the op amp still has to overcome it inside the loop. So for 5V to appear on the emitter, the output of the opamp must reach 5.7V. The input, however would be 2.5V (no offset there). My point was, you can't produce 10V output even with a rail to rail op amp running at 10V since the real peak output is 10.7V so your power supply needs a little "head room".

    Al Williams
    AWC
  • ecourtecourt Posts: 13
    edited 2004-09-16 13:33
    OK for the "head room". 12V should be better to allow for a little EC voltage at 10V output.
  • AlWilliamsAWCAlWilliamsAWC Posts: 135
    edited 2004-09-16 13:33
    OK I've been wanting to try posting a picture to the forum so here you go (in Switcher CAD/Spice) (well it is attached but I can't figure out how to put an attached picture in the message; maybe it shows up at the end).

    For those of you who like Spice, try:

    * D:\SwCADIII\Draft4.asc
    R1 N006 N001 91k
    R2 N002 0 250k
    R3 N004 N002 250K
    Rload 0 N004 100k
    Q1 N003 N005 N004 0 2N2222
    V1 N003 0 12V
    V2 N001 0 5V
    X§U1 N002 N006 N005 opamp Aol=100K GBW=10Meg
    .model NPN NPN
    .model PNP PNP
    .lib D:\SwCADIII\lib\cmp\standard.bjt
    .tran .005
    .lib opamp.sub
    .backanno
    .end

    834 x 577 - 63K
  • John ROOSEJohn ROOSE Posts: 3
    edited 2004-09-16 16:34
    Hello AL,

    Thank you for your expertise !

    I wil try this this week-end and hoppely I can give you goed results !

    CU

    JR
Sign In or Register to comment.