Emile666 / THD_Analyzer

Bob Cordell's THD-Analyzer, microcontroller based (STM8S105) and with relays (G6K-2Y-F)
4 stars 3 forks source link

PCB4: frequency measurement does not work well #3

Open Emile666 opened 3 months ago

Emile666 commented 3 months ago

The idea was to measure the actual frequency of the signal generator and to put that on the LCD-display. However it does not work well for small signals and is kind of an hassle to get to work for all output values. In the end I decided to skip the actual frequency measurement (both in HW and SW) and to just display the chosen frequency on the display. This will probably be implemented in V0.15.

bengtssk commented 3 months ago

Is it possible to make that change "board-compatible", i.e. only change the software, with the earlier version? Already built the PCB but haven't programmed the PIC yet. IAR requires a business email do be downloaded btw, haven't got the time to solve this yet.

Emile666 commented 3 months ago

Yes, SW updates will be backward compatible.

Sorry to hear about IAR, that used to be more flexible. It is very convenient to have a working uC, you can PM me, so we can have this sorted.

Emile666 commented 2 months ago

The frequency detection needs to be redesigned. It needs to work from 20 Hz-200kHz and from 5mV to 5V. I made a couple of LT-Spice simulations and came up with the following design. First the rectified signal is limited by D1 and D2 (for large signals) and then sufficiently amplified (>500x) for the transistor to switch. It works as specified and the output (at collector of Q1) is a 0-5V signal for the uC. It does need a new PCB4 revision, but I wanted to do that anyway. I am probably going to put the selected frequency on the LCD-display (the v0.15 option) and the measured frequency on the seven-segment display. Thanks to bengtssk for all the excellent ideas!

image