2. Power Electronics using Embedded System
Agenda
Day 1
Introduction to Proteus Mixed Simulation & PIC CCS C Compiler
Built-in Functions of PIC CCS C Compiler
Implementing ZCD Hardware Circuit in Proteus & Simulation
Zero Crossing Detection of AC Waveform using PIC Micro
Theory behind TRIAC based AC Motor Control
Circuit & Software Simulation in Proteus
Actual Hardware Implementation using 18F4620
Day 2
Theory behind Converter based DC Motor Control
Circuit & Software Simulation in Proteus
Actual Hardware Implementation using 18F4620
Question / Queries Session
3. Power Electronics using Embedded System
Introduction to Proteus Mixed Simulation
System Components
ISIS Schematic Capture - an easy to use yet extremely powerful tool for entering your
schematic designs.
ARES PCB Layout - high performance PCB design system with automatic component
placer, rip-up and retry auto-router and interactive design rule checking.
VSM - Virtual System Modeling lets you co-simulate embedded software
for popular micro-controllers alongside your hardware design
7. Power Electronics using Embedded System
PIC CCS C Compiler
Features of C programming
C is a portable language intended to have minimal modification when transferring
programs from one computer to another.
The main program flow will basically remain unchanged, while the various setup and
port/peripheral control will be micro specific.
An example of this is the port direction registers on a PIC micro MCU are set 1=Input
0=Output, whereas the H8 is 0=Input and 1=Output.
26. Power Electronics using Embedded System
PIC CCS C Compiler
Example of LED Blinking
#include "led_blinker.h"
#define LED PIN_C0
void main()
{
set_tris_c(0xfe);
while(1)
{
output_high(LED);
delay_ms(500);
output_low(LED);
delay_ms(500);
}
}
LED WILL BE ON & OFF ALTERNATELY WITH 500ms
INTERVAL
27. Power Electronics using Embedded System
PIC CCS C Compiler & Proteus Simulation
Example of LED Blinking
28. Power Electronics using Embedded System
PIC CCS C Compiler
NOW, ITS YOUR TASK TO REWRITE THE SAME
CODE WITH TOGGLE FUNCTION
TIME – WITHIN 10 MINUTES
HINT – USE FUNCTION
“output_toggle(pin)”
29. Power Electronics using Embedded System
PIC CCS C Compiler
ASSIGNMENT
GENARATE 1kHz SQUARE WAVE WITH
20% DUTY CYCLE
TIME – WITHIN 10 MINUTES
30. Power Electronics using Embedded System
PIC CCS C Compiler
ASSIGNMENT
WRITE PROGRAM TO IMPLEMENT THE
FOLLOWING LOGIC OPERATION
TIME – WITHIN 10 MINUTES
31. Power Electronics using Embedded System
Proteus Simulation
ASSIGNMENT – IMPLEMENT THE ZCD CIRCUIT BELOW AND STUDY THE
WAVE FORM AT PB0 AND JUNCTION OF R8 & R9
32. Power Electronics using Embedded System
TRIAC + MCU Based FAN Regulator
Zero Crossing Detector
33. Power Electronics using Embedded System
TRIAC + MCU Based FAN Regulator
TRIAC FIRING CIRCUIT
34. Power Electronics using Embedded System
TRIAC + MCU Based FAN Regulator
TRIAC FIRING CIRCUIT
35. Power Electronics using Embedded System
TRIAC + MCU Based FAN Regulator
ZCD DETECTION & TRIAC FIRING PULSE GENERATION
FIRING PULSE OUTPUT
ZCD PULSE INPUT
SPEED INCR SW
SPEED DECR SW
36. Power Electronics using Embedded System
TRIAC + MCU Based FAN Regulator
ZCD DETECTION & FIRING PULSE GENERATION PROGRAM
EXTERNAL INTERRUPT
37. Power Electronics using Embedded System
TRIAC + MCU Based FAN Regulator
SPEED INCREMENT / DECREMENT PROGRAM
INPUT SWITCH SACN
38. Power Electronics using Embedded System
TRIAC + MCU Based FAN Regulator
SPEED INCREMENT / DECREMENT PROGRAM
SPEED INCREMENT
39. Power Electronics using Embedded System
TRIAC + MCU Based FAN Regulator
SYSTEM INITIALIZATION PROGRAM
SYSTEM INITIATE
42. Power Electronics using Embedded System
FULL WAVE HALF CONVERTER
Controller Unit
Input ZC Signal to RB0
SCR Firing Pulses
Power Decrement Switch
Power Increment Switch
43. Power Electronics using Embedded System
ZCD DETECTION & FIRING PULSE GENERATION PROGRAM
EXTERNAL INTERRUPT
FULL WAVE HALF CONVERTER
Variable delay “dly”
44. Power Electronics using Embedded System
ZCD DETECTION & FIRING PULSE GENERATION PROGRAM
SWITCH SCAN
FULL WAVE HALF CONVERTER
Variable delay “dly”
45. Power Electronics using Embedded System
ZCD DETECTION & FIRING PULSE GENERATION PROGRAM
SYSTEM INIT & MAIN PROGRAM
FULL WAVE HALF CONVERTER