[quote author="arhi"][quote author="sparkybg"] I have made a controller for T12 myself. Here's how it works: [/quote]
nice project - perfect :D thanks for sharing.
one hint, open a separate thread, this one is already 40+ pages so it's super hard to follow. Open a new thread where you can explain & support it :) I'm sure lot of ppl have lot of questions and going trough 40 pages of a single topic is crazy hard to follow :)[/quote]
I will ask a moderator to move the posts in a new thread.
[quote author="diogoc"] But I think it is preferable to perform all the tip control by the MCU. [/quote] MCU is in total control. Is is just made synchronous to the mains voltage. The mosfet performs a bit like a triac. The MCU tells the mosfet if it should switch on next half period or not. Everything is done in 1ms. 500us before and 500us after the zero cross of the mains voltage. The PCB is much more compact this way - there is no need for big capacitors on it.
[quote author="diogoc"] Turning the tip voltage off in the periods defined to make the measurements. [/quote] It is for sure turned off in the periods. Everything is totaly defined. The MCU can turn off and on the voltage to the heater at any give time if needed. 500us before mains zero cross an interrupt is generated in the MCU. In this interrupt the MCU turns off the MOSFET (although it is turned of by itself at this moment), initiates timer interrupt after 500us, and in this timer interrupt initiates ADC measurement of the two channels. After the measurement is done, the power to the heater is turned on if needed. Then the timer again is initialised to make 4 more interrupts in order to refresh the 3 digits of the display. While doing this the PID values are calculated and the PWM for the next mains period is calculated. This way the most simple PIC16 can do the job even not having hardware multiplier. The brightness of the display is regulated also there using the period of the refresh timer interrupts.
[quote author="diogoc"] Probably also because in this way one can reduce the time that the MOSFET is turned off from 1 ms to 500us (for voltage stabilization) + some us to the ADC acquire. [/quote] This can be simulated or calculated quite easily. Only 0.15% of the power is lost this way - remember that this is done around zero crossing of the mains. Very little power is thansferred to the heater in this period, because the mains voltage is extremely low there. If you power the heater with DC, and if you turn off the heater to measure, you will loose much more power.
[quote author="diogoc"] yes to be precise the temperature sensor should be in the T12 terminals, but the temperature in the control box should not be very different and should be more accurate than without sensor because the ambient temperature can be quite different than 22°C [/quote] These 22C can be added to the parameters and can be adjustable. However, there is not a problem to add a temp sensor in the handle. If it is not in the handle but on the board, the temperature can be quite different indeed, after several hours of work. Remember that the handle is more or less heated from the iron heater and from the hand of a guy working with it. If you don't measure the temperature on the right place, it is useless anyway. As my measurements showed, after several hours (6 - 8) of work, the iron temperature stays within +/- 2-3 degrees of the setting. Remember that the iron is calibrated at 183 degrees in the same room. Even if the temperature was not exectly 22 degrees,it will be compensated by the calibration. When the temperature is set at, say, 350 degrees, the error will be small.
Here's an example: - room temperature - 30 degrees. - the controller is calibrated at 183 degrees, so in 30 degrees room temp the controller will regulate at 183 degrees. - the thermocouple amplifier gain will be (183 + 30 - 22)/183 = 1.044 instead of 1, to compensate for room temp. error. - when controller is set at 350 degrees, it will regulate to 183 + (350-183)/1.044 = 343 degrees. This is 7 degrees error, or around 2%. - if the iron handle is heated to 2-3 degrees above the room temperature, the error becomes 3-4 degrees. Do you care so much for 3-4 degrees, or around 1% error? If you don't use self-zeroing opamps, the error from the opamp temperature drift can be more than this. - if the temperature is measured in the controller's case, inner temperature can be several degrees up, compared to the room temperatrure. This will also cause cause an error comparable to these 3-4 degrees. - there are thermocopule voltages on every solder joint on the PCB and on every connector. These can also add to the error.
[quote author="diogoc"] I did not know the self-zeroing opamps but it seems be a good option for this case.[/quote] These are perfect for measuring thermocouple voltages. There is absolutely no offset in the measurement.
[quote author="diogoc"] why the 25V dc is not filtered? you can save some components in the back. [/quote] It does not have to be filtered. The iron's heater does not care about it. And to filter it, the capacitor for 70W iron would be pretty big. Moreover, everything in this controller is synchronised with the mains voltage. When the voltage of the secondary winding of the power transformer falls under 4V, the MOSFET turns off by itself for about 1 millisecond. After MOSFET is turned off, the MCU waits for about 500-600 microseconds and measures the voltage of the thermocouple. Very little power would be delivered to the iron heater when this voltage is under 4 volts, even if the power was not turned off, so the MCU can make a measurement of the thermocouple voltage on every mains half period without sacrificing the delivered power to the iron. Then, the PID algorithm is synchronized with the mains voltage also. So, on every mains period (every second half period in order not to destabilize the power transformer), the MCU makes measurement of the thermocouple, and makes the PID calculation. The PWM itself (actually fixed on-time and variable off-time) is also synchronized with the mains voltage. This way the noise from the mains voltage is greatly reduced and does not penetrate the measurement of the thermocouple voltage.
[quote author="diogoc"] I have seen that the T12 tips have a N type thermocouple. Do try to verify if it fits with the N type tables? [/quote] From my measurements I cannot tell if it is a K type or N type thermocouple. I will try to measure the voltage again and to make some calculations. As far as I remember, the voltage at 450 degrees celsius is around 9mV, which is around 20uV per degree.
[quote author="diogoc"] The C9 should not be greater due to the large noise that should be when the voltage is turned off? [/quote] C9 is there only to prevent high frequency noise to penetrate in the measurement of the thermocouple voltage. It should be small enough in order to be able to discharge in less than 500 microseconds after the power to the heater is turned off (the heater resistance is around 10 ohms when cold and around 20 ohms when hot), and large enough to filter the high frequency noise. 10n does the job. The controller works even without this capacitor.
[quote author="diogoc"] I don't see a ambient temperature sensor. How do you compensate the TC cold junction? [/quote] In fact I don't. I am using 22 degrees celsius for room temperature. I have made a measurements of the real temperature several hours after turning the controller on, and the drift is no more than 2-4 degrees. Of course, a small temeprature sensor can be added, but it will not be too precise anyway - where you should measure the temperature? At T12 terminals? At iron connector terminals? At PCB connector terminals? At opamp legs? What if the temperature in the controller box is higher than ambient? What if the temperature at the T12 terminals is higher than ambient?
[quote author="diogoc"] About the sleep sensor, I think there is no need to complicate :)[/quote] It can be replaced with a simple switch - it just sends 0 or 5V to the mcu. I decided to make it optical in order to incorporate it more easily into my iron stand with minimum mechanical work. And it works great. The price of the parts is low (5 dollars max). T12 tips heats up very quickly and as soon as I put the iron on the stand, it can lower the temperature of the tip to the desired temperature. Some seconds/minutes later it lowers it even more. After several minutes/hours it goes to sleep and turns the iron off. This way you never have a oxidized solder on the tip, and the tip life is much longer. The temperatures and time-outs are configurable and this function can be turned off if desired. The controller can work without this sensor if someone does not like it or does not need sensor at all.
For example, If I work at 350 degrees, when I put the iron in the stand, the temperature is immedieately lowered to 300 degrees, and say 20 seconds later it is lowered to 250 degrees. The iron can stay at 250 degrees for a long time, and there will not be any oxidation on the solder surface and the tip will live much longer. When you remove the iron from the stand, a T12 tip will heat up from 250 to 350 degrees in 5-7 seconds.
About calibration - the controller can be easily calibrated using 63/37 solder. The melting point of this solder is exactly 183 degrees celsius, and the controller can be calibrated to melt the solder at 184 degrees and do not melt it at 182 degrees. Because self-zeroing opamps are used, there is not offset voltage present, and once calibrated at 183 degrees, the temperature measurement is linear and correct in the whole range from 150 to 450 degrees. I have made measurements with real thermometer and confirmed this.
For example, LM358 have 2mv(typycal) offset voltage, there is also temperature drift on this voltage. This is pretty big offset for measuring a thermocouple, so there should be software or hardware offset compensation. Self-zeroing opamps doesn't need such compensation. 2uV offset is around 0.1 degrees error. That's why calibration at 183 degrees assures correct readings in the whole range from 150 to 450 degrees.
[s:]Here are the software (MPLAB X project): [attachment=4][/s:]
Latest version of firmware for front PCB: [attachment=1]
Back schematic and PCB (power): [attachment=3]
Front schematic and PCB (control): [attachment=0]
UPDATE: Do not put the C20 and C21 capacitors on the front PCB. These were for filtering on channel 2, but are now obsolete. They cause bad readings of temperature when iron with shared connection for heater and thermocouple is used (JBC C245 for example).
Sensor schematic and PCB (it can be put in the iron stand and tells the controller when the iron is in it): [attachment=2]
If you have any questions - feel free to ask.
P.S.: The uploaded back PCB looks a bit different than on the picture. It uses D2PAK transistors and one diode (TVS actually) is removed. Although there is a place for two mosfets on the PCB, just one 100V MOSFET with 0.06ohm resistance is enough for 70W iron. The inductor on the back pcb is 220uH 1.0A DRH125 type. Probably a smaller inductor will do also (say 100uH 0.5A).
UPDATE: If you are planning to use JBC C245 iron, you will have to uncomment the "JBC C245" section in PID.h file, comment the "25W with K thermocouple" section and recompile the project. You will have to recalibrate channel 2 for C245.
Hi all. T12 have thermocouple in series with the heater with a voltage of around 9mV at 450 degrees celsius, so the voltage to the heater must be turned off to measure the voltage of the thermocouple. Don't measure the resistance of T12. It is pointless to use it when a thermocouple is already available, and is far more precise than resistance.
I have made a controller for T12 myself. Here's how it works: - the 24V AC from transfomer is rectified but not filtered - this rectified 24V AC is the power to the T12, and is switched on and off for a millisecond on every half period of the AC, using P channel MOSFET. - when the voltage is turned off, the voltage of the thermocouple is available at t12 terminals, so it can be measured by an ADC in MCU - the MCU controls the heating using slightly modified PID algothitm, regulating how many mains periods the heater is turned on, and how many mains periods it is turned off.
The controller also works with regular irons with separate thermocouple, and have separate channels and adjustmens for T12 integrated thermocouple, and for external thermocouple. It can detect if external thermocouple is connected, and will use it. This way you can unplug the T12 iron, plug in regular iron, and the controller will detect that and regulate. The T12 tips can be changed without turning the controller off.
Here is how it looks: [attachment=1]
I have a video on YouТube of how it works. Search for "HAKKO T15 vs ordinary HAKKO clone" and you will find it.