spindle index with inductive sensor - interference
- scda
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 20
- Thank you received: 2
25 Jun 2023 08:48 - 25 Jun 2023 08:56 #274195
by scda
spindle index with inductive sensor - interference was created by scda
Hi all.
I am currently retrofitting a small OZAKI cnc lathe. Most of the work is done. One thing I added is the ability to do spindle orient (for simple drilling operations --> making flanges and stuff). I have a magnetic ring encoder system for A+/A- B+/B- signals directly at the spindle shaft. This works fine.
But I need to have an index signal as well. I added an inductive PNP sensor (5V capable) and added a 220Ohm resistor from the index input to GND (because the 7i85 encoder inputs seem to have pullups of 2200 ohms). I guess this is not optimal. Setting the encoder Z input to "TTL mode" with the jumper.
The problem I have is that about 30% of time, when I do a spindle orient, the index signal does not seem to be detected (index-enable stay ON). But the spindle still orients. I use talla83's latest spindle orient code (some minor modifications). I don't think this is a software related problem because with a mechanical encoder that I used for testing it worked fine evertime.
I think the problem is an electrical one but I am not sure. I used a transitor to get rid of the pulldown and invert the signal of the PNP sensor. This seemed to have improved it, but it is not completely gone. I will try optical switch.
A brake disc with a notch milled out is used to created the "index" for the index impulse (see pic) on sensor. Maybe the size of the notch is not optimal (round instead of square edges).
How do other people create the index impulse on a lathe (if not using an encoder with Z pulse)? Is an optical sensor better?
Maybe you have some ideas for me to try.
David
I am currently retrofitting a small OZAKI cnc lathe. Most of the work is done. One thing I added is the ability to do spindle orient (for simple drilling operations --> making flanges and stuff). I have a magnetic ring encoder system for A+/A- B+/B- signals directly at the spindle shaft. This works fine.
But I need to have an index signal as well. I added an inductive PNP sensor (5V capable) and added a 220Ohm resistor from the index input to GND (because the 7i85 encoder inputs seem to have pullups of 2200 ohms). I guess this is not optimal. Setting the encoder Z input to "TTL mode" with the jumper.
The problem I have is that about 30% of time, when I do a spindle orient, the index signal does not seem to be detected (index-enable stay ON). But the spindle still orients. I use talla83's latest spindle orient code (some minor modifications). I don't think this is a software related problem because with a mechanical encoder that I used for testing it worked fine evertime.
I think the problem is an electrical one but I am not sure. I used a transitor to get rid of the pulldown and invert the signal of the PNP sensor. This seemed to have improved it, but it is not completely gone. I will try optical switch.
A brake disc with a notch milled out is used to created the "index" for the index impulse (see pic) on sensor. Maybe the size of the notch is not optimal (round instead of square edges).
How do other people create the index impulse on a lathe (if not using an encoder with Z pulse)? Is an optical sensor better?
Maybe you have some ideas for me to try.
David
Last edit: 25 Jun 2023 08:56 by scda.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17897
- Thank you received: 4774
25 Jun 2023 14:01 #274199
by PCW
Replied by PCW on topic spindle index with inductive sensor - interference
If the index pulse is long enough to be detected and sufficient
swing (say > 3V when high and < 0.5V when low) to insure margin,
I would say this is a software issue.
Can you test the index manually?
("sets" the index enable signal and check that it's reliably cleared at the
index position when rotating the spindle by hand)
swing (say > 3V when high and < 0.5V when low) to insure margin,
I would say this is a software issue.
Can you test the index manually?
("sets" the index enable signal and check that it's reliably cleared at the
index position when rotating the spindle by hand)
The following user(s) said Thank You: scda
Please Log in or Create an account to join the conversation.
- scda
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 20
- Thank you received: 2
25 Jun 2023 16:49 - 25 Jun 2023 16:54 #274202
by scda
Replied by scda on topic spindle index with inductive sensor - interference
Hi pcw
Thanks. Yes I tested it, this it works fine. Even at higher RPM the index signal is properly reset when manually engaged. I think you are right that it is a software issue.
I added an optocoupler and now run the prox. switch with 24V to make it more "reliable". The problem persists. One thing that has an infliuence is the PID tuning. I lowered the P values and the orient runs correctly more often....
I am guessing it has something to do with the orient setup. I use the one from talla83 that does not use the orient component just the PID.
Also my current AB encoder has the wrong number of counts (160k cpr). The new one will have 2560 which should work ok. Currently the counting is wrong above the 200 rpm range so when starting the spindle orient, the PID probably thinks it is within the "no search for index" zone (within one rotation) und just does an orient.
Will keep testing with the new readhead with lower cps when it arrives here. The index signal seems ok this way.
But I will keep the optocoupler in there and run the sensor at 24V just to be sure.
I hope 2560 cpr can be detected properly with the 7i85 at 3500 rpm spindle speed. Around 150k counts per second at max rpm. Encoder sampling rate is around 2 Mhz i think?
Thanks. Yes I tested it, this it works fine. Even at higher RPM the index signal is properly reset when manually engaged. I think you are right that it is a software issue.
I added an optocoupler and now run the prox. switch with 24V to make it more "reliable". The problem persists. One thing that has an infliuence is the PID tuning. I lowered the P values and the orient runs correctly more often....
I am guessing it has something to do with the orient setup. I use the one from talla83 that does not use the orient component just the PID.
Also my current AB encoder has the wrong number of counts (160k cpr). The new one will have 2560 which should work ok. Currently the counting is wrong above the 200 rpm range so when starting the spindle orient, the PID probably thinks it is within the "no search for index" zone (within one rotation) und just does an orient.
Will keep testing with the new readhead with lower cps when it arrives here. The index signal seems ok this way.
But I will keep the optocoupler in there and run the sensor at 24V just to be sure.
I hope 2560 cpr can be detected properly with the 7i85 at 3500 rpm spindle speed. Around 150k counts per second at max rpm. Encoder sampling rate is around 2 Mhz i think?
Last edit: 25 Jun 2023 16:54 by scda.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17897
- Thank you received: 4774
25 Jun 2023 19:37 #274206
by PCW
Replied by PCW on topic spindle index with inductive sensor - interference
Yes ~2 MHz so 150KHz is nowhere near the limits even with the
encoder filter on.
encoder filter on.
Please Log in or Create an account to join the conversation.
- JPL
- Offline
- Platinum Member
Less
More
- Posts: 335
- Thank you received: 113
26 Jun 2023 05:44 - 26 Jun 2023 05:48 #274222
by JPL
I'm wondering if this could also be related to the rise/fall time of the specific sensor you are using as some are awfully 'slow'. Maybe it just can't catch-up at 'higher' rpm? Also, inductive sensor have a sensing range that can vary a lot from one model to another. I see that your notch is not very deep, (neither very wide) if it's not deep enough to be outside of the sensing range this could also cause this kind of issue.
This being said, I'm not an expert since I've chose to go with an optical switch instead. Specifically model OPB932W51Z. Some reasons for this specific choice are: Totem pole output (full swing from gnd to 5Vcc). Inverted output; since I'm spinning a 'tab' instead of a notched/drilled disk. It then connect directly to the encoder Z input (of a 7i77) without the need of anything else (pull-up/down resistor, capacitor, etc) Also, that thing is damn fast with a rise and fall time of 70ns. Main drawback: This is a very easy to destroy plastic little thing. YMMV
Replied by JPL on topic spindle index with inductive sensor - interference
...
A brake disc with a notch milled out is used to created the "index" for the index impulse (see pic) on sensor. Maybe the size of the notch is not optimal (round instead of square edges).
How do other people create the index impulse on a lathe (if not using an encoder with Z pulse)? Is an optical sensor better?
I'm wondering if this could also be related to the rise/fall time of the specific sensor you are using as some are awfully 'slow'. Maybe it just can't catch-up at 'higher' rpm? Also, inductive sensor have a sensing range that can vary a lot from one model to another. I see that your notch is not very deep, (neither very wide) if it's not deep enough to be outside of the sensing range this could also cause this kind of issue.
This being said, I'm not an expert since I've chose to go with an optical switch instead. Specifically model OPB932W51Z. Some reasons for this specific choice are: Totem pole output (full swing from gnd to 5Vcc). Inverted output; since I'm spinning a 'tab' instead of a notched/drilled disk. It then connect directly to the encoder Z input (of a 7i77) without the need of anything else (pull-up/down resistor, capacitor, etc) Also, that thing is damn fast with a rise and fall time of 70ns. Main drawback: This is a very easy to destroy plastic little thing. YMMV
Last edit: 26 Jun 2023 05:48 by JPL.
The following user(s) said Thank You: tommylight, scda
Please Log in or Create an account to join the conversation.
- scda
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 20
- Thank you received: 2
29 Jun 2023 20:06 #274469
by scda
Replied by scda on topic spindle index with inductive sensor - interference
Thanks tommy.
Yes I was thinking about the issue of speed. I made sure that the sensor was rated for higher switching frequency than the the spindle speed. I guess you are concerned that the actual moment when the metal is not in front of the sensor is too short... I didn't think about that.... Will have to check out the datasheet again.
I made the notch a bit bigger in the metal disc and also sqaured uf the edges but it has not made a difference.
Luckily I ordered two 5V optical sensor last week anyway. One of these will be mounted to the machine next time I'm in the shop. I'm interested to see if this makes a difference... Will report back.
Yes I was thinking about the issue of speed. I made sure that the sensor was rated for higher switching frequency than the the spindle speed. I guess you are concerned that the actual moment when the metal is not in front of the sensor is too short... I didn't think about that.... Will have to check out the datasheet again.
I made the notch a bit bigger in the metal disc and also sqaured uf the edges but it has not made a difference.
Luckily I ordered two 5V optical sensor last week anyway. One of these will be mounted to the machine next time I'm in the shop. I'm interested to see if this makes a difference... Will report back.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23558
- Thank you received: 4858
01 Jul 2023 10:26 #274579
by andypugh
Replied by andypugh on topic spindle index with inductive sensor - interference
Is it possible that the orient system logic is to blame, and it is setting index-enable twice?
I think it would be useful to Halscope the orient process to check.
TBH, if the orient works without the spindle trying to unwind thousands of turns, I would suspect that the encoder reset has happened properly, but for some reason the HAL logic has set the index-enable high again.
I think it would be useful to Halscope the orient process to check.
TBH, if the orient works without the spindle trying to unwind thousands of turns, I would suspect that the encoder reset has happened properly, but for some reason the HAL logic has set the index-enable high again.
Please Log in or Create an account to join the conversation.
- scda
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 20
- Thank you received: 2
14 Jul 2023 07:00 #275398
by scda
Replied by scda on topic spindle index with inductive sensor - interference
I think the problem is a mixture o both. I now installed a different readhead. Lower cpr, but too slow for higher rpm. I use an optical sensor for the index now. It seems to be much more precise. I like it. So far the problem has not come up again. But I will run it for a few hours this weekend to see if it happens again.
I think the problem before was, as mentioned, that the system was thinking it was close enough to not need to look for index. This might have happend because the system lost the counts at higher rpm during velocity mode (160k cpr encoder installed previously).
The current encoder readhead unforntunately is too slow so I need to replace the readhead again, Minimum edge seperation time is way to loo.
I think the problem before was, as mentioned, that the system was thinking it was close enough to not need to look for index. This might have happend because the system lost the counts at higher rpm during velocity mode (160k cpr encoder installed previously).
The current encoder readhead unforntunately is too slow so I need to replace the readhead again, Minimum edge seperation time is way to loo.
Please Log in or Create an account to join the conversation.
- scda
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 20
- Thank you received: 2
07 Aug 2023 07:41 - 07 Aug 2023 07:44 #277202
by scda
Replied by scda on topic spindle index with inductive sensor - interference
So I was able to install the correct readhead for the magnetic spindle encoder. Now the orientation works perfectly.
The optical index sensor is more precise than the inductive one from my expericence. I use a Panasonic sensor.PM-F45
Once the orientation is done, the system will apply a disc brake to keep the spindle locked. This works very well.
The optical index sensor is more precise than the inductive one from my expericence. I use a Panasonic sensor.PM-F45
Once the orientation is done, the system will apply a disc brake to keep the spindle locked. This works very well.
Last edit: 07 Aug 2023 07:44 by scda.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.067 seconds