Author Topic: Arduino PID Soldering Station - mosfet problem  (Read 4544 times)

0 Members and 1 Guest are viewing this topic.

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Arduino PID Soldering Station - mosfet problem
« on: April 03, 2020, 12:18:13 pm »
Hello. I built a soldering station based on a PID controller for a Gordak soldering iron. I used a Nokia 5110 LCD as a display. The schematic and the code are attached. The problem is that I tried two times using different IRF530 transistors and the heater of the soldering iron was staying cold. When I used a K1257 or a P55NE06, the soldering station worked normally. Later I added a anti parallel diode to the heater of the soldering iron (1N4007).
Why the soldering station was not able to heat my soldering iron when I was using IRF530 ?

This is the original project: https://www.allaboutcircuits.com/projects/do-it-yourself-soldering-station-with-an-atmega8/
My code: https://pastebin.com/uuDs7ZB0
The schematic is attached.
« Last Edit: April 03, 2020, 12:35:26 pm by mike_mike »
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: Arduino PID Soldering Station - mosfet problem
« Reply #1 on: April 03, 2020, 12:57:39 pm »
Possibly fake or damaged parts since MOSFETs are susceptible to ESD damage.
 

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #2 on: April 03, 2020, 04:27:23 pm »
The mosfet is heating up to about 50 degrees C mounted on a heat sink of 3.5 x 5.5 cm.
Is that normal, if the mosfet is simply driven on/off ?
 

Offline WattsThat

  • Frequent Contributor
  • **
  • Posts: 767
  • Country: us
Re: Arduino PID Soldering Station - mosfet problem
« Reply #3 on: April 03, 2020, 09:50:43 pm »
Typical internet crap design.

The mosfet is being driven from a 5 volt PWM output on the atmega. Therefore, you need a mosfet that fully turns on with a 5 volt signal, the IRF530/540 and P55NE06 require at least 10 volts to reach their stated, lowest output resistance. What you need is a “logic level” rated mosfet that achieves its rated on resistance with 3.3-5 volts on the gate. The 2SK1257 is a logic level rated device and has a reasonably low on resistance of 24 milliohms so that is the device to use for this application.

There is another common error in the design and that is the way R2 and R3 are connected, it’s wrong as it forms a voltage divider, lowering the limited available gate drive voltage. The high side of R3 should be connected to the atmega pin (MOSI) rather than the gate of the mosfet. R3 is also much lower than it needs to be, 10k is perfectly fine for the design.

The reason why the mosfet gets hot is because it’s not fully turned on and operating in its linear region, acting as a variable resistor and dropping the soldering iron element current across the mosfet according to P =I^2 R. Once the mosfet is fully turned on so it’s drain to source resistance goes down to its rated on resistance, that heating effect will be greatly reduced or eliminated.
 
The following users thanked this post: mike_mike

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #4 on: April 06, 2020, 05:55:17 pm »
Hello, I made the original schematic of this project using 7 segment display and Arduino Uno.
The project worked fine on the breadboard but after building the PCB it shows only 888 on the display.
I checked the PCB and the connections and it seems to be ok.

What should I do ?
The code: https://pastebin.com/0KifThXC

I used common anode 7 segment display driven by 3 pnp transistors (BC327-40), each with 1K base resistors.
In the schematic are Common Cathode, but I used common anode with the same pinout.
If I connect the display to computer only, then it first shows 350 and after this it shows a number at about 500. But if I connect it to the 24V power supply, then it shows 888.
« Last Edit: April 06, 2020, 06:19:14 pm by mike_mike »
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6213
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #5 on: April 06, 2020, 06:59:03 pm »
I tried two times using different IRF530 transistors and the heater of the soldering iron was staying cold. When I used a K1257 or a P55NE06, the soldering station worked normally.

That schematic is using only about 4V to control the transistor's gate.  That is not enough for an IRF530.  For example, the datasheet https://www.vishay.com/docs/91019/91019.pdf specifies 0.16 Ohms for RDS(on) at VGS = 10 V.  At 4V that MOSFET can barely start to open.  Either you use a higher voltage to control the gate of the MOSFET, or use another MOSFET model with a lower threshold gate voltage, VGS(th).

To search what models to use, you need to search for "low threshold MOSFET", sometimes improperly named "digital" MOSFETs, too.
 
The following users thanked this post: mike_mike

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #6 on: April 06, 2020, 07:07:11 pm »
I already solved the problem with the mosfet. I used a logic level mosfet and the soldering station with Nokia 5110 LCD is working.
I am concerned about the problem described at the reply 4.
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6213
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #7 on: April 06, 2020, 07:51:33 pm »
Congratulation for solving that.   :-+
Solving a problem is important for today, understand what and why it happened is important for the rest of the days.  :)

About why it worked on the breadboard but it doesn't work any more on the PCB, it's because something has changed.  I know this sounds like Captain Obvious, but there must be something you changed but don't know yet, maybe a mistake not yet spotted, maybe some wrong wiring.  If it all worked well on the breadboard, then the same components must work on a PCB, too.

Verify the PCB again, verify the wiring, or at least put some pictures with both sides and the wires.

Online floobydust

  • Super Contributor
  • ***
  • Posts: 7016
  • Country: ca
Re: Arduino PID Soldering Station - mosfet problem
« Reply #8 on: April 06, 2020, 08:36:16 pm »
Why is variable 'Input' a float, going into analogRead(), which returns an int? "Returns int (0 to 1023)". Same for double 'newSetpoint'.

I would improve the thermocouple amp noise filtering, move one leg of C3 to other side of R15 and add a 10nF capacitor across R12. It's likely your 24VPSU adds noise. Rx1 is typically 1MEG.

Your software for the A/D needs averaging and open-thermocouple detection, and best to not read the A/D at the same time the heater is switched as it causes a glitch.
I don't think you are linearizing the thermocouple with that linear scaling - some thermocouples are non-linear in the soldering tips, depends on the make/brand.

Code: [Select]
uint16_t adcAvg, adcTot;

adcTot -= adcAvg;
adcTot += readAdc(adcChannel);
adcAvg = adcTot >> 4; // exponential average 16 samples
 

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #9 on: April 06, 2020, 09:31:05 pm »
I managed to display 350 on the display but it does not change as I rotate the pot.  The voltage at the pot pin varies from 0V to 3.62V.
It works only if I connect the Arduino to the USB of the computer.
If I use the 24V power supply, then it shows 888.

@floobydust Thank you for the information. Currently I am working to make the soldering station to work. Then I will probably try some modifications.
« Last Edit: April 06, 2020, 09:34:14 pm by mike_mike »
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6213
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #10 on: April 06, 2020, 10:26:34 pm »
Looking closer, the schematic for the display is wrong.

J4 pin 1 is supposed to be GND according to first page, yet in the second page J4 pin 1 is at the emitter of the PNP transistor, and expected to open those transistors with a positive voltage, which is wrong.

Where from are coming the J3 pins 1, 2, 3 in page 2?  Couldn't found them in page 1.

Also, this doesn't make any sense:
I used common anode 7 segment display driven by 3 pnp transistors (BC327-40), each with 1K base resistors.
In the schematic are Common Cathode, but I used common anode with the same pinout.

Unless you attach the schematic you used for the final version, (preferably some pics, too, so we can check for PCB errors) nobody can guess what you did.

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #11 on: April 06, 2020, 10:42:40 pm »
Please find attached the explanation about the connections between the schematics and the final versions of the schematics.
In the main schematic (the one with Arduino) the connector J2 is connected pin to pin to connector J1 from the display schematic. The last 4 pins of the J2 connector (main schematic) are connected to J3 and J6 connectors from the display schematic, J6 is connected to pin 12 of J2. The connector J3 from the display schematic is connected as follows: pin 1 to pin 11 of J2 (Arduino schematic), pin 2 to pin 10 and pin 3 to pin 9.
Also, please find attached the layouts. This is all I have for now. I verified a few times the connections on the physical circuit and they are fine.

Edit: I managed to display the current temperature of the soldering iron but only when the Arduino is connected to the PC (USB). If I connect the 24V supply and disconnect the USB, then it shows 444 or 666 of 888. One problem was the 100nF capacitor (Cref1) which was in short circuit and I did not found it at the previous checks.

Edit 2: It is working but only if I connect both USB and 24V power supply. What should I do to make it work only with the 24V power supply ?

Edit 3: I found a solution for this problem: If I powered the Arduino to the Vin pin, then the minimum voltage allowed here is 7V. In my schematic, the supply voltage at this pin was 5V, so it was lower than 7V. I read that Arduino can be powered through the 5V pin, but this is not recommened. I also read that it can be powered via the USB, so I cut a USB cable then I soldered the + and - wires to the output of the 5V regulator (7805) then the other end of the cable I introduced into the USB connector on the Arduino. And it worked.
« Last Edit: April 06, 2020, 11:55:05 pm by mike_mike »
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6213
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #12 on: April 07, 2020, 08:17:02 am »
so I cut a USB cable then I soldered the + and - wires to the output of the 5V regulator (7805) then the other end of the cable I introduced into the USB connector on the Arduino. And it worked.

Good to hear you found both the problem and the workaround for it, well done!   :-+
 
The following users thanked this post: mike_mike

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #13 on: April 12, 2020, 03:18:43 pm »
Hello. I am in the following situation: I am out of stock for logic level mosfet transistors and I want to adapt the schematic in order to use standard threshold Vgs mosfet (2-4 V). For example: IRF630, IRF530, IRF830.
I drew the attached schematic.

I modified the right side of the schematic, by adding a 12V regulator and a push pull configuration for the mosfet.

Please have a look at the schematic and tell me what you think.
« Last Edit: April 12, 2020, 03:22:02 pm by mike_mike »
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6213
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #14 on: April 12, 2020, 04:53:00 pm »
See this PDF from TI, there are schematic examples, too:  Fundamentals of MOSFET and IGBT Gate Driver Circuits

About picking the right MOSFET,  you need to look for those with a minimal RDS(on).  For example, let's say your soldering iron gas 48W.  At 24V, this will mean a 2A current.

Looking in the datasheets for the transistors you mention, the typical RDS(on) of IRF830  is 1.5 ohms.  This means even if kept continuously on, with Vg = 10V, it will still dissipate approx. 1.5 \$\Omega\$ * 2A = 3W  which is a bit much.  The other two MOSFET models are preferable.  The lower RDS(on) the better.

Apart from the power dissipated by the RDS(on) during the on time, there is also power dissipated during each edge of the PWM signal, while the MOSFET is turning on or off.  Even if the edges from the microcontroller's PWM are very sharp, there is always the parasitic capacitance of the MOSFET gate (or of the bipolar transistors junctions) that will accumulate charge, thus slowing down the switching times, which is bad.  The first PDF explains other subtleties of switching a MOSFET.

Choosing a lower PWM frequency can also help reducing the power dissipated by the MOSFET, because there is are less switching edges per second.
« Last Edit: April 12, 2020, 04:57:45 pm by RoGeorge »
 
The following users thanked this post: mike_mike

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #15 on: April 14, 2020, 05:59:45 pm »
It is normal for 7812 and 7805 regulators to let the high frequency noise of a SMPS (24Vdc/3A) to pass through them ?
Please have a look at the attached screenshots.
The yellow trace is the input from the SMPS and the blue trace is the 12V output from the L7812 - DS0277, DS0279, DS0285.jpg
And the 5V output of the 7805 regulator (blue trace): DS0288, DS0293, DS0296.
The 7812 and 7805 regulators are cascaded.

Same tests, but using a transformer with rectifier and filter (3x4700uF/35V) which is having a DC output of about 20-21 V dc. Yellow trace in the input in 7812, and blue trace is output of the 7812 and 7805.
L7812: DS0304, DS0311, DS0314
L7805 (blue trace): DS0328, DS0330, DS0338.

Please find attached the schematic of the circuit.

The circuit is working normally but I was just wondering if this is normal ... (both situations with SMPS and toroiodal transformer).

Edit: I don't know more information about the SMPS apart from it is a cheap Chinese one.
« Last Edit: April 14, 2020, 08:13:00 pm by mike_mike »
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6213
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #16 on: April 14, 2020, 11:49:59 pm »
- Switching power supply can produce strong noises, and the switching noises can propagate either through the wires/PCB traces, or through the air as electromagnetic fields.  Make sure the noise you see is from the traces, and not induced in the probes.  Use the GND adapter spring coming with the oscilloscope's probes, and not the long GND wire with alligator.





- Once you are sure the noises you see are from the PCB and not from the probes, try to see what happens if you put a 10...100 uF in parallel with C8.

- Another method to stop the high frequency noises to enter into the stabilizers is to put in series an inductance, for example in series with D2, or to use ferrite beads.



Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #17 on: April 15, 2020, 05:43:38 am »
I used the measuring method presented in the video and I have got the following results:
Output of the SMPS: 0429, 0430, 0432.
Output of the 7812: 0437, 0441, 0442
Output of the 7805: 0448, 0451, 0455

Please have a look at the screenshots.
I observed that a part of the noise high frequency noise disappeared.

Edit: I also checked with a 47 uF/63V capacitor in parallel with C8, but it didn't improved the results (the Vpp amplitude of the signal remains the same).
The waveform from 0429 has the same frequency with the PWM signal of the pin 11 of Arduino.

Edit 2: I also want to say that the 7805 and 7812 are connected using wires to the PCB, because they are installed on a heat sink. This also could be a source of noise. I measured with the oscilloscope in the spot were the wires are connected to the PCB and I got the screenshots below.
« Last Edit: April 15, 2020, 07:13:13 am by mike_mike »
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6213
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #18 on: April 15, 2020, 08:22:55 am »
The only spikes looking very bad are from the power supply, the rest looks reasonably OK.

- Any piece of wire is also an inductor, a capacitor and a resistor. All three at the same time.  Long wires, or thin wires, can create very nasty spikes with switched loads.  How does the +24V waveform looks like when measured at the output of the power supply (before the wires to the soldering station)?

- In the schematic there is no capacitor between +24V and GND.  There should be at least 2 of them.  One of a few hundreds...thousands uF to act as a local energy "reservoir", and in parallel with the +24V electrolytic another 0.1 uF so the high frequency spikes can find a short path through the 0.1uF without going through the long wires up to the power supply.  C1 and C2 you have now does not help if the 24V heater is connected before the D2, as the schematic suggests.  Either move the C1 and C2 at the anode side, or simply remove the diode and pay attention to the correct polarity when connecting the circuit to its power supply.

- Maybe you can find a broken PC power supply and recover one of those ferrite tor coils to put it in series with the +24V, right near the solder station.

- The power circuit must have thick connection wires between the power supply, the MOSFET and the soldering iron socket.  For example, the 3 multi stranded wires usually found inside 220V/16A power cords (the EU ones made with copper, not cheap Chinese fake 16A - even if they look like copper, if the metal they are made of is attracted by a magnet, that's not good).

- Just to be sure there are no strange ground loops between the PC, the power supply and the oscilloscope, during probing do not connect the Arduino to the PC USB cable, leave the Arduino powered by its own circuit.

- Another thing (we will let this to talk about after fixing the spikes), I suspect that the turn off edge of the MOSFET is not very sharp.  The charge accumulated in the GS junction is left to discharge through the 4.7K to ground.  If the MOSFET still heats too much, that's where the MOSFET driving circuit can be improved.  This is visible in the DS 0429.jpg, where the strong spikes appears only when the MOSFET is turned on, but not when is turned off, suggesting the turn on edge is much faster than the turn off edge.  To minimize the power dissipated in the MOSFET, and therefore its temperature, we want fast edges for both on and off switching.

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #19 on: April 15, 2020, 09:17:17 am »
1. The +24V output waveform: DS0492 (without ferrite tor coil, without 2200uF capacitor and without 100nF capacitor).

2,3. Using ferrite tor coil (a yellow one), 2200uF/63V capacitor, one 100nF capacitor, measured on the input of the soldering station:  DS0525.

4. I used thick wires - 1mm2 stranded.

5. Arduino was not connected to the PC during tests.

6. When the mosfet goes off (the probe was connected to Drain): DS0166 (blue trace)
 and the probe connected at G of the mosfet: DS0160 (blue trace)
Yellow - pin 11 (PWM) of Arduino.
The mosfet does not heat too much. After a few tens of minutes, it is not hot, it is only a little bit warm. I mounted it on a 3x5 cm heatsink.

7. Without ferrite tor coil, only with 2200uF capacitor in parallel with 100nF capacitor : DS0523
« Last Edit: April 15, 2020, 10:10:45 am by mike_mike »
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6213
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #20 on: April 15, 2020, 10:43:03 am »
Seems like you reduced the spikes 3 times, and the MOSFET doesn't heat much any more.
Well done!   :-+

If you insist to reduce the spikes even more, use even thicker stranded wires about 3mm2, thicken the PCB traces on the power path with a layer of solder over the traces, or reinforce those PCB paths with copper wires soldered along the PCB traces.  Keep high current paths as short as possible, both in wires and in PCB, and avoid ground loops at all cost.

Additionally, more 0.1uF in parallel (or similar values) might help, for example MLCC type or similar, and electrolytics with low ESR.



Later edit:

If you still want to make it even smoother, e.g. for a commercial product, you can put a coil in series with the heating element, and turn it into a Buck converter instead of using PWM.  That will have the advantage of smoothing the current through the heating element, which will now see (ideally) an adjustable DC current instead of pulsing PWM, thus lower parasitic EMI, and shorter paths for the switched high current (because the return diode, the coil of the Buck converter and the filtering capacitors for the returning paths of the switched currents can be placed right near the MOSFET, also, the pulses of current in a Buck converter will be much lower in amplitude than in a PWM).
« Last Edit: April 15, 2020, 11:16:39 am by RoGeorge »
 

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #21 on: April 15, 2020, 05:23:37 pm »
I made a small PCB for the filter, which contains the toroid ferrite coil, the capacitor (I used for the final project an 4700uF/35V) and a 100nF ceramic capacitor.
I noticed that at the output of the filter (on the pcb connector) the spikes disappeared, but if I check on the input of the soldering station, then the spikes are back, with an peak to peak amplitude (Vpp) of about 1.6V. The distance between the small PCB and the input of the soldering station is about 5 cm and I used 1.5mm2 wires, and for connecting the wires to the PCB's I used screw terminal blocks. I also soldered 1.5mm2 wires on the tracks that conduct the current to the power mosfet on the PCB.
I connected at the output of the LC filter the entire soldering station, including the mosfet and the soldering iron.
I tired with different wires between the LC filter and the soldering station, and the results were the same.

What I am doing wrong ?

Output of the LC filter: 0526
Input of the soldering station: 0539
« Last Edit: April 15, 2020, 05:33:15 pm by mike_mike »
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6213
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #22 on: April 15, 2020, 06:33:42 pm »
DS 0523 has 0.8 Vpp spikes, while the current DS 0539 has 1.5V spikes.  Something has changed, only you know what.   :)

Are you sure you don't have any ground loops?  For example if you "chain" the wiring like that:
- GND from power supply -> GND pin of the 7812 -> GND pin of the MOSFET, that would be a bad wiring.

A better wiring will be a "star" topology, with a single GND point, and from there separate wires:
- GND from power supply -> Unique GND on the solder station
- Unique GND -> GND pin of the MOSFET
- Unique GND -> GND pin of the 7812
- Unique GND -> 24V filtering electrolytic GND, and so on

Correct wiring, correct decoupling, correct PCB design and minimal EMI interference with fast switching many amps is not trivial.  What you see can as well be just a ringing in the wires, or some nasty reflection/resonance in a transmission line.  Maybe a photo with the physical wiring might help to see if there is something obviously wrong.

After all, why do you want to get rid of those spikes?  Is the soldering station not working, or too noisy?
« Last Edit: April 15, 2020, 06:37:17 pm by RoGeorge »
 

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #23 on: April 15, 2020, 06:57:23 pm »
After all, why do you want to get rid of those spikes?  Is the soldering station not working, or too noisy?
The soldering station is working as expected. I don't see any problems for now.

Should I leave the soldering station as it is, if it is working ?
Are those spikes harmful ?
« Last Edit: April 15, 2020, 08:29:04 pm by mike_mike »
 

Offline mike_mikeTopic starter

  • Frequent Contributor
  • **
  • Posts: 900
  • Country: ro
Re: Arduino PID Soldering Station - mosfet problem
« Reply #24 on: April 16, 2020, 09:38:56 am »
Please find attached my layout.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf