spindle hall effect sensor

This Section is for users to discuss hardware

spindle hall effect sensor

Postby dhanger » Thu Apr 08, 2021 6:30 pm

My mill was originally fitted with a hall effect sensor under the spindle, see attached image. It's not packaged into what I think of as a sensor, it has a few components soldered onto a small board, most notable a pair of transistors which lie underneath the magnet. Originally this was used to detect spindle speed and for tool change positioning. I connected 5V and made some measurements--when the magnet passes over each transistor the voltage from Out1 and Out2 successively drops to 0V, and each of the LED's lights.

My question is, can I utilize this sensor to interface with UCCNC to get the same original usage (spindle speed and ATC positioning)? Not knowing much about this I don't know whether it would connect directly to the spindle encoder inputs or if I would need some auxiliary component in between. Ideally I would also like to utilize this for rigid tapping; I never got a clear idea whether the OEM setup had rigid tapping or not.

Thanks,
Dan
Attachments
spindle hall effect.jpg
dhanger
 
Posts: 127
Joined: Thu Aug 29, 2019 1:57 pm

Re: spindle hall effect sensor

Postby eabrust » Fri Apr 09, 2021 1:30 am

Hey Dan,

What did this board get triggered by? A slotted disk with holes? A single 'tab' or magnet that indicates one per rev?

Given it has out1 and out2 with the hall effect sensors spaced so far apart, I'm guessing it gets triggered by a slotted disk, and behaves like a quadrature encoder. Out1/out2 should be able to be fed into your UC controller and setup in UCCNC as an encoder input. You'll need to know the number of slots to setup the 'encoder count' value.

If its a single indication per rev, you can probably use it for a speed signal, but won't be able to rigid tap with it.


regards
Eric
CraftyCNC: Plugins for UCCNC (and other neat stuff): http://www.craftycnc.com/plugins-for-uccnc/
eabrust
 
Posts: 351
Joined: Fri Sep 16, 2016 2:32 am
Location: Near Shirland IL, USA

Re: spindle hall effect sensor

Postby dezsoe » Fri Apr 09, 2021 6:03 am

Hello Dan,

Exactly as Eric wrote, plus you need an index signal too for tapping, the A and B is not enough to find out the position.
dezsoe
 
Posts: 2055
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: spindle hall effect sensor

Postby dhanger » Fri Apr 09, 2021 4:44 pm

Here's some more pix:

https://photos.app.goo.gl/KXteK5x9GhvLwKPT7

The OEM manual refers to it as a 'spindle hall effect board' (see attached). I know little about such things but Hall effect sensors that I've seen are single packages, not simple circuit boards like this. It consists of 2 transistors, 2 LED's, 1 capacitor and 4 resistors. I don't know if that qualifies as a real Hall effect sensor or not, but it is what it is. There is only a single magnet in the pulley facing the board (you can see 2 small set screws in the pulley that hold the magnet in), which passes over the 2 transistors. As the pulley turns CW the magnet passes over Q2 first and then Q1. As it passes each transistor 1 of the LED's lights and one of the output lines drops from 5V to 0V (I think that qualifies as an active low signal?). Where it goes from there I can't really determine; I have extensive wiring diagrams but not very good at interpreting them. Eric, from your description it doesn't sound like this qualifies as an 'encoder' for my purposes, hopefully you can confirm this or not. What I do know for sure is that when I first acquired the machine (before I tore out all the old electronics and modernized it) this sensor and whatever else is associated with it was used to 1) on initialization the spindle motor would come on for a short time to measure the signal to determine what belt position was selected for spindle speed purposes and 2) to accurately align the spindle to the ATC for tool changes. Kinda quirky, it's the only machine I've used that would operate the spindle on startup to match the spindle motor speed to the spindle itself.

Dan
Attachments
spindle hall effect board.PNG
dhanger
 
Posts: 127
Joined: Thu Aug 29, 2019 1:57 pm

Re: spindle hall effect sensor

Postby dezsoe » Fri Apr 09, 2021 9:38 pm

Those are not transistors but hall effect sensors. Two of the resistors are pull-ups and the other 2 are for current limiting for the LEDs. The capacitor is for filtering the power. These are good for the A and B signal if they provide a high enough resolution. Count one of the LEDs on/off cycle per spindle revolution.

You also need an index signal which you can build easy. Put a circular plate with only one hole in it on the spindle and an optical sensor to find the hole. This will give you one signal per revolution: that is the index.
dezsoe
 
Posts: 2055
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: spindle hall effect sensor

Postby dhanger » Sat Apr 10, 2021 5:52 pm

dezsoe wrote:Those are not transistors but hall effect sensors. Two of the resistors are pull-ups and the other 2 are for current limiting for the LEDs. The capacitor is for filtering the power. These are good for the A and B signal if they provide a high enough resolution. Count one of the LEDs on/off cycle per spindle revolution.

You also need an index signal which you can build easy. Put a circular plate with only one hole in it on the spindle and an optical sensor to find the hole. This will give you one signal per revolution: that is the index.


No wonder the manual calls it a Hall effect sensor board, those are Hall effect sensors, not transistors LOL.

I have done some reading on encoders but can't seem to relate it to what I have. Every encoder I read about has multiple PPR's (the default setup in UCCNC is 400) whereas this setup would only supply 1 PPR per channel--would I put 1 in the setup page? What is meant by 'high enough resolution'? What's really confusing me is the difference between having a single PPR with the Hall effect sensors and having a single index sensor. If an index channel can give me rigid tapping how is it any different from what the Hall effect sensors are supplying already? Somehow the OEM used this arrangement to align the spindle for ATC, so apparently the exact position can be gathered already. Sorry to be so dense, this is a whole new area of understanding for me.
dhanger
 
Posts: 127
Joined: Thu Aug 29, 2019 1:57 pm

Re: spindle hall effect sensor

Postby dezsoe » Sat Apr 10, 2021 6:43 pm

The A and B channels tell the program if the spindle is rotating, at what speed and in which direction. If you get only one signal per revolution then it can be an index, however, it's too few information for tapping, because the program cannot find out the position of the spindle at any time. Your original config could find out the direction, the speed and the position for the ATC, but it could not know the exact (see below how exact) position at any time.

Let's see a simple setup. You have a 400 PPR encoder. The 360° (1 revolution) is divided into 400 steps: the program can recognise and count 0.9° motions. It's good enough for tapping, OK, but where does it start? This is why you need the index signal which comes only once per revolution. It starts the counting of the steps, so the program can now know the exact (exact as the resolution, 0.9°now) position of the spindle, so it can synchronize the Z.

That's why I asked you to count the pulses per revolution. It is possible to have more magnets to make higher resolution, but I think, the original setup tried to position the spindle to have both hall sensors on to sign the ATC position. (I'm just guessing, I don't know your machine.)
dezsoe
 
Posts: 2055
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: spindle hall effect sensor

Postby dhanger » Mon Sep 05, 2022 5:24 pm

After more than a year I've finally got some time to play around with this and also doing a little reading up but I still have some gaps in my understanding.

So I wired up the Hall sensors to the UCSB board:

UCSB 5V to Hall sensor 5V input and UCSB I13 and I15 positive terminals
UCSB 0V to Hall sensor GND
Hall sensor 1 output to UCSB I13 negative terminal
Hall sensor 2 output to UCSB I15 negative terminal

On the spindle configuration screen if I use either I13 or I15 as an index pin I can get an index signal on the diagnostics screen as well as actual spindle speed showing on the spindle DRO, which was a nice accomplishment as until now I've had to rely on an external digital tachometer to get spindle speed readings. For reference the DRO reading compared to the digital tach is precisely the same at any spindle speed, so I am satisfied that my configuration so far is good.

I understand better now that the 2 Hall sensors are not adequate to use for rigid tapping so at some point I intend to fit a real encoder to the spindle and use one of the Hall sensors as an index pin. However, I wanted to experiment to further my understanding so I disabled the index pin and enabled I13 and I15 to the A and B encoder configuration and entered a value of '1' for PPR to see what I would get. Turning the spindle by hand over the sensors then gave me the A and B signal on the diagnostic screen. Until now it had been my understanding that having a signal on the A and B channels would also give me a spindle speed reading, but this is not the case, I do not get any speed reading on the DRO with this configuration.

So my question is, is the DRO spindle speed only available with the index pin configured? Or is it just not going to work that way using 1 PPR?

There is also a strange side effect having the A and B channels configured, related to MDI input of spindle speeds (Sxxx). If I MDI a new spindle speed, the spindle speed actually updates (confirmed by using the digital tach) but the spindle speed fields stay stuck at whatever previous spindle speed was in effect before I configured the encoder channels. If I use the spindle override, the override field then updates to the correct spindle speed but the programmed speed field still remains the old speed. Is this some bug or something I just don't understand?

Dan
dhanger
 
Posts: 127
Joined: Thu Aug 29, 2019 1:57 pm

Re: spindle hall effect sensor

Postby dhanger » Sat Sep 10, 2022 4:08 pm

I know this is pretty basic stuff for a lot of you but it would be nice if someone can help lead me out of my ignorance. 8-)

I have been able to answer a little more for myself but still not understanding everything. I read in several topics that UCCNC only uses the index pin for Sact if there is no encoder configured, but uses the A and B signals from the encoder even if there is an index pin configured. I also read that UCCNC reads the rising and falling edge on each signal so the PPR should be quadrupled, so I changed my PPR from '1' to '4' (as well as other multiples of 2) but I still get nothing, leading me to again conclude that using a single encoder signal (i.e. there is only one magnet on the spindle pulley to activate the Hall sensors) is not adequate for spindle speed signal. Is that correct?

And it's still a mystery to me why the DRO when using encoder A and B signals does not update the commanded (Sxxx) speed until I hit the speed override. Seems to me that no matter what I have configured in the encoder section should not cause this effect.

Dan

P.S. version 1.2113
dhanger
 
Posts: 127
Joined: Thu Aug 29, 2019 1:57 pm

Re: spindle hall effect sensor

Postby dhanger » Sat Sep 10, 2022 4:52 pm

I just now discovered the solution to all my issues. Just on a whim I tried unchecking 'use pulleys' and suddenly I was getting Sact readings and the commanded speed in MDI was updating properly. At first I didn't understand why I would have to uncheck using pulleys (as I am using it) until I looked at the pulleys config and saw under 'ratio' I had '0'. I changed it to '1' and all fell into place!
dhanger
 
Posts: 127
Joined: Thu Aug 29, 2019 1:57 pm


Return to Hardware

Who is online

Users browsing this forum: No registered users and 15 guests