Tuesday, September 15, 2020

PLC set PWM duty cycle ladder diagram instruction

For any MCU with PWM peripheral inside, this instruction create a PWM signal output from a specific PWM pin created by its peripheral. The numbers of pin of any MCU are different. 

PLC set PWM duty cycle ladder diagram instruction
Set PWM Duty Cycle Instruction

Its property set the frequency, duty cycle etc.

PLC set PWM duty cycle ladder diagram instruction
PWM Set Duty Cycle Property

The Resolution could be:



  • 0-100% (maximum resolution 6.7 bits)
  • 0-256  (maximum resolution 8 bits)
  • 0-512  (maximum resolution 9 bits)
  • 0-1024 (maximum resolution 10 bits)
In this example, I use an input contact to turn on the PWM at 80% duty cycle.

PLC set PWM duty cycle ladder diagram instruction
PLC set PWM duty cycle ladder diagram instruction

Hardware testing is just made with a simulator.



PLC set PWM duty cycle ladder diagram instruction
Hardware simulation in Proteus

Click here to download the zip file of this example.


 

No comments:

Post a Comment

Labels

ADC (10) Analog (14) Arduino (12) Atmega16 (19) Audio (2) AVR (20) Charger (1) Cortex-M0 (1) Counter (10) CPLD (25) Digital I/O (22) Display (34) EEPROM (2) Environment Sensor (1) esp8266 (2) Experiment Board (10) I2C (4) Interrupt (7) LCD (1) LDmicro (29) measurement and instrumentation (7) Microchip Studio (3) MikroC (1) One-Shot (3) OpAmp (1) PCB (31) PIC16 Microcontrollers (16) PIC16F877A (2) PIC16F887 MikroC (22) PLC (35) PWM (11) Regulator (1) RTC (2) Sensor (8) Shift Registers (5) SPI (5) Timer (34) UART (2) ultra-sonic sensor (1) USB (1) VHDL (21) xc8 (1) XC95108 (9) XC9536 (15) XC9572 (1) Xilinx (23) Xilinx ISE (22)