Results 1 to 8 of 8

Thread: 3-ph sinewave generation using pwm in 89c51rd2

  1. #1
    Junior Member User
    Join Date
    Jul 2004
    Location
    Baroda
    Posts
    22

    Default 3-ph sinewave generation using pwm in 89c51rd2

    Hi all,
    Well i want to generate sinewave using pwm module in 89c51rd2.Could anyone help please.I know how to generate pwm but i am not able to generate a sine wave. I used fosc/4 for clk. and used to reload the new counter value and but i am not able to get required stepped sinewave on CRO. Plz help its urgent.

  2. #2
    Member Android
    Join Date
    Sep 2004
    Location
    Mumbai
    Posts
    77

    Default

    First write a routine that genetaes PWM. calculate sin(t) and pass it to the PWM routine. add some delay and pass the next sin(t) value. At the o/p pin connect a resistor and a capacitor in parallel with their other ends grounded, this would smoothen the waveform. Choose a small value for the capacitor.

    Alternatively, write a function which would generate a integer value between 0 and 255 corresponding to sine values -1 and 1. you may do this by adding an offset value of 1 to the result of sin(t) and then multiplying it by 127.
    write this value on the port.
    On the port make a R-2R Ladder network.

    You may also use 16 or more bits if you want a smoother curve.

  3. #3
    Member Advanced User
    Join Date
    Mar 2006
    Location
    mathura
    Posts
    40

    Default

    Hi,
    Alternatively what you can do is make a table of 64 values of PWM. You will be consuming 64 bits in it, and then use this table to make the sinusoidal PWMs. ACtually the 8051 is not godd at processing math routines, so better make a look up table. This way you will reduce the computation time and thus reduce the error in PWM.

    You can also apply the same approach if you are connecting an digital to analog converter. Please elaborate more on the application may be we can help you in a better way.

    Are you using it for an induction motor.

  4. #4
    Junior Member User
    Join Date
    Jul 2004
    Location
    Baroda
    Posts
    22

    Default

    Thanks Ihx and mittal
    I will try out the things that u have said. Uptill now i had written the routine to generate pwm, than at every pca register CL overflow i used to reload a new value to CCAP0H regs.corresponding to new duty cycle. Thus for a 50hz waveform i was able to get a 59samples for a quater of a cycle as clk increments were fosc/4 and the crystal is of 12Mhz.

    I have to run a 1hp induction for my project using pwm.I have already completed the driver circuit, but the pwm generation is not proper and i would like to know how would be waveform on the CRO.

    please help.
    -ankit

  5. #5
    Member Advanced User
    Join Date
    Mar 2006
    Location
    mathura
    Posts
    40

    Default

    Hi Boya,
    I tried to observe my sinusoidal PWM on a CRO, but if you will not be able to obseve the signal if you do not use a storage CRO. Try using a storage CRO and then magnify the signals.

  6. #6
    Junior Member User
    Join Date
    Jul 2004
    Location
    Baroda
    Posts
    22

    Default

    Thanks a lot guys. I was able to obtain the required sinusoidal waveform.

    -Ankit
    (boya)

  7. #7
    Member Advanced User
    Join Date
    Mar 2006
    Location
    mathura
    Posts
    40

    Default

    Hi,
    Please tell us what did you do, I ll love to hear about your work. It can surely give us inputs for our mistakes.

  8. #8
    Banned Newbie
    Join Date
    Apr 2016
    Location
    India
    Posts
    11

    Default

    You can generate any required voltage with proper filter circuits through modulating the width of a pulse in a period of the wave of a PWM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •