You are on page 1of 18

Chapter 3 Implementation

Chapter 3

Implementation

1.1 Working
The overall working of the circuit will be defined in this section.
The microcontroller used in this project is Arduino Nano 3.0 This micro controller
provides good processing speed with sufficient peripherals to achieve the task.the
clock frequency is 16MHz.

Figure 3.1 Arduino Nano 3.0

Using Arduino Nano 3.0, we generate PWM pulses at 68KHz which is the natural resonant
frequency of the tank circuit. These PWM signals drive the MOSFETs to produce a square
wave signal at the output of the inverter. Inverter maps the input PWM signal on the
output. Microcontroller is isolated from the circuit using optocoplers. A dead time of
1.3µsec is inserted between the complementary signals.
The power provided by the inverter is coupled via coupling transformer and fed into the
LC tank in which the coil acts as the coupling transformer secondary coil. The waveform
achieved across the tank circuit is sinusoidal in nature. After the power has been coupled,
27
Chapter 3 Implementation

we insert the work piece into the work coil. High frequency current passing through the
coil gets coupled with the work piece and induce eddy current which results in heating the
metal piece.
The circuit in fact behave much like a transformer. When primary coil if coupling
transformer is energized with no work piece inside the coil, it behaves like a short circuit
so large no load current flows through the inverter. When there is a work piece, the value
of the current falls.
The problem in the system comes when the work piece is inserted in the work coil and
further when it starts to heat. The addition of a work piece in the system reflects an
inductance on the tank circuit and effectively changes the resonant frequency.
In our project, we track the changes resonant frequency in real time and keeps updating
the system on new Fr to provide optimal condition for the system.

3.1.1 Timers
Microcontroller Arduino Nano 3.0 has 14 times out of which TIM1 and TIM8 has the
capability to provide the complementary PWM signals with addition of dead time. TIM1 is
configured on PWM mode to provide signals on dedicated pins of channel 1 (PA8) and
its complementary channel 1N (PB13).
Timer 2 has been conditioned on achieving the time difference between the zero
crossings of the waveforms coming from tank capacitor voltage and inverter voltage. At
resonance, the phase difference between them should be 90 ͦ. The inverter waveform is
the same as PWM signal.
Timer 3 is a 1KHz time which takes on the value of PID to ensure that the system has
completely update itself.

28
Chapter 3 Implementation

3.1.2 Inverter output results


A full H-bridge circuit contains four MOSFETs connected in the following configuration as
shown in figure 2.5 similar circuit produce an output waveform as shown in the figure.

Figure 3.2: Square wave output


Sometimes, we observed voltage ringing on the voltage waveform at the transition. This
happens due to appearance of inductance on the gate terminal of MOSFET or switching
𝐿𝑑𝑖
device. This large value cause a large . The problem of ringing effect can be catered
𝑑𝑡
by connecting a resistance of approximately 5 to 10 ohms.

3.1.3 Tank Circuit Output


With the inverter connected to the tank circuit via coupling transformer, the output of the
tank circuit is as follows: A pure sinusoidal waveform of the drive frequency.

Figure 3.3: Tank circuit output

29
Chapter 3 Implementation

3.1.4 Inclusion of phase Difference


To track the real time resonant frequency which might change to due to various
environmental as well as loading factor, we need to have a reference or an entity that
varies if there is any change in resonant frequency.
With the system in order operating at no load resonant frequency, the tank capacitor
voltage and inverter voltage are 90 degree out of phase and this sets the standard to
obtain the resonant frequency. If the system operates at a frequency other than Fr, the
tank capacitor voltage and inverter voltage are no longer at 90 degree nut rather phase
shifted to more than or less than 90 degree depending on the change that happens to the
system.
We observed that with the addition of a work piece I the work coil, the phase difference
between the tank capacitor voltage and inverter voltage no longer remains at 90 degrees
but it becomes greater than 130 degree and the tank quenches more current from the
system.
Below attached are the figure which represent the system operating resonant frequency.
The waveform are 90 degree out of phase.

Figure 3.4: MOSFET

30
Chapter 3 Implementation

3.1.4.1 How to cater for phase shift?


With the addition of the work piece, it seems to the system that inductance of the tank
circuit has increased and overall the current believes that it is made to run at frequency
greater than the resonant frequency. So a mechanism must be devised to monitor the
change in inductance of the system and calibrate it is to the new parameters offered by
the circuit.
It must be kept in mind that resonance frequency is difficult to be tracked by hit and trial
method. Since it is not defined that how much the value of the inductance has changed,
we cannot take hits on the dart board to achieve the desired result. A minor movement of
the workpiece inside the coil offers a new inductance.
So the outcome of the talk is that we need to ensure that the phase shift between the tank
capacitor voltage and inverter voltage stays at 90 degrees so that we are able to keep the
circuit operating at resonant frequency at all time. To achieve this purpose, we need a
feedback system to update the operating frequency of the system.

31
Chapter 3 Implementation

3.2 Open Loop Induction Heater


The system was first made to run in the open loop condition to learn and understand the
basic of the concepts revolving around changing frequency. With the increase in the
operating frequency, the power drawn by the circuit from the supply increased. It was
maximum at the resonant frequency and decreased on either side of the changing
frequency.

Figure 3.5: current graph for series Resonant circuit

With the work piece inside the coil, we need to decrease the operating frequency to bring
the system back to resonance. We devised the logic that if the system is already made to
run at frequency less than the resonance frequency, then if work piece added to the work
coil, it takes the system to resonant frequency because the operating frequency was
already less.
We verified the characteristics of the circuit as series resonant circuit and also analyzed
the behavior of the circuit with the help of isolated channel Oscilloscope. This helped in
better understanding of the problem that was occurring when work piece was inserted in
the coil. We observed that the frequency of the tank circuit remained the same but there
was and additional phase shift added in the waveforms of the tank capacitor voltage and
inverter voltage which at resonance must stay at 90 degree apart.

32
Chapter 3 Implementation

The figure attached below shows a system that was made to running at a frequency lower
than resonant frequency such that inverter voltage and capacitor voltage are almost in
phase with each other.

Figure 3.6: Waveform for operation F<Fr

Now it was evident that the addition of workpiece will change the phase difference
between the waveforms but how much effect will be there was a question. It was found
that with different work piece like screwdriver, pliers, iron rod and nut, the effect was
different and it depended upon the shape and type of the work piece. The waveform below
shows when the work piece chosen to be a plier was inserted in the work coil. It has taken
the phase difference the waveform to approximately equal to 90 degrees which occur at
resonance

33
Chapter 3 Implementation

Figure 3.7: Waveform for operation at open loop Fr


This gives a logic sense cloth to the achievement of the project that we have to devise a
way that when the workpiece is added in the coil, induction heater has to change its
operating frequency in such a way to keep it at resonant frequency.

34
Chapter 3 Implementation

3.3 PID Controller


In modern industry we are stepping in the world of automation where the machinery
checks various parameters and adapts itself to the new environment. This is important to
regular certain processes. So the controller compares the reference signal set by the
programmer with the feedback signal and change the behavior of the system accordingly.
Error is the difference between the reference signal and the feedback signal. The task of
the controller is to somehow eliminate the error. The topology that various industrial units
follow is PID controller which is a mathematical acronym for proportional, integral and
derivative controller.

Figure 3.8: PID controller on a plant

35
Chapter 3 Implementation

3.3.1 Proportional
Proportional as the name suggest is a synonym for gain. It is the easiest parameter to
play around. They gain factor is multiplied with the error to result in the proportional factor.

Figure 3.9: Proportional controller

A large value for proportional controller means that the system will try to reach the
steady state quickly and will perform this behavior for slight error as well. This quick
response of the system may be desirable but it leads to overshoots in the system. So
rather than stabilizing the system, it adds jerking effect in the system.
Proportional = KP * Error

Figure 3.10: proportional controller effect on the system

36
Chapter 3 Implementation

Example
It terms of real world around us, take an example of an oscillating pendulum. The greater
the force applied oscillations on the pendulum, the more quickly it will reach the center
point and greater will be the oscillations or overshoots due to inertia. The same case
happens in feedback system as well.

However too little a value of the proportional factor means that system will take much
longer to reach the steady state point avoiding over shoots. This may not be desirable
because if the time is much longer, the system may fail to pick it up and bring it to stability.

3.3.2 Integral
Integral is also termed as accumulation of error over a period of time. The error can be
negative or positive so the output of the integral can increase or decrease depending on
the state of the system.

Slowly, the value gets larger until the integral term is finally large enough to matter. The
purpose of integral controller is to eliminate the steady state offset. If the error is large,
then the integral will drive the controller output to change fast. The speed at which the
controller response is depended on the integral time value setting. If the time value is
large, the response will be sluggish otherwise the system is subjected to oscillatory
response avoiding overshoots.

Integral work by adding a lag in the system and damping the overshoots. The occurrence
of overshoot contributes a large value to the system which is the drawback of integral
controller.

37
Chapter 3 Implementation

Figure 3.11: Integral controller

Figure 3.12: Integral controller response with Ti

38
Chapter 3 Implementation

3.3.3 Derivative
Derivative term is the rate of change of error with respect to time. It work by adding a
phase load to the system. The behavior of derivative is predictive. It is calculated by taking
the difference of the current error with the previous error. It helps to settle the system
quickly and avoids overshoots.

Figure 3.13: Derivative controller response

𝐝𝐢
Derivative factor = Kd *𝐝𝐭

So as a whole, PID controller helps in setting the system to steady state in relatively
less time.

39
Chapter 3 Implementation

3.4 Tuning of the system


The value of PID depends on the system control loop equation. However the system may
be turn for the values by hit and trail method. It depends on the system what type of
controller is best suited. The stability maybe acquired with just PD controller or maybe
with PI controller.
Induction heater with resonant inverter looks a variable resonant frequency when a work
piece is inserted inside the work coil. The frequency continuously varies with the rise in
temperature of the work piece, slight motion of the work piece in the work coil and
movement of the circuit. In this system, we are concerned that the system should always
stay locked to the resonant frequency and shall try to reach the steady state. The main
requirements from the controller are:
1 Quickly tracks the resonant frequency
2 Stay locked to the resonant frequency
3 offer less oscillations around frequency

The approach to achieve this task may be different. The addition of proportional controller
tries to bring the system to the newly offered resonant frequency quickly by setting a large
value for proportional factor but this alone cannot help us to achieve all the desired
behavior since a large proportional factor results in large overshoots.
To provide the system with the ability to offer less oscillations, we may use integral
controller and bring the system steady state but using an integral controller offers lag in
the behavior. Since, we desired for the system to quickly respond to new resonant
frequency, the use of integral controller was neglected.
The derivative controller comes into the action for providing less oscillations and as well
as the predictive behavior for induction heater. When the work piece is inserted in the
coil, the error offers a large value so the derivative terms is large and hence the next
corresponding values are also large. This offers sustaining behavior to the system to bring
it.

40
Chapter 3 Implementation

Figure 3.14: PD controller

3.5 Obtaining the phase difference


To obtain the phase difference between two signals which our case are (i) inverter
voltage, (ii) tank capacitor voltage, we pass these signals on the terminals of an XOR
gate. The truth table of XOR gate is as follows:

Figure 3.15: XOR gate symbol and truth table

41
Chapter 3 Implementation

This shows that whenever the two signals are out of phase or at different voltage levels
the output of the XOR gate is high. It helps us to obtain the phase difference between
the signals. The XOR gate is implemented within the microcontroller with pins PA2 and
PA3 configured as input GPIO. The phase difference is obtained and timer 2 calculates
the pulse width.

REF input

Feedback

Output

Figure 3.16: XOR gate on square signal


The resolution of the timer 2 is kept large so that phase difference can be calculated
accurately. We can obtain a reference value of the phase difference with the help of a
signal generator. Set both the channels of the signal generate at the estimated resonant
frequency is 68KHZ, square wave. Add a phase difference of 90 degree between the
waves. Put the output on pins PA2 and PA3 of the microcontroller. The obtained value of
the variable ‘’ phase difference ‘’ is the reference that should be at 90 degree phase
difference between two signals.
The signals for the inverter is exactly the PWM signal while the tank capacitor voltage is
sinusoidal in nature. This is converted into square waveform by passing it through an
optocopler. On the output side, we obtain a square wave corresponding to the input
signal. Since we are not concerned with the amplitude of the signal so it does not pose
us a problem. We are only concerned with the zero crossing which remain preserved.
Using the obtain value of phase difference at 90 degree, we set the PD controller to
always look the phase difference at this value by changing the operating frequency of the
inverter.

42
Chapter 3 Implementation

3.6 Problem with PD


The problem with PD controller comes at the sampling rate. Too quick a sampling, rate
poses a problem that the calculation with previous values has yet to be performed that
the update values come in sequence. The new value of operating frequency is being
implemented and at the same time, the new date for PID function gets passed. These
values are not truly accurate and might contain transients.
This problem is rectified by using another timer as timer 3 running at 1KHz which allows
the system to settle with the value of operating frequency passed by PID controller in the
previous sequence before taking on absurd values.

43
Chapter 3 Implementation

44

You might also like