6 HPWM signal generation with PIC18F4431


Results 1 to 23 of 23

Threaded View

  1. #11


    Did you find this post helpful? Yes | No

    Default Re: 6 HPWM signal generation with PIC18F4431

    Quote Originally Posted by HenrikOlsson View Post
    Hi,
    How about:
    Code:
    'PWM U phase calculation
    uduty=((sin(t)+128)*4)  
          
    'PWM V phase calculation
    vduty=((sin(t+85)+128)*4)
        
     'PWM W phase calculation
    wduty=((sin(t+170)+128)*4
    Attachment 5180

    It's true that you can't mutliply by 0.5 but you can divide by 2. You can also use the ** operator to multiply by units of 1/65536 so instead of doing x=y*0.72 you do x=y**47186 (where 47186 comes from 65536*0.72)

    /Henrik.
    Thanks a lot for your tips
    Just a question : what simulator are you using ? (because my ISIS Proteus gives me very weird results):



    It's your code with angle phase offsets...
    Last edited by pxidr84; - 19th February 2011 at 13:02.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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