Measure Raw PWM Voltage Then Calculate % Duty Cycle?
I'm reading a raw PWM voltage signal using an analog input. Is there a way in Math to calculate the % duty cycle?
Customer Support Engineer
Please find attached example setup in which I use a few Math channels to calculate the percent of PWM signal. Creating the PWM signal changes manually with push button. Attached is also video how it works.
"trigger" formula is used to set the trigger signal where PWM pulse starts.
"rising_edge" formula remembers the time where PWM pulse starts.
"duty_cycle" and "period" formulas calculates elapsed time from rising edge of the PWM
"hold_duty_cycle" and "hold_period" holds values for calculating the percent of PWM.
"percent" channel only shows value when he PWM is one.
Please note that you should change the marked values according to the characteristics of your signa