Triac Simulation Using Proteus

Status
Not open for further replies.

the_balistic

Member level 2
Joined
Aug 30, 2008
Messages
43
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,288
Activity points
1,668
Hii Good Day,

I have problem designing circuit for controlling speed of AC motor. I used Phase Angle Firing Methode. I use Microcontroller (avr) for firing triac, but I got anomali result. Please check my design, (this simulation using proteus 7.2), I use AC signal with frequency 5 Hz and Vamp = 12V, but the output is wrong.





And here is my code please check : ( I use bascom avr as my compiler)



Code:
$regfile = "m16def.dat"
$crystal = 12000000
$baud = 9600                                                ' use baud rate
$hwstack = 32                                               ' default use 32 for the hardware stack
$swstack = 10                                               ' default use 10 for the SW stack
$framesize = 40


'==============================
' LCD inisialisation
' mode 4 bit
' Pin R/W ground just for write
'==============================
Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , E = Portb.1 , Rs = Portb.0
Config Lcd = 20 * 2
Cls
Cursor Off Noblink

'====================================
'Eksternal Interrupt 0 inisialisation
'For Detect Zero Crossing Signal
'====================================

On Int0 Start_timer0
Config Int0 = Falling

Dim Status As Bit
Dim Displaystatus As Bit


'====================================================================
' Timer 1 Inisialisation for Countdown Zero Crossing
' IT MEANS 1024/12000000(CRSYTAL) = 0.08ms
' so timer 1 will overflow every (0.08ms * 65535 = 5242.8 ms = 5.2s)
'=====================================================================
Config Timer1 = Timer , Prescale = 1024
Dim Nilaitimer1 As Integer
Dim Waktu As Single

Dim Z As String * 5
Config Porta.7 = Output
Triac Alias Porta.7

Config Portd.2 = Input
Ddrd.2 = 0



'==========================
' Main Program
'==========================
Main:

Locate 1 , 1
Lcd "Program Zero Cross"
Locate 2 , 1
Lcd "By Deny Bodat'z"
Reset Status

Enable Timer1
Enable Int0
Enable Interrupts

Cls

Do

   While Displaystatus = 0
   Wend
   Displaystatus = 0
   Waktu = Nilaitimer1 * 0.08
   Locate 1 , 1
   Lcd "Timer1: " ; Nilaitimer1
   Locate 2 , 1
   Z = Str(waktu)
   Z = Fusing(waktu , "#.##")
   Lcd "Time: " ; Z ; " ms"
Loop


'=============================
' External Interrupt 0 Vektor
'=============================
Start_timer0:
If Status = 0 Then
   Timer1 = 0
   Start Timer1
   While Pind.2 = 0
   Wend
   Waitms 25
   Set Triac
   Waitms 40
   Reset Triac
   Set Status
   Else
   Stop Timer1
   While Pind.2 = 0
   Wend
   Waitms 25
   Set Triac
   Waitms 40
   Reset Triac
   Reset Status
   Nilaitimer1 = Timer1
   Displaystatus = 1
   End If
Return

End

have someone already simulated TRIAC using proteus , how about the ac signal result?

the result supposed to be like this :



Please help me? Thank You
 

I think your main problem is you are using an optocouples with Zero Crossing. Intead you must use a non zero crossing one, like MOC3052.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…