I need some 4 pin encoder code for a 1000 line encoder.
Most of the code for RPM I have found online does not work.
I do have some Arduino code that "almost" works, but it is not accurate.
Ralph
toggle quoted message
Show quoted text
I have implemented several tachometers in software but haven't implemented an arduino tach. I have installed several of the $15-$20 tach (RC-41) modules which are very simple to install if you just need a quick RPM display. I've been using one on my lathe spindle for a few years. I recently added a feedback loop for the spindle VFD and noticed the module speed is off by maybe 10-20% under 100RPM but gets better at higher speeds.
Coding a tachometer can be a bit tricky if you require accuracy. It all depends on how many pulses you get per revolution and how fast it's spinning. One method is to count the period between tach pulses to calculate frequency/RPM. You use a timer interrupt that captures a high?resolution timer on the pulse. You need a little bit of logic to detect slow speeds which can wrap your timer. Usually you will low-pass filter these values to smooth out the RPM value. Some automotive tachometers/software use a multiple teeth system with?a missing tooth to provide multiple position and velocity estimates per revolution.
My lathe uses a 240 pulse per revolution disk (60 teeth with quadrature pulses) for threading. LinuxCNC supports missing tooth encoders so I could remove a tooth and get absolute positioning (within 1.5 degrees) The software provides an instantaneous RPM that I low pass filter before display so it doesn't jump around.
The lathe also has the RC-41 display with a 1 pulse per rev sensor that I used to set the spindle RPM when I was using a potentiometer to control the VFD.
Recently, I removed the pot and control the VFD with linuxCNC. This is when I noticed the RC-41 wasn't very accurate <100RPM.
On Fri, Feb 9, 2024 at 1:57?PM mike allen <
animal@...> wrote:
hey folks have any of ya made a tachometer using a Arduino ? I tried
some I found online but most of them seem to have something wrong with
the code? I'm not smart enough in the Arduino world to decipher the code
. What are you folks using ? I don't want to buy just a tachometer? from
China . I need to get one working in the Arduino platform for part of a
project I've got going .
thanks
animal
--
Clausing 8520, Craftsman 12x36 Lathe, 4x12 mini lathe, 14" Delta drill press, 40 watt laser, Consew brushless DC motors and a non working 3D printer