Magnetic encoder signal processing

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
Jarfi
Messages
384
Reaction score
12
I've been using DC motors with magnetic hall effect encoders on them to measure position control. It's basically a feedback servomotor system.

i've so far been feeding the signal into my microcontroller's interrupts. This has been causing some problems with my timers and program. Let's say the motor is going at 600RPM, that becomes 10 revolutions per second. Now if my accuracy is 600CPR, I will have around 6000 interrupts per second which is not exactly ideal as it disturbs my other processes.

I want to offload this to a simple counter. I know this exists but is it generally used or practical? I am thinking about a simple IC where the signals are taken and incremented at very high speeds, so I don't need to worry about interrupts or my microcontroller's speed. The output would then be a simple PWM encoding of my "count" that I can then convert into radians or degrees.

What is this kind of counter called, and is it generally used or a good idea? Or should I stick with making my microcontroller do the counting through interrupt. In the external counter method the microcontroller would only read the angle from the counter when it needs to through a digital input.

What I am looking for is mainly angular position, not angular velocity.

Thanks in advance
-Jarfi
 
Engineering news on Phys.org
Are the motor and its feedback pulses bi-directional? If bi-directional, what is the difference in the feedback for the two different directions of rotation? Are you using a quadrature encoder?

In any case, you might consider just using a 4060 counter IC, and only generate interrupts for one of the upper bit outputs. You could still bring all of the counter outputs into your uC so you can read the position if you want to, but this would offload the interrupts to some 2^x multiple that you choose when you pick one of the outputs for your interrupt input...

http://www.ti.com/lit/ds/symlink/cd4060b.pdf
 
  • Like
Likes   Reactions: Asymptotic
Many microcontrollers have hardware counters built-in to count incoming pulses and even interrupt on overflow/underflow. If the microcontroller you are presently using doesn't have this feature, perhaps consider changing to one that does.

Or here is a datasheet for a dual 16 bit counter: http://www.ti.com/lit/ds/symlink/sn74lv8154.pdf

There are many suppliers for counter ICs from 4 to 64 bits.
Try a Google search for: x bit counter IC; where 'x' is the number of bits you want.

Cheers,
Tom
 
  • Like
Likes   Reactions: berkeman