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

10 views (last 30 days)
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

Answers (1)

MULI
MULI on 3 Jan 2025
Edited: MULI on 3 Jan 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!

Categories

Find more on Electrical Block Libraries in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!