1.0

1.0 | 1 rating Rate this file 1 Download (last 30 days) File Size: 1.46 KB File ID: #9366
image thumbnail

PWM Signal from SoundCard

by Michael Wunder

 

15 Dec 2005 (Updated 16 Dec 2005)

Create a pwm signal using a standard soundcard.

| Watch this File

File Information
Description

PWM Signals are used in a wide area of applications. Examples are a servos used for positioning in electromechanical control design (mechatronic). Here is a simple function that allows to create a pwm signal with a standard soundcard. Parameters are: pulsewidth and time between pulse-starts.

One restriction is that the approach allows duty cycles up to 50% only.

All you need is to add at the output of the soundcard is a resistor as load (1k) and a diode (1N4001). The image enclosed shows the output I got for:

>> PWMSound(1.5e-3,10e-3);

Required Products Data Acquisition Toolbox
MATLAB release MATLAB 7.1.0 (R14SP3)
Other requirements standard soundcard, should work on older releases
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
04 Apr 2007 Oscar Campo

You can obtain different duty cicles by adding this line after the "dat" definition:

dat=dat(1:ncycle);

19 Apr 2007 essalhi adil

pwm simulink

02 Jun 2008 oldokh tsendayush

i analsysis matlab sinmklif

06 Aug 2008 shanthanu chakravarthy  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
example Michael Wunder 22 Oct 2008 08:09:56
application Michael Wunder 22 Oct 2008 08:09:56
pwm soundcard positioning mechatronic Michael Wunder 22 Oct 2008 08:09:56

Contact us at files@mathworks.com