Shop OBEX P1 Docs P2 Docs Learn Events
Need MOSFET help please (AMP type not switching) — Parallax Forums

Need MOSFET help please (AMP type not switching)

floodhoundfloodhound Posts: 45
edited 2006-12-16 02:28 in General Discussion
Overview: I am designing a temperature controlled device with a basic stamp using a PID. This involves heating a device that is 13V / 4Amps. I am able to read the temperature (LM235) and drive a MOSFET accordingly. However; I wanted to drive the MOSFET in an amplifier type of way vs. switching it on and off rapidly. I was considering PWM out of a pin on the basic stamp, through a 220Ω resistor in parallel with a capacitor into the MOSFET to make it an analog value. This is described in the Basic stamp book and makes perfect since to me. Where I get lost and need help in is how can I arrange the MOSFET so that is becomes an AMP? I will assume the stamp is going to be putting out around 1.7Volts – 5Volts, because I will be using PWM
·
(sample code = ·PWM 6, 255, 255 gives 5 volts and PWM 6, 20, 20 gives less depending on stamp) ·
·
I want to amplify these voltages from a MOSFET to 0-4 Amps. Can some one help or point me in the right direction? I am using an IRF540 or something similar. If any thing can I get some numbers to crunch for amplifying this thing.

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-12-15 23:16
    Im curious why you want to analog current control the heater element instead of straight PWM switching. If you have a dumb heater (ie the coil and no intelligent control already in place), switching current through it will provide a better linear response. MOSFETs don't have a linear response with repsect of the gate to souce voltage, it's exponential. If you however switch the mosfet via PWM, you dont care about the non-linearity of the mosfet because the heater element itself plays the role of the capacitor.

    When a PWM signal is filtered through a resistor and capacitor, what happens mathmatically is the capacitor integrates the voltage so the output voltage seen is near constant, but then feeding that voltage into a non-linear mosfet, you get a non-linear repsonse. If you instead switch the MOSFET with the pure PWM, the heat generated by the coil is the integral of the current flowing through it or a near constant heat output with a linear relationship to the duty cycle of the PWM signal.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • floodhoundfloodhound Posts: 45
    edited 2006-12-16 00:44
    Thank you for responding. I did try PWM however I believe that it is too fast to control accurately my heating device. This device has to be heated and controlled with the up-most precision. Here is a picture of how I wired up the MOSFET http://www.floodhound.com/sch1
    S1 is the output of my stamp. R2 is the heating element ( ceramic plate ) also the 5V is really 13V on the circuit. I thought that I could just run the MOSFET in a Amp fashion. Let me know what you think.
  • T ChapT Chap Posts: 4,223
    edited 2006-12-16 01:19
    You don't need fast pwm for heating elements, much slower around 500ms to 2 seconds cycle times. You should close the loop and have the element turn on and off based on the temperature input from the sensor for the most accurate control. The LM device may or may not suit that purpose, but a device like the thermocouple kit using the DS2760 will track temperature very fast and you can have the heating element on as required to stay at a desired temp. Another solution is the DS1626S+ that can allow settings of minumum and max temp states, and can output the control to turn on and off the elements.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-12-16 01:27
    Ok, Ive thought about this some, and I know what your problem is. The issue is that you are trying to drive the heating element when you are only allocating a very small portion of you total processing time to driving the heater coil. PID is very time consuming and if say it takes 50ms to compute one PID cycle and you allocate 1 ms to driving the MOSFET you can only get 1/50th duty cycle max, so the coil will never seem like its never on. Even with the driving via analog voltage, as so as you stop driving the line the voltage will decay and the heater will turn off again. What you need to do is just directly drive the line connected to the gate of the MOSFET and boil the result of the PID code into a binary result (switch the coil on or off). This is still PWM control, but you can reach all sorts of variablility in driving it because while you are computing the next PID cycle the heater is either on or off.

    By keeping track of the sequence of zeros and ones you send to the heater each time, you can compute what the next value should be given your PID result.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • T ChapT Chap Posts: 4,223
    edited 2006-12-16 02:28
    I do this exact same process on an SMT oven software. The software reads in the actual temp from the DS2760 every second. The PWM to the heating element is cycling at 2000 ms, the duty is set by the desired rate of temp change(increase) so as to not heat the element too fast on start up. Then, once the goal temp is reached, the software does not allow an On State again until the temp has dropped below the Goal Temp. Since there is a good bit ot thermal inertia with a heating element, this works out nicely and a temperature can be maintained within 5 degrees F of the Goal Temp. If the element is DC you can still use the IRF540, for a larger AC element you can use an SSR.

    Lower than 500 ms cycle times is really pointless on a heating element.
Sign In or Register to comment.