1 / 14

Pulse-Width Modulation (PWM)

Pulse-Width Modulation (PWM). Discussion 13.1 Example 35. Motor Driver Circuit. Solid-state relay. MOS FET Relays. G3VM-61B1. Motor – Generator Experiment. Using an AC Relay. Pulse-Width Modulation. Pulse-Width Modulation. pwm4.v. // Example 35a: PWM signal module pwm4(

lefty
Télécharger la présentation

Pulse-Width Modulation (PWM)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pulse-Width Modulation (PWM) Discussion 13.1 Example 35

  2. Motor Driver Circuit Solid-state relay

  3. MOS FET Relays G3VM-61B1

  4. Motor – Generator Experiment

  5. Using an AC Relay

  6. Pulse-Width Modulation

  7. Pulse-Width Modulation

  8. pwm4.v // Example 35a: PWM signal module pwm4( input wire clk, input wire clr, input wire [3:0] duty, input wire [3:0] period, output reg pwm ); reg [3:0] count; wire set, reset; // 4-bit counter always @(posedge clk or posedge clr) if(clr == 1) count <= 0; else if(count == period-1) count <= 0; else count <= count + 1;

  9. pwm4.v (cont.) assign set = ~| count; assign reset = (count == duty); always @(posedge clk) begin if(set == 1) pwm <= 1; if(reset == 1) pwm <= 0; end endmodule

  10. Controlling the Position of a Servo using PWM

  11. 4 MHz clock on PLDT-3 board 17-bit counter will count from 0 to 131,072 in 32.768 ms. To get a 20 ms period, set period = (20/32.768)*131072 = 80000 (13880 hex) duty = 6000 1770 hex duty = 4400 1130 hex duty = 7600 1DB0 hex

  12. // Example 35b: General PWM signal module pwmg #(parameter N = 17) (input wire clk, input wire clr, input wire [N-1:0] duty, input wire [N-1:0] period, output reg pwm ); reg [N-1:0] count; wire set, reset; // N-bit counter always @(posedge clk orposedge clr) if(clr == 1) count <= 0; else if(count == period-1) count <= 0; else count <= count + 1; pwmg.v

  13. pwmg.v (cont.) assign set = ~| count; assign reset = (count == duty); always @(posedge clk) begin if(set == 1) pwm <= 1; if(reset == 1) pwm <= 0; end endmodule

  14. Aldec Active-HDL Simulation

More Related