Magnetic encoder signal processing

Click For Summary
Using DC motors with magnetic hall effect encoders for position control can lead to excessive interrupts when high RPMs are involved, causing issues with timers and overall program performance. Offloading counting to a dedicated IC is suggested to manage high-speed signals without burdening the microcontroller. A 4060 counter IC is recommended for this purpose, allowing the microcontroller to read position data without handling all interrupts. Many microcontrollers also have built-in hardware counters that can simplify this process. The discussion emphasizes the importance of selecting the right method for accurate angular position measurement.
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 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 berkeman
I am trying to understand how transferring electric from the powerplant to my house is more effective using high voltage. The suggested explanation that the current is equal to the power supply divided by the voltage, and hence higher voltage leads to lower current and as a result to a lower power loss on the conductives is very confusing me. I know that the current is determined by the voltage and the resistance, and not by a power capability - which defines a limit to the allowable...

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
12K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
7
Views
12K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K