Eliminate Hall Sensor Noise

hias9

1 kW
Joined
Jul 11, 2018
Messages
422
I have vibrations/stuttering at high phase amps at certain rpm ranges which vary with switching frequency.
This might be because of commutation errors caused by hall sensor noise.
When measuring the hall sensor output voltage while the motor is engaged (but not turning. Hall state is not changing between 0 and 1 here, it is constantly at 1 here.), the waveform looks like this:


I also tried it with capacitors in the 1-10nF range between +5V and GND and between hall output and GND, but it had no effect on the waveform.
The amplitude is much bigger than on another motor for example which already comes with capacitors.
How can I eliminate or significantly reduce this noise on the switching frequency? Does it matter if the capacitors are close to the hall sensors (like on the motor which already comes with capacitors) ?
 
Since the halls are open-collector, they ground the controller-supplied (via pullup resistor) voltage when they are active.

The controller should be looking for grounded signals to detect which halls are active. (if it is looking for ungrounded signals then the fix may be different).

The image doesn't provide a voltage or time scale, so you'll have to judge if the noise is such high amplitude that it drops all the way down to ground, or at least low enough for the controller to recognize it as a logic low instead of a high.

If that is what is happening, then the most likely cause is induced current from phase wires into the hall signal wires, within the cable from motor to controller. The simplest fix for that is to physically isolate the hall wiring from the phase wiring, for as much of the cable run as possible, separating them far enough away from each other to reduce the induced currents below acceptable limits.

If physical isolation is not possible, copper shielding around the hall wires within the length of the cable will reduce induced currents; ground this cable only at the controller end.

The capacitors I'd put at the controller end, because that's where the signal needs to be smoothed out. If the frequency the noise occurs at is constant, you can calculate the capacitor value as if it were an RC circuit with the pullup resistors (and any others in the circuit that matter), to make a low-pass filter to help negate the noise. If it's not a constant frequency this approach can still help if you put the RC frequency at one end of the band of frequencies, so it passes less of them thru.


If the problem is at logic low (rather than high), increasing the current of the signal itself will also help, but the halls usually can only sink a pretty small current, so you may not be able to do that. If they can handle it, you can change the dropping resistor to a lower value so current is higher; if the halls can't sink the current the logic low won't go as low in voltage. It won't change the logic high response, however, because that's all in the controller end.


If the noise you're seeing there is low amplitude, and is not dropping below the logic-low threshold of the controller inputs, then it should not be the cause of the problem. (whatever is causing the problem, if it is hall signal related, has to be causing incorrect triggering of the controller's signal inputs, and that can only happen if the noise goes above and/or below the threshold for logic low or high (when it should be the other state).


When you say the motor is engaged but not turning, what specifically do you mean? That you have locked the rotor to prevent spinning, but are applying significant current to it? Or something else? Need to know what's causing the noise; if it's induced current in the hall signal wires, or if it is some other artifact.

A troubleshooting step to eliminate the possibility of induced currents in the wires without doing sheilding/separation tests: Does it happen when simply connecting hall sensors to the motor controller, sensors that are not actually in the motor? With the hall wiring from the cable disconnected from the controller PCB (signals and power and ground), but the motor phase cabling still intact and running the motor?

If the problem still happens, it's not induced currents, but is noise actually within the controller PCB, possibly within the 5v supply to the pullups inside the controller.
 
Here is a little video: https://files.fm/u/ngq4xbax2
The frequency is the switching frequency of the controller.
In this video, some torque is commanded to the motor by slightly engaging the throttle, but I hold the bike with the brake so it's not turning and hall is not changing state.
The hall I am measuring is always enabled throughout the entire video.
 
hias9 said:
Here is a little video: https://files.fm/u/ngq4xbax2
The frequency is the switching frequency of the controller.
In this video, some torque is commanded to the motor by slightly engaging the throttle, but I hold the bike with the brake so it's not turning and hall is not changing state.
The hall I am measuring is always enabled throughout the entire video.

What's the 5V input look like?
 
hias9 said:
Here is a little video: https://files.fm/u/ngq4xbax2
The frequency is the switching frequency of the controller.
In this video, some torque is commanded to the motor by slightly engaging the throttle, but I hold the bike with the brake so it's not turning and hall is not changing state.
The hall I am measuring is always enabled throughout the entire video.

The video only raises more questions. If you will answer the specific questions previously posted, and test those things suggested, and then answer the questions in this post, it will help us understand your test setup and the specific problem.

By "enabled" do you mean activated by a magnet?

If so, it will be in grounded state, not near 5v. Near 5v is the deactivated state of an open-collector hall sensor.

If it is actually in a grounded state, then the problem is far worse.

Regarding the oscilloscope display, since you haven't stated how you have it setup, I have to make assumptions based on scopes I've used. If they are wrong, please describe exactly how you have it setup--if you don't, we can't know what is actually being displayed, which means we can't know what signal you are actualy seeing (whether it is tiny riding on the supploy, or huge beyond full scale of the supply, or something between).

It shows 5v on the bottom corner. If that is 5v / division, and the centerline with the arrow on the left edge is 0V, then the signal you are seeing is about 10v or more in swing from highest peak to lowest peak, and is about 12-13v nominal. This means that your pullups in the controller are not supplied by 5v, but probably 12v or 15v, which should be enough to increase the signal-to-noise ratio to help the controller read the signal under normal conditions.

But a swing of 10v is huge, and indicates a need for physical and/or electrical (shielding) isolation of the hall wires from the phase wires, as the currents in the phase wires are so high that they are inducing currents in other nearby wires (like the hall signals, and probably also in their power and ground wires, which will affect the actual hall operation).


If the hall should be in a grounded state, and it is reading 10v swings around a 12-13v level, either the hall has actually failed and is no longer able to ground the signal line when active, or else there is a high enough resistance between the point you're measuring and the hall itself that the voltage developed across that resistance by the induced currents from the motor phases is causing the problem.



If it is really this bad of a noise problem from phase-current induced currents in other wires, you may even want to isolate the phase wires from *each other* as they will induce currentsinto each other that might affect the controller's own monitoring of the phases, if it does any, and it's control of the motor.




Does the same kind of problem happen when letting the motor freely spin under a normal load (like when riding, or with a dyno-type load if you can set one up), as it does with a locked rotor like this?

Does the same kind of problem happen when the motor phases are disconnected from the controller and the same test is performed? (so that there is no current in the phase wires and thus no induced currents in the hall signal lines) If so, there is a problem inside the controller itself you would need to trace down, to find the source of the interference signal that is making it's way into the signal lines.

Same applies to using a hall sensor directly connected to the controller PCB with all of the hall signal wires removed from the PCB (as suggested in my previous reply).
 
My question is only how I could eliminate or significantly reduce this noise on the switching frequency.
We are not talking about induced currents from the phase wires here.
The problem with vibrations at some rpm ranges (switching frequency dependent) at high phase amps might be related with induced currents, but please ignore that. At the moment I only want find out how to eliminate or significantly reduce this noise on the switching frequency.
All halls are working fine. None of them is fauly.
The pictures and videos taken are with the throttle only slightly engaged, so phase currents are very small here.
I now took more videos with the voltage calibrated. Measuring between Hall A output and GND. Throttle slightly engaged, bike held in place by holding the brake lever (except in video 3). Hall supply voltage is 5V.
Video 1: Hall A in enabled state (grounded).
Video 2: Hall A in disabled state.
Video 3: Motor turning (very slowly)
Link to videos: https://files.fm/u/a88qvnun6

After this, I connected a new hall sensor externally instead of (internal motor hall sensor) Hall A for testing. The oscilloscope showed the same like when measuring motor's hall A output before.

Edit: I mixed up hall enabled and disabled. Hall enabled means grounded in this case.
 
Back
Top