Fix pulse width, add and subtract frequencies

Thread Starter

Eshawn

Joined Oct 5, 2019
31
Thank you Dana for your through solutions.
I have to tell you that I have only basic knowledge of electronics and I looked at the problem which I mentioned at the beginning of this thread as a designer of what I have in mind. I would have to spend more time to continue with the solutions you offered because I would have to read more about them. But theoretically, I have implemented the solution using counters, dividers, full adder and subtractor which are clocked by crystal time base generator and I did not consider any possible issues such as latency. With my initial question I needed to know if it would be possible to implement the adding and subtracting of the frequencies directly on the frequencies themselves to simplify the circuit. Unfortunately I cannot follow up with micro-controller kind of solution now so I have to be satisfied with what I did.
But maybe you could tell me if my counter, divider .... solution could produce precise results or not with frequencies between lets say 1 and 200.
 

danadak

Joined Mar 10, 2018
4,057
Discrete method is fine, but inherent in this solution is need to
measure Fx and Fy which implies latency, no matter what you
do.

So there is no direct mapping of freq to sum/difference that
I am aware of. There is no physical instantaneous parameter
that predicts freq for processing, just a measurement process is
implied.

Regards, Dana.
 

Thread Starter

Eshawn

Joined Oct 5, 2019
31
Discrete method is fine, but inherent in this solution is need to
measure Fx and Fy which implies latency, no matter what you
do.

So there is no direct mapping of freq to sum/difference that
I am aware of. There is no physical instantaneous parameter
that predicts freq for processing, just a measurement process is
implied.

Regards, Dana.
 

Thread Starter

Eshawn

Joined Oct 5, 2019
31
I was having your initial question in mind when you had asked
‘Do you need this to be an instantaneous sum or difference, or can there
be latency to producing the correct result.’
But everything is good now.
Thank you
 

danadak

Joined Mar 10, 2018
4,057
I got curious so did an actual example project.

If you download PSOC Creator you can look at code, fairly simple, and rest of design.

The two DDS in the white box and LCD were used to generate test signals and LCD
for debug. Those can be eliminated in design to free up resources for using other stuff.

I did this in PSOC 5LP, it may fit in the lower end family, PSOC 4. Would have to try
that out.

Design could benefit from a little more coding, eg. eliminate a small dither in frequency
due to finite arithmetic used in DDS and counters.

Timebase Gate for counters is set at 100 mS, so resolution is 10 Hz..

As I stated before if needed output waveforms could easily be Sinusoidal if
needed by using the WaveDac onchip component. Although at ~ 200 Khz
thats a little high for onchip DAC oversampled by 32, 64 ......would have to
look at distortion.

upload_2019-10-14_16-2-41.png

Project archive can be supplied, as a cloud transfer if desired.


Regards, Dana.
 
Last edited:
Top