Count pulses at 300 Hz

For general Flowcode discussion that does not belong in the other sections.
Post Reply
S_T_Bozhkov
Posts: 1
http://meble-kuchenne.info.pl
Joined: Wed Oct 09, 2024 8:08 am

Count pulses at 300 Hz

Post by S_T_Bozhkov »

Hi colleagues,
I try to count pulses from the electric motor by using slotted opto sensor with 2mm to 4mm lead SKU LK6707L.
The pulses frequency is about 300 Hz on the scope. I have attached the program which have made. The issue is that the MIAC doesn't count correct at high motor speed as if omit much pulses.
Could you advice please.
Slavcho
Attachments
Couinter-2.fcfx
(8.7 KiB) Downloaded 94 times

medelec35
Matrix Staff
Posts: 2086
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 644 times
Been thanked: 702 times

Re: Count pulses at 300 Hz

Post by medelec35 »

Although Flowcode v7 is no longer supported, here are some suggestions, as it could be a hardware issue.
The Miac will have signalling conditioning circuity so long as the low signal level is less than 3V and the high signal level above 7.5V and current available for the interrupt is at least 100 uA .

There are factors to take into account. E.g. the higher the frequency of the pulses the more capacitance & inductance will have an effect on the waveform.
The reality is the waveform could be affected with frequency, e.g. the trough voltage could increase above the logic 0 detection of less than 3v
Or the upper voltage could be decreased to below the 7.5V threshold, so a lower pull up resistor might be required
You could try loading or buffering the waveform.
Other issue is the pulses could be too fast for the conditioning circuitry or there is a
Nyquist effect or similar where the pulses are correctly updating the variable, but the display of the variable (which is a lot slower in the main loop) is making it appear to count wrong.
You could use a scope on the waveform and see if it is within Miac’s parameters?
Martin

S_T_Bozhkov
Posts: 1
Joined: Wed Oct 09, 2024 8:08 am

Re: Count pulses at 300 Hz

Post by S_T_Bozhkov »

Thank a lot, Martin.
Here I have attached the modified project. Now everything work fine.
Slavcho
Attachments
Counter-3.fcfx
(14.27 KiB) Downloaded 82 times

Post Reply