Jump to content

Ric

Members
  • Content count

    4
  • Joined

  • Last visited

About Ric

  • Rank
    Newbie

Profile Information

  • Country
    United States
  • Are you University user?
    No
  1. Attached is a model that will allow you to adjust the phase lag between PWM1A and PWM2A on a F28069M launchpad. First generate code from the compound block entitled "PWM Phase Control" located in the "PWM with PhaseShiftv2.vsm" source model. Next, open the model "PWM with PhaseShiftv2-d.vsm", make sure the target interface block is pointing to the ".out" file you created in the first step, and run it. You will be able to adjust the duty cycle fraction as well as the phase angle fraction using the sliders. PWM with Phase Shiftv2.vsm PWM with Phase Shiftv2-d.vsm
  2. I want to create two pwm signals with the same duty cycle but one having a phase offset from the other
  3. Ric

    Implementing while and for loop

    Hi Nit, I'm attaching an example model that shows you one approach to creating a "For" loop and a "While" loop using Embed compound blocks. Ric While and For Loops.vsm
  4. Ric

    Discrete Transfer Function Problem

    Hi Joshep, You need to be careful when using discrete transfer functions. The values to the right of the decimal are very important, if you truncate them you can get significantly different results. I applied the "reg" signal created from the two "Bezier" blocks to three transfer functions; 1. The transfer function typed into this correspondance (red) 2. The transfer function from your .vsm model executed on a 64 bit computer (blue) 3. Same as 2. but executed on a 32 bit computer (green) On the traces below, you'll see how important it is not to truncate coefficients by comparing the red response with either the blue or green. The blue response is the correct response. If you had codegen'd the transfer function and run that code on a 32 bit microcontroller, you'd get the green response which clearly has some noise problems. I've also attached the model used to generate these responses. Ric ComparisonPlots.vsm
×