Shop OBEX P1 Docs P2 Docs Learn Events
Timing Shiftout on BS2PX for D/A via TLV5618A - Page 2 — Parallax Forums

Timing Shiftout on BS2PX for D/A via TLV5618A

2»

Comments

  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-10-29 02:09
    Tracy,

    I already have a package of IRL520 and IRL530's which would be nice to use if possible but I believe it's important to go for lowest price. I am curious about how much more circuit parts are needed to make it "practical."

    Since your post arrived after I left, I bought the Op Amps carried at Radio Shack, which aren't exactly what you suggested -- a 741 and LM324. I know they carry 1N4001 diodes.

    Kirk
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-10-30 00:38
    Kirk, the LM324 will be fine for the op-amp, as it is a quad pack and the LM358 is a dual, but they are quite similar in performance. Eiither the IRL520 or the IRL530 will be fine for the transistor, I think. You should plan to mount the transistor on a heat sink. If you use the attached circuit, you wil also need a 0.5 ohm sense resistor, also a voltage divider 10.5kohm to 1.5kohm at the input of the op amp to reduce the voltage from the DAC down from 4 volts fs to 0.5 volts fs. (You can subtitute other resistors and a potentiometer for the 10.5k and 1.5k resistors if you don't have those values on hand.) The 0.5 volts at the input of the op-amp is mirrored on the 0.5 ohm sense resistor to create a current sink of 1 amp full scale. Note that that the sense resistor needs to dissipate 0.5 watt when the current is one amp, so I specified a 2 watt rating.

    attachment.php?attachmentid=39266

    Do you have a data sheet or URL for the proportional valve you have for this project? You mentioned in another thread that you will need to add some dither onto the drive current. You could do that either through the digital control, or by applying dither to the reference input. I'd like to see the data sheet.

    There are surely other people here who have more experience than I do with proportional valves. There may be some tricks of the trade or gotchas that I am not aware of.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
    318 x 226 - 8K
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-10-30 02:01
    Tracy,

    Thank you very much for the DAC circuit.· I'll give it a try after the stores open Monday.·

    The spec sheet on the valve I'm using·can't be addressed·by URL alone.·
    First go to http://www.sterling-hydraulics.co.uk/
    Second search for GP0251L and click on the PDF icon.

    The valve cartridge may vary but the coils are pretty standard within Sterling 24v 1A.
    There is an American manufacturer which makes a compatible valve·but in pneumatic testing I like·Sterling as it had a smaller dead zone.· The dead zone seems to disappear with hydraulic fluid power but it sometimes sticks on start-up which is why the 100Hz dither may·be useful to·shake up the particles·preventing deposits·in theory.· I haven't had a dither to test yet.

    Kirk
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-02 05:00
    Tracy,

    I have a problem with the LM324 op-amp. After going through your resistors the op-amp receives 0.0v->0.5v on channel 2+ and 0.5v->0.0v on channel 3+ which I assume is intended. The outputs of each channel are stable at 22.83v as wired in or about 22.86v without the connection to the next resistor.

    The specs on the package aren't clear to me but it looks like it wants 32v or an input range of 0.3-32v. So how would you suggest I find an op-amp that would better respond to your voltage input range? Or would it work better without cutting the DAC output down to tenths of a volt?

    Fortunately I was able to locate a Radio Shack with a 0.47 Ohm 5 watt wirewound resistor which I substituted for the 0.5 ohm 2 watt.

    One point on the IRL520, I was told in an earlier thread I need a resistor between the D and S. In an unrelated but successful circuit I used 100K.

    Kirk
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-02 19:10
    Readers,

    It seems to be experiement time. I have a couple other op-amp circuits -- a very interesting animation is at http://www.williamson-labs.com/images/non-inv.gif which emphasizes feedback. I can't tell if feedback is present or not on my proto-board. But I know the DAC works now and the IRL520 works to drive my valve coils in full-on-off states so there ought to be some way to connect them in a way that will provide proportional control. I can try removing the op-amp completely, trying to match the IRL520's specs, trying to add obvious feedback to the op-amp, and even adding another op-amp in a more convoluted circuit. I just hope I can get away with a Stamp and a small number of extra parts instead of the dozens of SMD's used in off-shelf valve controllers. Or it may be the circuit needs to actually have the load connected to get enough feedback. It looks like lots of things are available to try. Although, some reductions in the list would be appreciated.

    Kirk
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-02 19:28
    Quick question: is the IRL520 able to function as an amplifier or is it only a switch?? The data sheet http://www.fairchildsemi.com/ds/IR/IRL520A.pdf isn't clear.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-11-02 20:22
    Hi Kirk,

    The IRL520 is a transistor and it can act as either in linear mode as an amplifier or in on-off mode as a switch. In this circuit it is acting in linear mode, inside the feedback loop. It is acting as an amplifer in a common source configuration that has a voltage gain of slightly less than one to the hot side of the 0.47 ohm resistor. The specs of the transistor hardly enter into the equations, because the feedback around the op amp dominates.

    The LM358 and the LM324 are very similar op amps and either should work in this circuit. The 32 volt figure you saw in the data sheet for either one is the _maximum_ power supply voltage. It does not require that much, and in fact those op amps can operate on a 5 volt power supply. In the circuit I suggested, it is powered from the 24 volt supply. Any supply voltage from 9 to 30 volts would be fine for this circuit, but it could _not_ work on a 5 volt power supply. The power supply does not enter into the equations for the feedback loop, so long as it is greater than 9 volts.

    You are confused it seems about whether or not this circuit has feedback. Yes, it does. However, you _DO_ have to have a load connected. The load can be:
    The proportional valve coil.
    An ammeter capable of meauring up to 1 or 2 amps.
    An 24 v incandescent light bulb
    A 50 ohm, 15 watt resistor.
    A piece of wire (a short circuit load--all the power will be dissipated in the IRL520, so it will get HOT)

    Oh, in case you're wondering, the "load" goes between the 24 volt power supply and the drain lead on the power mosfet. I emphasize again that the circuit I posted does have feedback, but the feedback can only operate if there is a load attached that passes the current.

    The data sheet for your valves says that they will consume 14 or 19 watts at full throttle, depending on whether it has the "P" or the "S" coil. Don't try to drive both coils at once! I presume you want two channels because you need to drive both coils in the valve. One coil moves the plunger to and the other coil moves it fro. The demo program I used and posted to test the DAC excersizes both channels at once. Don't use that program when both valve coils are connected! First do one and then the other!

    There may be several reasons that professional valve controllers you see have additional components. There may be various failsafe circuits, as well as more elaborate feedback schemes. The valve is an electomechanical device and it presents a load of complex impedance to the circuit, and the impedance may change with pressure. Current in the coils is counterbalanced primarily by a spring. Forget that for a moment though.

    Start KISS. I would use an ammeter for a load to start with to be sure that the circuit feedback can control the current. Then with the valve in the circuit, I'd see if it can hold the plunger steady. It would be bad if the feedback is unstable and the position of the plunger oscillates willdly. If so, then it will be time to dig deeper into the feedback conditions. Try it and see and learn.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-02 23:04
    Tracy,

    Thanks very much!· That's all I was missing was the load.· It works very normally now.· There is a·minor point -- it seems to spend·more time at 0.5v than any other value, which I can program away I think because with proportional coils,·0.5v on both should equal zero.· Another small fix·was it topped·the cycle at 20V so I·turned·up the supply·to 25.5V and it·tops correctly.· I'm a little concerned the linear digital output becomes a little non-linear in analog but that is ok since I can control it by software.

    You are correct, this circuit puts a lot of heat on the IRL520's so I'll make or buy a heat sink.· (I wasn't worried about conflicting magnetic signals·in this valve with no fluid.)· I'll try the whole setup with hydraulic power once I figure out a good program for it·then transfer it off my prototype board and I'll let you know how it works in real life.

    Do let me know if there's anything I can help you with.· I know I can't help with electronics but I do have some Ph.D. level ideas on the Bible, some at my website http://prayer_child.tripod.com/·and of course you have my email.

    Sincerely,

    Kirk
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-11-03 18:08
    Great! Persistence (or was it prayer?) paid of!

    The valve data sheet seems to state that the current at 24 volts will be around 0.6 amps maximum, not 1 amp. That might explain why the output hangs for a longer time at 0.5 volt. It is saturated. You can correct that in hardware either by limiting the voltage to the (+) iinput of the op amp to a maximum of 0.282 volts (instead of 0.5 volts). That could happen in your Stamp program by the values you send out, or, you could change the voltage divider at the input of the op amp from 8:1 to 14 to maintain the full dynamic range: Or, you could keep the input divider at 8:1 and use a 0.82 ohm sense resistor instead of the 0.47 ohm. That would limit the full scale current (at 4 volts out from the DAC) to 0.6 amp. The flow rate is not exactly a linear function of current.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-09 01:18
    Hi Tracy,

    It appears that a combination of prayer and persistance pays off!

    The reason for specifying 1A is my first valve·was a·larger NACHI valve which has·1A as top of range.· I was hoping that having a·little too much current available would be ok and not be drawn in by the smaller 0.6A coils, thus insure against circuit burnout plus provide flexability in case a larger valve is needed.· If I'm wrong then a 1A current would really jamb the valve open and may reduce life on the coils.· Hmm, I also remember 1A was·associated with·a higher voltage.

    The 0.5v low end isn't equal to zero -- further thought on the magnetic effects of two coils equally energized is the shuttle could tend to move its induced center (not necessarily the mechanical center) to the coil the center is closest to.· Dither values would tend to shake that and generally average it toward zero.··This can be done in software, but it would be cleaner to approach zero electronically.

    Your other choices need experimenting with except changing the "sense" resisitor·I hope will be a last resort since availability is much better with the current value.· So first I'll try the voltage divider change and hope that smooths out the response curve which as stated bunches up at .5v but also thins out at 24v, making software selection less precise at the top where·more precision might be needed.

    I'll also experiment with some other tweaks like using a cheaper pot or a fixed resistor on the DAC's 2.0 v reference.· Right now my goal is to make a test circuit that can run by itself for 1000 hours during which I can make other experiments and adjust the final circuit.·

    Kirk
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-09 08:46
    Hi Tracy,

    Ok, I've done several hours of experiments and have not improved significantly on your original circuit. I was able to substitute a $1.25 pot for the $10 pot I first used to get the DAC 2.0V reference. The best I was able to get by tweaking the voltage divider between the DAC and OpAmp was 0.4V. Tweaking the "sense resistor" did significantly alter the response curve -- I was able to even reverse it so it stayed longer at the high end instead of the low end. But the wire-wound character of the resistor causes me concern because my robot prototypes will take over 200 and I am hoping to find a way around hand winding that many. I'll try software control and look around for a wire-wound resistor vendor.

    Kirk
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-11-09 18:08
    All the vendors like Digikey and Mouser have low value resistors available for exactly this purpose. You won't have to wind that many yourself!

    The equation for the programmed current output, Iout, is very simple, given the voltage, Vdac, from the DAC.

    Iout = Vdac * (R2 / (R1 + R2)) / R3

    R1 is the resistor connected to the DAC output, and R2 is the resistor between the op amp + input and common, and R3 is the sense resistor. So any of the resistors can be used to twiddle with the range. The voltage Vdac is controlled by the Stamp, and also by the reference voltage you applied to the DAC reference input, so those also enter the equation, as you observed.

    The current range can be limited by the resistance of the proportional valve as load. For example, if the valve specs say it draws 0.6 amp at 24 volts, that implies that the valve has an internal resistance of 40 ohms. On a 24 volt power supply, there will be no way for the circuit to deliver 1 amp, because it saturates at 23.5 volts across the valve, and 0.6 amp through it, and stays there even though you increase the Vdac. There is no worry about driving more than the rated current through the valve. But it is nice to have the circuit better adapted to the valve to get the best dynamic range. On the other end, my understanding is that there is no flow at all until the current reaches a threshold of ~100 milliamps.

    When you tell me that the voltage is stuck at 0.5 volt, where are you measuring that? Across the load or across the mosfet drain to source? The voltage across the mosfet drain to source wil never drop below 0.5 volt, because that is the full scale voltage across the sense resistor by design.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-09 18:44
    Hi Tracy,

    Thank you. The load voltage "stickiness" at one end or the other varies with the sense resistor value. I don't yet have a low value wirewound pot to better test it with. There appears to be a perfect value between .47 and .94 ohms which may be exactly the value you specified .82 ohm but I haven't been equipped to test that value yet. I've been working on software adding in your A/D demo to make a proportional controller for my burn-in test. I'll try winding my own sense resistor to see what happens quicker than ordering one.

    In twiddling the other resistors, I found only a small change before the range became greatly reduced. As I like the full range, I'm keeping your original values and plan to twiddle the software to improve performance after winding the better sense resistor.

    Kirk
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-10 22:11
    Hi Tracy,

    Making a wire-wound resistor myself can be considered a failure. I will try to order the value you specified as a near value obtained by connecting both 0.47 ohm resistors in series works better than a single unit and tweaks to a comfortable looking range with adjustments to the 24V supply voltage.

    There are several reasons for failure -- I bought a new auto-ranging Radio Shack VOM because it supplied one more digit showing 0.4 or 0.5 ohm instead of the 0.001 Kohm on my old meter. The new meter showed variance between .9 and .7 in my wire apparently just because of my handling of the coil. I didn't find a position stable for .8 but I plugged it in and it worked about the same as a single off-shelf 0.47 unit, not better. So I'm ordering a few different under 1 ohm resistors to try as I move the proto circuit into a box and work on the program.

    One thing I learned recently is it doesn't matter what pot you have on hand if the purpose is dividing an existing voltage. Just put one end to ground, the other to hot, and the wiper gives whatever you choose. Pretty neat!

    In programming the Stamp, I learned the DAC statements must be seperated by changing the status of chip select or it won't work. I also had to correct an error I introduced in your ADC software and a protection resistor substitution I made -- I had lots of 390 ohm resistors on hand but they didn't work as well to zero transients as the 330 ohms you specified.

    Kirk
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-12 06:23
    Hi Tracy,

    I tested a selection of wire-wound resistors from 0.47 to 1.00 ohms and find the higher values work better when the circuit is cold but after it heats up it's hard to tell if 0.82 or 0.75 ohms is best. Since the vendor distributing NTE products sent two of each, I'm going with your recommendation of 0.82 ohms for the prototype 1000 hr. test unit. Interestingly God supplied the unexpected help of a strong young man today so my hydraulics is now ready to go for an initial test and we found a bug needing repair before the big test. The main pieces to go are putting the circuit onto a board and getting software to take pot data and convert it to position, swing, and speed commands.

    Kirk
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-11-12 16:37
    Fine gage magnet wire is characterized by resistance per foot. So you could calculate the length needed for the resistance you need and cut that length and wind it. For example, 30 gage magnet wire is 103.7 ohms (+/-5%) per 1000 feet, so it takes 7 feet, 10.9 inches to make 0.82 ohms. (0.82/103.7 * 1000)
    Here is a wire gage resistance table:
    www.mwswire.com/barecu6.htm
    Here is a page with lots of interesting wire FAQs
    www.radiolocman.com/electrical-engineering/circuit-cache.html?di=18899

    For the final calibration, put the VOM set on amps in series with the load, and compare the output current with the digital code the Stamp sends to the DAC. Adjust one of your potentiometers to trim it to the value you want. If you do that final calibration, the exact values of any of the resistors in the circuit will be trimmed out.

    What do you mean by "works better when the circuit is cold"? The sense resistor could get warm, but not hot.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-13 04:27
    Hi Tracy,

    > The sense resistor could get warm, but not hot.

    Yes. When it's cold the circuit acts slightly differently than when the resistor is warm.

    That is something my new VOM is good at, tracking AMPS while the old one tracks Volts. I was shocked to learn they move inversely in this circuit. The coil draws more amps at low voltage, but less than 0.6A, it peaks just under 0.5A. The DAC starts responding at 3300 more than at higher numbers upto 4096.

    The only pot I have installed is the one producing 2.0v for the DAC. Your resistor recommendations appear to work better than any pot I've put in between the DAC and OpAmp.

    The real proof of the pudding will be hooking it up to an oil circuit. I have one outdoors in case of oil spill which I intend to try tomorrow. I'll find my oil flow and pressure guages so I can see what's happening.

    Kirk
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-17 00:25
    Hi Tracy,

    I accomplished the preliminary hydraulic test from the proto-board.· I hooked up two pots to provide speed and direction input via your TLC2546 ADC circuit and software to the Stamp BS2px and from there to your TLV5618 DAC software and circuit to control a valve connected between a small hydraulic power supply and a hydraulic motor.· The effective values started at about 1500 for slow speed and ended at·about 4000 for high speed in both directions.· I observed that turning·a pot on·while the other·is active had no effect, which derives from the mechanical nature of the valve - so·one coil·must stop, allowing the spring to recenter the valve before the other direction can be active.

    From here I believe I can·work my way to success.· The software can be·written to do most anything·and if necessary I can replace most of the parts to use a·better valve, DAC, or OpAmp.· Thank you very much again for your help -- I couldn't have done it without you.

    Kirk Fraser
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-21 21:16
    Hi,

    Is there any software around to do S-Curve Acceleration or Smooth Acceleration? I need to develop points to convert with this new DAC that will result in a proportional back and forth swing test where the travel speed slows down at both ends. Then I can run it with real hydraulic hardware and see if it's reliable.

    Thanks,
    Kirk
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-11-22 21:14
    Hi again Kirk,

    There iis probably not such software "around", if I understand what you mean. The Stamp and DAC and circuit provide a linear output of current to the coil of your valve. But the response of the valve itself, as you know, is quite non-linear. For a given pressure, there is a threshold of current for any flow to occur at all, and above that the relation of flow to current is parabolic downward (or some such relation). I presume that there is a fixed relation between flow rate and position, velocity and accelleration in your system. Is that right? But isn't the flow rate dependent on the pressure differential across the valve? Do you have independent means to measure position, velocity or acceleration of the load, so that you can feed that bottom line measurement back to the Stamp to control the current? That would be some kind of PID algorithm, which you can study in the Stamps in Class Industrial Control text.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-11-22 21:47
    Hi Tracy,

    Yes, the hydraulic system can have a potentimeter applied at an axis to provide position data. Thanks for the tip on the Stamps In Class Industrial Control text. I've heard of "S-cuve acceleration" but only found one website with the actual math and it's not 100% clear. But it is coming along.

    Thank you,
    Kirk
Sign In or Register to comment.