reflow oven - hamsterworks wiki!

8

Click here to load reader

Upload: gedeus

Post on 22-Jun-2015

13 views

Category:

Documents


3 download

DESCRIPTION

reflow

TRANSCRIPT

Page 1: Reflow Oven - Hamsterworks Wiki!

Reflow Oven

From Hamsterworks Wiki!

This FPGA Project was completed on Christmas Day 2013 - my wife gave me the mini-oven as a present. Love you

honey!

I wanted to assemble surface mount components, and to do this I need a reflow oven (the fry-pan method is just too

crude!). Everybody on the internet seems to build their own, so I set about building one using a FPGA. Everything has

been implemented inside the FPGA, without there being any software in the control loop.

The temperature control is achieved using a Finite State Machine and a preset profile (60 seconds preheat between 120C

and 145C, then peak at 225C for 10 seconds.

Cool-down is achieved by opening the door when the 7-segment display flashes.

Mains switching is performed by a Solid State Relay wired in-line with an extension core.

The RS232/USB converter on the FPGA board is used to supply data to a host for logging, but it is not required for

operation.

Here is the setup in progress - USB microscope, oven, tweezers, FPGA controller....

Reflow Oven - Hamsterworks Wiki! http://hamsterworks.co.nz/mediawiki/index.php/Reflow_Oven

1 of 8 23.03.2014 17:31

Page 2: Reflow Oven - Hamsterworks Wiki!

Happiness is a warm reflow oven - here cooking a batch of two:

And here is the fruits of my labour:

Reflow Oven - Hamsterworks Wiki! http://hamsterworks.co.nz/mediawiki/index.php/Reflow_Oven

2 of 8 23.03.2014 17:31

Page 3: Reflow Oven - Hamsterworks Wiki!

I think I need practice - this looks to be the effect of too much paste:

On the third run I think I have it sorted:

Contents

1 Components used2 Custom reflow wing for Papilio FPGAs3 The heating controller4 Full project source5 Test run6 Actual vs reflow limits

Reflow Oven - Hamsterworks Wiki! http://hamsterworks.co.nz/mediawiki/index.php/Reflow_Oven

3 of 8 23.03.2014 17:31

Page 4: Reflow Oven - Hamsterworks Wiki!

Components used

Inexpensive 9L mini oven from http://www.thewarehouse.co.nz/ (NZ$29.99)Adafruit "K-Type Glass Braid Insulated Good up to 500°C" from http://nicegear.co.nz (NZ$17.00)Adafruit "Thermocouple Amplifier MAX31855 Breakout Board" from http://nicegear.co.nz (NZ$29.00)GadgetFactory Papilo One 250K board from http://www.gadgetfactory.net/ (US$37.99)GadgetFactory LogicStart wing from http://www.gadgetfactory.net/ (US$39.99) - used only for Seven SegmentDisplay"Solid State Relay 3-32VDC Input, 240VAC 40A Switching" from http://www.jaycar.co.nz/ (NZ$57.90) - a cheaperpart could be http://dx.com/p/ssr-25da-25a-solid-state-relay-white-134494 for under $10.A 2m extension cord from Mitre 10 (NZ$4.95)A small bit of stripboard and a few components ($10) to interface everything - see Solid State Relay for details

If you don't have any of this at hand it will cost around NZ$300.

Custom reflow wing for Papilio FPGAs

This project is a keeper, so I've designed and ordered a PCB. I'll update the site and have about 15 to give away. You will

need to supply the through-hole components, the SSR and the Adafruit Thermocouple+Amp.

Boards are here, ready to assemble and test:

Reflow Oven - Hamsterworks Wiki! http://hamsterworks.co.nz/mediawiki/index.php/Reflow_Oven

4 of 8 23.03.2014 17:31

Page 5: Reflow Oven - Hamsterworks Wiki!

The heating controller

Rather than a full PID controller this is a much simpler implementation.

It consists of six setpoints, each having three parameters:

A target temperatureA maximum for the rate of changeThe minimum time to stay in this state.

The logic is simple - if the temperature is less than the target, and the rate of change does not exceed the maximum then

turn the elements on.

The current rate of change is calculated by keeping a history for the last four seconds (16 sampling periods).

----------------------------------------------------------------------------------

-- Engineer: Mike Field <[email protected]>

--

-- Create Date: 2013-12-20

-- Module Name: heating_controller - Behavioral

----------------------------------------------------------------------------------

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.NUMERIC_STD.ALL;

entity heating_controller is

generic ( frequency : natural);

Port ( clk : in STD_LOGIC;

reset : in STD_LOGIC;

fault : in STD_LOGIC;

state : out STD_LOGIC_VECTOR (2 downto 0);

power : out STD_LOGIC;

finished : out STD_LOGIC;

temp : in STD_LOGIC_VECTOR (12 downto 0));

end heating_controller;

architecture Behavioral of heating_controller is

signal counter : unsigned(28 downto 0) := (others => '0');

signal quarter_second : std_logic := '0';

signal quarter_second_count : unsigned(11 downto 0) := (others => '0');

signal history : unsigned(15*13-1 downto 0) := (others => '0');

signal trend : unsigned(12 downto 0); -- in 1/4 degress

Reflow Oven - Hamsterworks Wiki! http://hamsterworks.co.nz/mediawiki/index.php/Reflow_Oven

5 of 8 23.03.2014 17:31

Page 6: Reflow Oven - Hamsterworks Wiki!

signal goal_rate_of_change : unsigned(12 downto 0); -- in 1/16 degrees per second

signal goal : unsigned(12 downto 0); -- in 1/4 degress

signal oldest_temp : unsigned(12 downto 0); -- in 1/4 degress

signal min_time : unsigned(12 downto 0); -- in 1/4 second

signal countdown : unsigned(12 downto 0); -- in 1/4 second

signal stage : unsigned(2 downto 0);

begin

state <= std_logic_vector(stage);

oldest_temp <= history(history'high downto history'high-12); -- oldest temp is 4 seconds ago

trend <= oldest_temp + goal_rate_of_change; -- add 16 x rate of change to the oldest temp

process(stage)

begin

case stage is

-- Heat to 100 degrees pretty quickly

when "000" =>

goal_rate_of_change <= to_unsigned( 3, 9) & "0000"; -- in 1/16ths of a degree per second

goal <= to_unsigned(100,11) & "00"; -- in quarter degrees

min_time <= to_unsigned( 0,11) & "00"; -- in in 1/4th of seconds

finished <= '0';

-- Heat to 120 degrees slowly

when "001" =>

goal_rate_of_change <= to_unsigned( 1, 9) & "0000"; -- in 1/16ths of a second

goal <= to_unsigned( 120,11) & "00"; -- in quarter degrees

min_time <= to_unsigned( 0,11) & "00"; -- in in 1/4th of seconds

finished <= '0';

-- Slowly climb to 145 degrees for 60 seconds

when "010" =>

goal_rate_of_change <= to_unsigned( 0, 9) & "1000"; -- in 1/16ths of a second

goal <= to_unsigned(145,11) & "00"; -- in quarter degrees

min_time <= to_unsigned( 60,11) & "00"; -- in in 1/4th of seconds

finished <= '0';

-- Ramp up to 217 degrees @ 3 degrees per second

when "011" =>

goal_rate_of_change <= to_unsigned( 3, 9) & "0000"; -- in 1/16ths of a second

goal <= to_unsigned(217,11) & "00"; -- in quarter degrees

min_time <= to_unsigned( 0,11) & "00"; -- in in 1/4th of seconds

finished <= '0';

-- Glide up to 225 degrees @ 1 degrees per second

when "100" =>

goal_rate_of_change <= to_unsigned( 1, 9) & "0000"; -- in 1/16ths of a second

goal <= to_unsigned(225,11) & "00"; -- in quarter degrees

min_time <= to_unsigned( 0,11) & "00"; -- in in 1/4th of seconds

finished <= '0';

-- Hold at 225 degrees for 10 seconds

when "101" =>

goal_rate_of_change <= to_unsigned( 1, 9) & "0000"; -- in 1/16ths of a second

goal <= to_unsigned(225,11) & "00"; -- in quarter degrees

min_time <= to_unsigned( 10,11) & "00"; -- in in 1/4th of seconds

finished <= '0';

-- cool down / shutoff @ -1 degree/s

when others =>

goal <= (others => '0');

goal_rate_of_change <= to_unsigned( 4096-(6*16),13);

min_time <= to_unsigned( 0,13); -- in in 1/4th of seconds

finished <= '1';

end case;

end process;

process(clk)

begin

if rising_edge(clk) then

-- do we ened to rest

if min_time = 0 then

countdown <= (others => '0');

elsif countdown > min_time-1 then

countdown <= min_time-1;

end if;

if quarter_second = '1' then

quarter_second_count <= quarter_second_count +1; -- for timing events

history <= history(history'high-13 downto 0) & unsigned(temp);

-- do we need the heater on?

if unsigned(temp) < goal and unsigned(temp) < trend and fault = '0' then

power <= '1';

else

power <= '0';

end if;

-- have we reached the setpoint?

if unsigned(temp) >= goal and countdown = 0 then

if stage /= "111" then

stage <= stage+1;

countdown <= (others => '1');

Reflow Oven - Hamsterworks Wiki! http://hamsterworks.co.nz/mediawiki/index.php/Reflow_Oven

6 of 8 23.03.2014 17:31

Page 7: Reflow Oven - Hamsterworks Wiki!

end if;

end if;

-- Timing for state changes

if countdown > 0 then

countdown <= countdown-1;

end if;

end if;

if counter = (frequency / 4)-1 then

counter <= (others => '0');

quarter_second <= '1';

else

counter <= counter+1;

quarter_second <= '0';

end if;

end if;

end process;

end Behavioral;

Full project source

File:Reflow source.zip

Test run

Here is the output of the second test run, so it is starting at about 50C - I didn't have a long enough buffer set on my first

test run:

And this is the profile of the first run when actually reflowing a board - it is peaking a little high so needs a little tuning:

Reflow Oven - Hamsterworks Wiki! http://hamsterworks.co.nz/mediawiki/index.php/Reflow_Oven

7 of 8 23.03.2014 17:31

Page 8: Reflow Oven - Hamsterworks Wiki!

Actual vs reflow limits

After reading http://www.microsemi.com/document-portal/doc_download/131105-solder-reflow-leadfree.pdf I put together

the longest & highest temperature vs shortest & lowest temperature, and graphed one of my logs. It looks like it is all OK -

the cool-down could be steeper - maybe I should point a fan at the open oven:

Retrieved from "http://hamsterworks.co.nz/mediawiki/index.php/Reflow_Oven"

This page was last modified on 30 January 2014, at 21:10.

Reflow Oven - Hamsterworks Wiki! http://hamsterworks.co.nz/mediawiki/index.php/Reflow_Oven

8 of 8 23.03.2014 17:31