09-23-2022 03:49 PM
My hardware configuration:
Block diagram:
My Arduino connection:
My signals
Obviously, you can see that these signals are not square waves and my PWM = 50% or 0.5.
How do I fix this?
09-23-2022 04:48 PM
You're not sampling fast enough, as per the Nyquist theorem, you need to sample at least twice faster as the maximum frequency of interest.
More over, you're sampling one sample for every duty-cycle which is not even a waveform.
09-23-2022 11:13 PM
So do you think maybe I should have two loops.
one loop that writes PWM at a slower rate (maybe 1000 ms) and another that reads PWM very fast (10 ms).
what do you think? Is that a good approach? What would be your suggestion?
09-24-2022 10:01 PM
Few inputs,
These should give you better looking representation of the PWM Generated but not the realistic one as Arduino's are not DAQ devices to sample at a high rate and stream with reliable timing accuracy to the PC.