Page 1 of 1
Count pulses at 300 Hz
Posted: Wed Oct 09, 2024 8:28 am
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
Re: Count pulses at 300 Hz
Posted: Thu Oct 10, 2024 11:38 am
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?
Re: Count pulses at 300 Hz
Posted: Mon Oct 14, 2024 8:36 pm
by S_T_Bozhkov
Thank a lot, Martin.
Here I have attached the modified project. Now everything work fine.
Slavcho