Help - Electromagnetic Regulator

Discussion in 'The Projects Forum' started by mawright89, Jun 18, 2012.

  1. mawright89

    Thread Starter New Member

    Jun 18, 2012
    19
    0
    Hi Guys,

    Quick question for a test rig Im putting together.

    I need to vary the magnetic force of an electromagnet (3 actually) based on the analogue output of a labjack u3. The magnets are rated 12v and pull approx 0.8A at that voltage. The labjack has a 0-5v analogue output based on the USB input for the device, however im unsure of the current rating of a USB source.

    I will have to callibrate the device and based on an output from the labjack go from off, to full whack on the magnets then too a reduced force then off again.

    What is the best way of approaching this problem.

    Thanks

    Matthew
     
  2. cork_ie

    Member

    Oct 8, 2011
    348
    58
    I am not that familiar with the Labjack 3 but as far as I can remember it has a pwm output which can be amplified to control your electromagnets.
     
  3. cork_ie

    Member

    Oct 8, 2011
    348
    58
  4. mawright89

    Thread Starter New Member

    Jun 18, 2012
    19
    0
    Thankyou for that. Im not familiar with how pwm is used for electromagnetic control. I have pspiced the following circuit and done some analysis (see attached doc file) but how do I get over the high power issues...

    I replaced R1 in this for a 12ohm to get the 0-5v range for the opamp input and the lamp with a 15.3ohm resistor as that is the approx resistance of one magnet. Am I barking up the wrong tree here?
    [​IMG]
     
  5. mawright89

    Thread Starter New Member

    Jun 18, 2012
    19
    0
  6. wayneh

    Expert

    Sep 9, 2010
    12,120
    3,046
    What you need isn't that complicated. You just need an on/off switch, right?

    Use an N-channel MOSFET. It will switch large currents when a voltage is applied to its gate. The gate pin will draw essentially no current, so no problem for the Labjack. Source pin to ground and drain pin under your load. Use a snubber diode across your coil to catch reverse emf.

    The only "issue" is that you need to fully drive the gate into saturation. That usually requires about 10v, or you can get a logic-level MOSFET which needs much less. That would be ideal. But I think you could rig something up for even a regular MOSFET. It's just escaping me at the moment.

    Love my LabJack U3, by the way. Oh, and although it can do PWM, I wouldn't use that here.
     
  7. wayneh

    Expert

    Sep 9, 2010
    12,120
    3,046
    Aww nuts, I re-read your post and realize you need VARIABLE current flow? (Not just full on and full off) And I assume you need to know the current level during each test?

    If so, you will indeed need a circuit like the one linked. A MOSFET may still be a good choice, for their high current handling, but any transistor will need good heat sinking in that circuit.
     
  8. mawright89

    Thread Starter New Member

    Jun 18, 2012
    19
    0
    Do I need a transconductance amplifier here?
     
  9. mawright89

    Thread Starter New Member

    Jun 18, 2012
    19
    0
    Thanks for your response. Its not necesary as long as I can measure the magnets force at a number of input voltages and create a callibration file for reference. But I will definately use a Mosfet if you think that would be better.

    The issue Im having now is what op-amp to use, anyone have any ideas?
     
  10. wayneh

    Expert

    Sep 9, 2010
    12,120
    3,046
    You need a current-sensing resistor to produce a small voltage in proportion to the current passing through it. (So, yes, I think that's what it's called.)

    If your max is 1A, I'd use a smaller resistor value, maybe 0.5Ω. That'd give you 500mV at 1A, so the mV offset you apply to the op-amp with the LabJack will be in the 0-500mA range. I think the LabJack will have plenty of precision to accomplish that, but you should check what the percent error might be. You could go as high as 5Ω and it might all still work.

    Your 0.5Ω resistor will need to be rated to ≥1W, to avoid overheating. A 5Ω would need to be ≥10W rated. I^2•R, times 2 for safety factor.

    Be sure to choose an op-amp that can sense the ground rail (0v setting) while operating on a single supply. I have a bunch of LM358s and it would be fine here. Many others would be fine, too. You could choose to use a dual supply (+12v and -12V), and then basically any op-amp would work.
     
  11. mawright89

    Thread Starter New Member

    Jun 18, 2012
    19
    0
    Is that the same as a "shunt resistor" or "ammeter shunt"?

    Its looking like a maximum in the range of 2.4A thus p = ((I)^2 * R) = 57.6 R

    Would this be possible without fans?
     
  12. mawright89

    Thread Starter New Member

    Jun 18, 2012
    19
    0
  13. mawright89

    Thread Starter New Member

    Jun 18, 2012
    19
    0
    If im using a 0.1ohm resistor then 5.76W should be managable i would have thought
     
  14. wayneh

    Expert

    Sep 9, 2010
    12,120
    3,046
    Yes, it's a shunt. It's the old-fashioned way of measuring current. Fancier approaches are non-invasive (no shunt in the circuit).

    Anyway, if you want to measure against voltage, there could be an easier approach. For DC, you already "know" the relationship of current to voltage from measuring just one resistance value, the DC resistance of your coil.

    You just need to scale the voltage (5V) of the LabJack up to the voltage of your supply (12V). Of course you need a variable-voltage supply that can supply 2.5A up to 12V. You might have something on hand or someone here can suggest something for controlling a supply with a 5V signal.

    But the shunt will work, too. That part you linked is crazy expensive, and maybe it's high precision or something to warrant that. I just use normal power resistors, such as Mouser 588-TUW15JR20E. They look like rectangular, white, ceramic boxes, maybe 1/2" square and 2" long. More or less. $0.59 for a 15W rating.
     
  15. mawright89

    Thread Starter New Member

    Jun 18, 2012
    19
    0
    Thankyou for your continued help. I was origionally going to go for that approach but I was told that it was a very ineficcient way of doing it. Although it could be a case of "K I S S"... less to go wrong. Ill give it a try and maybe spice some different options. Many Thanks again.

    Matthew
     
  16. wayneh

    Expert

    Sep 9, 2010
    12,120
    3,046
    For collecting data, who cares about efficiency? It's the quality of the data versus your time investment that matters.

    True, any linear solution to controlling is going to be inefficient. Controlling current or controlling voltage is basically the same thing when you're talking about a DC coil, it just comes down to which is easier to rig up.

    The efficient design - if you were building a lasting device - would be a switch mode power supply with a low pass filter, so that you could smoothly supply a chosen voltage or current. A big project, although you could just go buy one for a shocking fee.
     
Loading...