when we are using PWM capture in speedgoat only duty cycle showing correctly remaining all showing wrong values in millions,how to capture correctly?

3 visualizaciones (últimos 30 días)
when we are using PWM capture in speedgoat only duty cycle showing correctly remaining all showing wrong values in millions...how to capture correctly. related files attached

Respuestas (1)

MULI
MULI el 3 de En. de 2025
Editada: MULI el 3 de En. de 2025
Hi @EV,
I understand that you are seeing very large values for the measured period and yet the duty cycle appears correct. This happens because the FPGA capture block is outputting raw clock ticks instead of real time (seconds).
The duty cycle looks fine because it’s just a ratio, but if you want the period in seconds, you must either enable time scaling in the block or manually convert ticks to seconds.
You can follow the below steps to resolve this:
  1. In the "Capture" tab of your Speedgoat PWM Capture block (e.g., IO397-50k), look for an option to output time (seconds or microseconds) instead of raw counts. If it’s available, turn it on.
  2. If there’s no built‐in time scaling, just pass the raw counts through a "Gain" block. Multiply by 1/(clock frequency) to get seconds.
  3. Make sure the capture block’s sample time and any triggering align with your main model.
Hope this helps!

Categorías

Más información sobre Electrical Block Libraries en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by