Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

3 hall-sensors-speed measurements

Status
Not open for further replies.

moro

Member level 3
Joined
Jul 12, 2009
Messages
65
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
2,013
3 hall sensors speed measurement

Hello,

i have a application where i use 3 sensors to measure the speed of a brushless motor.

The motor is a 3 phase bldc with 3 pole pairs, 3 hall sensors at 120 degree,

The speed measurement is done using a mux input timer, here all the 3 hall inputs are mixed.

Every time there is a change in one of the sensors state, the timer will report its count value, after which is reset.

My problem occurs when there is a change in load ( tried to squeeze with my finger the rotor shaft) and i noticed some false dropouts in values.

For 18 hall transitions i have 1 mechanical revolution.

How to overcome this false dropout when the rpm slightly changes?
 

Re: 3 hall sensors speed measurement

Hi,

I assume the values you see are the true RPM values.
But if you want to smooth the values ... just use a low pass filter or an averaging filter.

Klaus
 

Re: 3 hall sensors speed measurement

The term "false dropout" is a bit unclear. Are you talking about counting too few or too many pulses per revolution? Or something different?
 

Re: 3 hall sensors speed measurement

Hello,

this "false dropout" occurs only when there is a change in the rpm.

The value for rpm is fetched from the timer count report, so i am guessing if on a suddenly change in the count value... my math could be messed up.

So i was thinking to store the 18 "count reports", afterwards do a mean divided by 18, and the result should not "drop out" or overshoot? What do you think?
 

Re: 3 hall sensors speed measurement

Hi,

calculating the averaof of 18 values shoud give very stable and accurate readings, because all systematic errors canceled out.
Remaining a small bit of noise. Usually ignorable.

But if there really is a messed up timer reading, then find the casue of it ... instead of reducing it by averaging.

Klaus
 

Re: 3 hall sensors speed measurement

Hello,

i think the nature of this faulty behaviour is due to the pwm noise comming from the switching stage.

I have placed a osciloscope on all 3 hall sensor inputs, it seems the large noise spikes cause the timer interrupt to trigger more times than usual.

The comutation algorithm is safe checking this, so while the motor runs ok, the hall state changes too often.

The pwm switching frequency is 25khz


Do you know some common methods to eliminate the pwm noise? I wonder why i not placed a rc filter on each hall inputs....
 

Re: 3 hall sensors speed measurement

Hi,

Yes, an RC filter could help.

Some thoughts:
I wonder how the switching noise comes to the hall signals. Wrong wiring?
Filter: too low time constant will be ineffective in filtering. Too high time constant may be problematic with commutation timing.

I recommend to find the root of the problem. Where does the noise come from? Can you avoid this noise or reduce this noise?
It's usually the better way...to avoid problems than to cure problems.

Klaus
 

Re: 3 hall sensors speed measurement

Hello,

this project as a school boy is a bit more challenging than i anticipated, initialy i had some trouble with the current measurements

I remember some months ago i had trouble with current measurements, then FvM was wondering if my switching is correct.

After some time, i got a scope, and i was very curios why my motor waveform look diferent from the ones in the microchip AN857

AN857.PNG


So i found out my switching table sequence was a bit wrong.

After fixing it ,the waveform on the motor looks very normal for trapezoidal drive. Also after the fix i dont have large current spikes on the phases, at 10% i have les than 0.3Vpeak-peak current ( much lower than 2Vpp from the old design)


PWM on every phase
.pwm phase.jpg

Also the current on each phase looks normal, the only difference in the yellow channel is that i used different rc filter , but the phase of the signal is looks good
current.jpg



But returning to the pwm noise, i see i have this noise with me almost on every trace, even on the 3v3 line, i have some 50mVpp pwm noise

bellow is a simpliffied schematic drawn from the pcb layout with the main ground nodes, what do you think about the grounds?

ground.PNG

I am coming across a point where i think to use optical isolation drive for the FETs, and a galvanic isolated power source. Somehow my fear is that there is a capacities coupling between traces
 

Re: 3 hall sensors speed measurement

Hi,

Capacitors are dedicated to carry high ripple current while keeping ripple voltage low. This make them ideal to suppress voltage noise.

But your schematic contains not a single capacitor.

Thus I assume the shown schematic is not like your real circuit.
If so then it is useless for a discussion about noise. --> Please don´t post incomplete schematics. This just confuses those who want to help you and demotivate them.

Additionally the headline talks about hall signals. But your schematic doesn´t show any hall circuit. --> this again makes the schematic useless for this thread.
If you want to discuss about your power circuit, then start a new thread. I can move your post#8 to another thread if you like.

****
School project.
I don´t know what type of school this is. But PWM´d BLDC control with current measurement is a (too) big task for a school project.
For my taste there are too many pitfalls.
Designing the power stage for a BLDC should be enough.
Or designing the current mesurement circuit...
But both in one project is difficult, because the fast and high energy pulses of the power stage will result in trouble at the analog signals.

****

But that´s how it is...

Let´s focus on the hall signals in this thread.
Please post a complete schematic: power supply informations, power supply capacitors, hall sensors, signal filters, PLD.. and any other circuitry that is involved with the hall signals.
Additionallly I´d like to see a photo of your wiring with motor, power circuit (just to get a clue about influence to hall signals) and hall circuit.

Klaus
 

Re: 3 hall sensors speed measurement

The motor is a 3 phase bldc with 3 pole pairs, 3 hall sensors at 120 degree...

When you have three sensors symmetrically placed, one becomes just redundant: the information from the third sensor is simply the sum of the other two.

But that is not the cause of the present case.If the speed changes slowly and you do not see a smooth change in the count, please check the software.

If the rotor unlocks from the PWM sequence because of the overload, look for noise in the sensor signal (use a scope)
 

Re: 3 hall sensors speed measurement

Hi,

the information from the third sensor is simply the sum of the other two.
this is (almost, because negative) true for the currents.

But I assume the hall outputs are digital outputs.

Klaus
 

Re: 3 hall sensors speed measurement

Hello,


the hall outputs from the motor i think they are open drain, they require pull-up resistors

bellow i have attached the schematics.

The power supply is coming from a "laptop adapter type SMPS" +24V 8Amp

Bellow its a picture how the motor harness is conected to the pcb.

I will try to place a isolated power supply instead of U4 (7812) on the fet_drivers sheet, and see if there is any improvement

IMG_2640.jpg
 

Attachments

  • fet_drivers.PDF
    77.9 KB · Views: 94
  • mcu_board_F4.PDF
    100.8 KB · Views: 85

Re: 3 hall sensors speed measurement

Hi,

Photo: motor connections.
It seems you joined the power motor wires with the hall sensor wires. Don´t do this.
--> Take the three motor power wires and braid them. (most important)
--> Take all hall sensor involved wires and braid them sperately. Or put them in a tube or shrink tube.

Schematics:
* Don´t look that bad.
* I can´t find the pullups for the hall signals. They should be 3k3 or less and a capacitor of 10nF in parallel should suppress noise.

After the modifications ... please do a measurement of the hall signals directly at the micocontroller input.

Klaus
 

Re: 3 hall sensors speed measurement

Hello Klaus,

the pull-up resistors for the hall is done via a 5k6, and a 10k for pull down, this is acting also like a voltage divider to scale down the level from 5V to 3V3(mcu logic)

In the schematic on H1,H2,H3 there are no caps, so i have soldered 4.7nf on the pcb side to surpress the noise

i have splited the 3 wires for the phases, also twisted them

i have twisted also the wires for the hall signals


The result is the same.

Bellow you have one hall signal, the noise is very visible on 2V/division and 20ms time
DS1Z_QuickPrint1.png
 

Re: 3 hall sensors speed measurement

Hi,

the scope picture isn´t nice. There seems to be anpther problem.
While the HIGH voltages are within specification, then LOW voltages aren´t.

Please take a photo where I can see: hall cables, 5k6, 10k 4n7 and your scope connection (both GND and signal)

Klaus
 

Re: 3 hall sensors speed measurement

Hello Klaus,

in the first picture the ground clamp of the probe was somewhere in the corner of the pcb, all the previous measurments where done using that ground position

IMG_2644.jpg


Bellow you can see the pull resistors and the supresing cap, placed right at the entrance of the hall input, and hall ground wire ( marked on the PCB with " HALL GND")


IMG_2643.jpg

After noticing your remark, i rememberd about a old agilent/keysight document that the gnd wire of the probe can act like a "ringing source"

So i have moved the ground connection of the probe, right on the 4.7NF cap , as close as posible to the Hall sensor ground wire.

The result is bellow, the waveform looks much better

DS1Z_QuickPrint2.png


Now the big question i am facing, why is such a large ripple in the other side of the pcb,

This makes me worry, because on that side of the pcb i have all the microcontroler grounds and adc/opamp grounds
 

Re: 3 hall sensors speed measurement

Hi,

GND wiring is always problematic with high current switching applications.

But now the signals are OK. I don´t expect problems.

Thus i especially asked you:
please do a measurement of the hall signals directly at the micocontroller input.
But you connected it with a cable (which isn´t an improvement ;-) ) to the PCB input of the hall signals.

The capacitors should be small ceramics and located very close at the microcontroller pins to get best noise suppression performance.
****
This makes me worry, because on that side of the pcb i have all the microcontroler grounds and adc/opamp grounds
Your PCB GND is copper pour. Many small pieces of GND. This is by far not compareable to a solid GND plane.
The copper pour solution maybe looks "solid", bud indeed its just a net of GNDs connected with small inductances. An inductance is (relatively) high impedance for high frequency like the edges of the switching halfbridges. This high impedance multiplied with the high pulsed motor current results int high voltage noise.
This is what you see. Good experience you will never forget ;-)

***
Now next step:
Did you verify the RPM readings after the latest modifications? How are the results?

Klaus
 

Re: 3 hall sensors speed measurement

Hello Klaus,

the results are the same... if i measure the signal near the mcu pins, i still have noise because of the diferent grounds...

I will try to go for a 4 layer pcb, with a solid copper plane just for ground

It will take me some 2-3 weeks to come up with the new design, i will keep this updated

Thank you for your help
 

Re: 3 hall sensors speed measurement

Hi,

I think there is no need to go for a new PCB layout right now.

Connect the capacitors as close as possible to the microcontroller pins .. and the other side of the capacitors to the microcontroller_GND.
This should give clean enough signals to the microcontroller.

If the RPM errors still exist, then it´s most likely not a noise problem. Then it is very likely a software problem.

Klaus
 

Re: 3 hall sensors speed measurement

Hello Klaus,

in software i have placed a GPIO pin toggle when there is a hall state change, because of the spikes, i can see it toggles more than expected.

Unfortunately i cannot add a capacitor close to the mcu pins because of the nature of the pcb layout, the traces are very thin in that area ( < 0.25mm)

A new layout is not critical for me, i have enough time til June ...

Maybe some advice's or documents regarding the layout design would help

In the mean time here is the picture with the new layout in progress

The +V for the power stage will be on the top side, and the return -V for the power stage will be on the ground plane, which is shared with all the rest of the circuits

Any suggestions?

red - top layer
yellowish - ground plane
blue - bottom layer


top_bottom_gnd_plane.PNG

the withe-blue color is the layer where i have some power lines ( +5V for Hall, 3v3 for mcu/adc/opamp, and the hall signals)

top_middle_gnd.PNG

The pcb is stacked in the following order

top
+5/3v3/hall
ground plane
bottom
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top