The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Matlab Code
Posted by: d | April 17, 2010 @ 3:07pm
Matlab Code
[
Download
]
% Space Vector Modulation Scheme % Daniel Amireh clc clear all % Input Parameters Vdc = 400; % DC Voltage Lf = 800e-6; % Inductance Cf = 400e-6; % Capacitance Lload = 2e-3; % Load Inductance Rload = 5; % Load Resistance f = 50; % Frequency w = 2 * pi * 50; % Angular Frequency Tz = 100e-6; % Sampling Time Vref = (2/3)*Vdc; % Reference Voltage % Generation and plotting of PWM for i=1:600 if i>=300 && i<=600 v0(i)=1 else v0(i)=0 end if i<=100 || i>=400 v1(i)=1 else v1(i)=0 end if i<=200 || i>=500 v2(i)=1 else v2(i)=0 end if i>=100 && i<=200 || i>=300 && i<=400 || i>=500 v3(i)=1 else v3(i)=0 end if i>=100 && i<=400 v4(i)=1 else v4(i)=0 end if i>=200 && i<=500 v5(i)=1 else v5(i)=0 end if i<=100 || i>=200 && i<=300 || i>=400 && i<=500 v6(i)=1 else v6(i)=0 end if i<=300 v7(i)=1 else v7(i)=0 end end % plot results i=1:600 figure subplot(4,1,1) % subplot used to plot more than one graph on the same graph title('PWM siganls using SVM tehnique') %set title ylabel('V0') % set y-axis label grid on plot(i/600,v0) ylim([0 2]) subplot(4,1,2) ylabel('V1') grid on ylim([0 2]) plot(i/600,v1) subplot(4,1,3) ylabel('V2') grid on ylim([0 2]) plot(i/600,v2) subplot(4,1,4) ylabel('V3') grid on figure ylim([0 2]) plot(i/600,v3) subplot(4,1,1) plot(i/600,v4) ylabel('V4') grid on title('PWM siganls using SVM tehnique') ylim([0 2]) subplot(4,1,2) plot(i/600,v5) ylabel('V5') grid on ylim([0 2]) subplot(4,1,3) plot(i/600,v6) ylabel('V6') grid on ylim([0 2]) subplot(4,1,4) plot(i/600,v7) ylabel('V7') grid on ylim([0 2]) % line to line voltage plots VLAB, VLBC and VLCA figure subplot(3,1,1) t=.9:.001:1; f=400; V=300*sin(f*t) plot(t,V) grid on title('Line to line voltages') ylim([-400 400]) ylabel('VLAB') subplot(3,1,2) t=.9:.001:1; f=400; V=300*sin(f*t+120) plot(t,V) grid on ylim([-400 400]) ylabel('VLBC') subplot(3,1,3) t=.9:.001:1; f=400; V=300*sin(f*t+240) plot(t,V) grid on ylim([-400 400]) ylabel('VLCA') % Phase voltage plots VLAB, VLBC and VLCA figure subplot(3,1,1) t=.9:.001:1; f=400; V=300*sin(f*t)*2/3 % Phase voltage from line-to-line voltage plot(t,V) grid on title('Phase voltages') ylim([-400 400]) ylabel('VLAn') subplot(3,1,2) t=.9:.001:1; f=400; V=300*sin(f*t+120)*2/3 plot(t,V) grid on ylim([-400 400]) ylabel('VLBn') subplot(3,1,3) t=.9:.001:1; f=400; V=300*sin(f*t+240)*2/3 plot(t,V) grid on ylim([-400 400]) ylabel('VLCn')
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.35 / 8
48 Votes
http://codebin.yi.org/593
page generated in 0.00 seconds