Hall sensor jitter on dc motors - Page 1
Forum section: electronics / general

author: qpit3a
author_rank: Contributor
timestamp: November 12, 2021, 12:13:08 am
content: Hi,I have been attempting to use the hall sensors on a robot motor to keep the speeds of two motors in step. I am using interrupts on a KL25Z to determine the pulses and I have checked that I can measure frequencies way higher than the pulse rate would be. However my issue is that the signals from the sensors jitters and has high frequency noise (the high frequency noise might be causing my interrupts to trigger incorrectly I guess) . So my questions is if I pay enough money can I expect to be able to get clear motor speed readings, ie should I be able to control the speeds of two motors for a robot using the output of the hall sensors? Do I perhaps need to process the pules maybe a Schmitt trigger or something? Is there a recognized good brand of motors with sensors?Thanks for any help.

author: james_s
author_rank: Super Contributor
timestamp: November 12, 2021, 12:15:14 am
content: I would start by trying a low pass filter on the signal from the hall sensors. A very simple passive filter consisting of a resistor and a capacitor ought to do.

author: floobydust
author_rank: Super Contributor
timestamp: November 12, 2021, 04:04:36 am
content: Another issue can be the Hall sensors picking up the motor's PWM from their magnetic field. It will radiate some switching noise. You can try a shield (steel) on the back of the Hall or move it and its magnet somewhere else.It could also be the wiring to the Hall sensors, that must be kept far away from the motors' wiring. If there is a pullup resistor on the interrupt line, make sure it's not too high value. I would start with a 10-33nF cap to GND on the signal.It takes some time to figure out the source of the interference.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: November 12, 2021, 11:14:38 pm
content: Start by using an oscilloscope on your hall sensor signals.Maybe it's even "mechanical" such as an eccentric magnet disc or differences in the strength of the magnets.

author: David Hess
author_rank: Super Contributor
timestamp: November 13, 2021, 12:29:25 am
content: Hall sensor jitter should be insignificant compared to motor speed. Hall effect sensors are slow, but motors are even slower.

author: james_s
author_rank: Super Contributor
timestamp: November 13, 2021, 04:08:08 am
content: There are all kinds of other sources of glitches. Microcontroller interrupt pins are very fast and DC motors are notoriously noisy electrically speaking. It may not be the hall sensor at all that is causing the jitter, but noise being picked up by the wiring. Either way a low pass filter is a good place to start.

author: Power-Electronics
author_rank: Contributor
timestamp: November 13, 2021, 02:42:53 pm
content: Assuming that the Hall sensor has an open-collector output, did you connect a pull-up resistor?

author: qpit3a
author_rank: Contributor
timestamp: November 30, 2021, 08:26:03 pm
content: I didn't but will try that. One issue I have found is just the leads I am using are often bad connections, so moving them causes issues. I am going to make all the leads myself. Also using linear power supplies and 0.1uf across motor power helps.

author: Power-Electronics
author_rank: Contributor
timestamp: November 30, 2021, 09:20:04 pm
content: If the leads make that much of a difference, then wouldn't that suggest that the outputs are probably floating?

author: qpit3a
author_rank: Contributor
timestamp: January 24, 2022, 10:43:58 pm
content: Biggest problem was the type of level shifter being used. (even after putting pull up resistors on the hall outputs). Using a bi-directional TXB01008 one causes wierd stuff to occur. The simple ebay uni-directional shifter works ok.