Shop OBEX P1 Docs P2 Docs Learn Events
Digital to analog convertor question — Parallax Forums

Digital to analog convertor question

grasshoppergrasshopper Posts: 438
edited 2009-01-15 03:08 in General Discussion
I am using the Analog Devices AD5621 12 bit converter and I have a concern.

In my main code, running on a propeller, I can set the voltage and run the A/D as I intend. My issue is that it seems that after a given amount of time the voltage decays and I loose the value that I initially set. I combed over the data sheet and see no mention of this effect, then again I may be ignorant to the terminology as it fly's over my head. So I ask if this is normal? I solved this problem by simply looping the data out to the D/A from the propeller. Otherwise I wont sleep at night if this is not normal.


Please teach me the terminology or let me know if this is ok.

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-01-13 22:54
    grasshopper,

    Show us your schematic, could be a loading issue on the output pin.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • grasshoppergrasshopper Posts: 438
    edited 2009-01-13 23:15
    Ok here it is.

    X2-5 and X2-6 are connected to a small DC motor. Its rated at .15Watts, 11.5Ohms.

    VCC is 5volts.

    R23 is a 10K If I remember correctly (ill know for sure when I get home tonight)

    The transistor is a FZT857 with I think a HFE of 200

    Basically I am trying to control the small motor and the A/D looses its value at low RPMs.
    822 x 558 - 20K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-01-13 23:20
    grasshopper,

    You've probably entered one of the power-down modes, wherein the output buffer is disconnected from the pin. Check to make sure that PD0 and PD1 are both low when programming an output and that you're not sending extraneous data after you've done so. Also, since the device has a power-on reset, which sets the output to 0V, make sure you have sufficient bypassing on Vdd. Otherwise, a noise glitch could cause a reset.

    -Phil
  • grasshoppergrasshopper Posts: 438
    edited 2009-01-13 23:30
    Phil Pilgrim (PhiPi) said...
    grasshopper,

    Also, since the device has a power-on reset, which sets the output to 0V, make sure you have sufficient bypassing on Vdd. Otherwise, a noise glitch could cause a reset.

    -Phil

    This might be the cause, for some reason did not place a capacitor on the IC. All the others have them in place. I will check it on the o-scope and see if this is the cause.

    Otherwise the A/D should hold its value, right? No matter the time?

    Thanks for the quick responses fellas its apreacated.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-01-13 23:37
    grasshopper said...
    Otherwise the A/D should hold its value, right? No matter the time?
    It's buffered, so it shouldn't droop, except for the causes listed above. BTW, where (physically) are your motor ground and Vss joined?

    -Phil
  • grasshoppergrasshopper Posts: 438
    edited 2009-01-13 23:44
    Not sure how to explain it. My whole circuit board is grounded [noparse][[/noparse]basically a power plane] other than all the digital buss's and positive rails. The motor comes in via a 5 amp connector. The whole circuit board is about 4"square.

    Oh also I am using a switching power supply 15V / 6Amps. looks like what most laptops come with.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-01-14 00:36
    What I'm getting at is this: even with a groundplane, the emitter of your drive transistor should be located right next to where the power supply common comes in — not on the other side of the board, for example.

    -Phil
  • LeonLeon Posts: 7,620
    edited 2009-01-14 00:49
    Motors can cause all sorts of problems with transients. I always use TVSs.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-01-14 01:17
    You state that V_CC = 5V and that you are using a 15V_6A supply.
    "I am using a switching power supply 15V / 6Amps"
    The schematic shows the motor runs off V_CC.
    What's the 15V supply for?

    [noparse][[/noparse]I do have one more question.]
  • grasshoppergrasshopper Posts: 438
    edited 2009-01-14 02:18
    PJ Allen,
    The 15Volt supply runs and array of other devices. I employee 4 voltage regulators.

    Phil Pilgrim,
    Thanks for the clarification. The emitter is located as close to the power supply common as I could put it. I am about 80% sure that your previous assumption is correct. This device can switch 4-5 amps in a mila-secound, so I was stupid for not putting a bypass cap on the D/A IC.

    Thanks for the input fellas, most importantly I am sure that the D/A is faulting due to my circuit. I tested the motor and it only faults when the high currect stuff is switching on and off. A cap will help.

    Leon
    What is a TVs?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-01-14 03:03
    OK, I then defer my other question pending update (unless someone else beats me to it in the meantime.)
  • grasshoppergrasshopper Posts: 438
    edited 2009-01-14 03:26
    PJ Allen said...
    OK, I then defer my other question pending update (unless someone else beats me to it in the meantime.)

    Please ask away I am trying to learn here. I am the senior designer at my company and fresh out of school it sucks! No one around for advice.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-01-14 15:41
    Your circuit (clip1.jpg), a DAC's output supplying base bias for a common_emitter with the motor in the collector.·
    I'm not trying to be a wise-guy, but are you trying to run the motor like it's a speaker coil?
    Or do you mean to effect a varying voltage supplied to the motor, which would be emitter_follower (common_collector)?
  • grasshoppergrasshopper Posts: 438
    edited 2009-01-14 16:25
    No not trying to run the motor like its a speaker. I am controling the motor using the D/A and it works fine so far. Its the D/A that I have a problem with. The decaying of the voltage out. Thanks all for the help.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-01-14 17:18
    grasshopper,

    Let's back up a minute... your motor is rated at .15Watts, 11.5Ohms?

    I = V / R

    If your powering the motor from a 5V supply (4.4V with the C-E diode drop across the transistor)

    I = 4.4 V / 11.5 Ohms
    I = 383mA

    The specs say, that the Turn On voltage for the FZT857 is 1.12V and that the saturation voltage for the FZT857 is 1.25V ... this creates a very narrow window of operation from your DAC.

    Also, the minimum Hfe for 383mA and 5V is going to be about 100 so you need at least a 38.3mA 3.83mA base drive. According to the AD5621, the output short circuit current is only rated at 20mA.

    My conclusion is, that:
    1) you are probably running the FZT857 in it's linear region
    2) The output drive of the AD5621 is not adequate for the FZT857 in combination with your load.

    Both 1 and 2 can create excess heat that can cause a voltage drift, which may explain the decay that you are observing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 1/14/2009 6:20:01 PM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-01-14 18:08
    PJ -- "...are you trying to run the motor like it's a speaker coil?"

    G -- "No not trying to run the motor like its (sic)·a speaker."

    B -- "...you are probably running the FZT857 in it's (sic)·linear region."


    383mA / 100 = 3.83mA [noparse][[/noparse]not 38.3]




  • grasshoppergrasshopper Posts: 438
    edited 2009-01-14 19:23
    Yea fellas I want to run the motor in the linear region. I want to be able to run say at 0Rpms - 3000Rpms. I see no problem with this. Please feel me in if you think I have created some type of error. I assure you that there is no heat on the transistor, It is a SOT223 package with a temp sensor right next to it. It never goes above room temperature.

    Post Edited (grasshopper) : 1/14/2009 7:31:31 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-01-14 19:33
    Good Grief!... thanks PJ

    grasshopper,

    Lower your 10K value·for R23 to something like 220 Ohms·to 330 Ohms·... as it is 10K is not enough drive current. (500uA max with your 10K)










    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 1/14/2009 7:39:33 PM GMT
  • grasshoppergrasshopper Posts: 438
    edited 2009-01-14 19:39
    Beau Schwabe (Parallax) said...
    Good Grief!... thanks PJ

    grasshopper,

    Lower your 10K value for R23 to something like 220 Ohms to 330 Ohms ... as it is 10K is not enough drive current. (500uA max with your 10K)


    Sorry in my first post I mentioned a 10K its actually a 1K. I think the motor circuit is ok and I am very greatful for all the advice. I think that the reseting comes from not having a capacitor on the D/A. Like I mentioned before I am switching 6Amps from +/- to -/+ and this it causing the D/A to reset at various time.

    Again Thanks fellas.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-01-14 19:55
    Grasshopper,

    I would not choose to control a motor in the way you have.
    If you want to prove it out further, though, then·substitute a variable lab supply for·the DAC_out and·see how that happens.
    ·
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-01-14 22:09
    grasshopper,

    What you've done will probably work — sort of — once you get the reset thing solved. But I'm in agreement that it's not the best approach. The 1.2V offset can be overcome with programming, and is not a big deal, IMO. But you're relying on a fixed, constant transistor current gain to relate DAC output to motor current. One of the first things I learned about transistor circuit design is not to make my designs dependent on a certain transistor gain, because this can vary quite a lot from device to device and with temperature. You were given some good ideas in this thread, which I would advise you to revisit.

    -Phil
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-01-14 23:23
    "... some good ideas in this thread,..."?

    Here are a couple of my own ideas we can float down the silicon slough, too.

    [noparse][[/noparse]Did you try that external lab supply idea?]

    sr_dsgnr.jpg
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-01-15 01:07
    PJ Allen said...
    "... some good ideas in this thread,..."?
    I'm not sure what you're questioning there. That entire thread dealt with ways to drive a motor with a voltage or filtered PWM input, so is quite relevant to the question at hand. (In fact, I'm surprised grasshopper didn't just add to that thread, since it seems to be a continuation of the same project.) In any event, I think that V->I control is better than V->V control for motors, since it provides more start-up torque and helps to limit stall current. This suggests a common emitter driver (with feedback), rather than an emitter follower.

    -Phil
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-01-15 02:58
    Naturally, I·was "questioning"·grasshopper's·reticence in·seizing those very pearls of wisdom and my surprise same, Phil.· Inasmuch, I figured I'd cast in my lot, too.

    I will add that I rigged-up my offerings before posting them, with my own odd-ball motor here,·and stand by them.

    I·acknowledge that I'm not with the approach of controlling a motor by adjusting·the current flow through it, whether·that's by use of·a burdening resistor or potentiometer·or even a transistor.·

    I'd be PWM'ing the thing, of course, but the member here is on a path.

    Have a good evening and a wonderful Thursday.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-01-15 03:08
    Thanks, PJ. That clears things up. I guess we can agree to disagree on the V-drive vs. I-drive question. smile.gif

    -Phil
Sign In or Register to comment.