Gear cutting with HAL function
Of course, I already seen the video of Andy (hello andy) on youtube and I would like make the same thing
I precise that I'm a french user of emc2 and it's not easy for me to learn in english, but I'll try.
For information, currently I use the latest version of emc2.
I use 3 steppermotors in bipolar mode with 3 stepper drivers and a home made interface board for use the inputs / outputs on the // port. My interface board is simple, I use a chip buffer for protect step and dir pin, and I use uln2803 for protect the relay output.
ok so I have some questions, I make step by step and the more simple.
I would like begining to built an encoder for use with the spindle, I have at home some capacitive sensor and optical sensor I would like know if I can use this for test ? it's a very big sensor but if just for test.
Information about this sensors :
capacitive sensors
www.ifm.com/ifmus/web/dsfs!KI5082.html
and
one optoelectronic sensor (MA serie)
www.datasensor.co.uk/item-142.html
What I need to know for synchronise my spindle with a stepper motor by an encoder ?
Andy use 3 optical sensor and I would like know why use 3 sensor ?
Also, how I must determinate the resolution for the encoder ?
There exist a tutorial (with screenshot) for help me ?
Thank you
Please Log in or Create an account to join the conversation.
I would like begining to built an encoder for use with the spindle, I have at home some capacitive sensor and optical sensor I would like know if I can use this for test ? it's a very big sensor but if just for test.
I think that the sensors are both a bit too big. They will not notice encoder teeth that are small enough to be useful.
The optical sensor might have a small enough active area, but it has a 1mS switching time. even with only 50 teeth on the encoder wheel that limits the spindle speed to <600 rpm (it has to switch twice for each tooth)
> What I need to know for synchronise my spindle with a stepper motor by an encoder ?
That is fairly easy. You use HAL to wire the output of the encoder counter into the input of a step generator, through a scale function.
The HAL code to do that is here:
wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Hobbing
This page explains what the commands in that file do:
www.linuxcnc.org/docview/html/hal_intro_fr.html
and this describes the HAL encoder function:
www.linuxcnc.org/docview/html/hal_rtcomps_fr.html#sec:Codeur
Note that the HAL file listed on the Wiki does not include any of the "normal" HAL file things, such as setting up the other axes or loading the spindle encoder counter. All that is listed there is the extra hobbing stuff.
A typical spindle encoder uses 2 channels for quadrature and in index channel for alignement. This allows rigid tapping (threading holes with a tapping tool held rigidly in the spindle. Quadrature gives both angle and direction information, whereas a single channel only gives angle. If you look at my video, when I turn the spindle backwards and forwards the workholder turns backwards and forwards.Andy use 3 optical sensor and I would like know why use 3 sensor ?
You can almost certainly manage with only one sensor, and an encoder set to counter mode.
The higher the resolution the better. However you will be limited by the space around the spindle, the sensing diameter of your sensors, the speed of your sensors and the speed of the parallel port. (And the speed of your interface circuit)Also, how I must determinate the resolution for the encoder ?
don't expect to sample at much more than 10kHz through the parallel port.
Please Log in or Create an account to join the conversation.
I think that the sensors are both a bit too big. They will not notice encoder teeth that are small enough to be useful.
The optical sensor might have a small enough active area, but it has a 1mS switching time. even with only 50 teeth on the encoder wheel that limits the spindle speed to <600 rpm (it has to switch twice for each tooth)
when I speak about this sensors, it's just for test passing my hand in front, and check if the system works, not for use directly on the machine
can you explain how you calculate for that 50 teeth can make up to 600rpm on the spindle speed because I don't understand very well
What I need to know for synchronise my spindle with a stepper motor by an encoder ?
That is fairly easy. You use HAL to wire the output of the encoder counter into the input of a step generator, through a scale function.
you speak about step generator, it's for why you use a mesa 7i43 card ? The step generator are not made by the hal function ? In fact I believed that I can use directly the optical encoder on the input pin of my // port and that the software make all the work
I think I need to know what I really need for the hardware part.
Andy use 3 optical sensor and I would like know why use 3 sensor ?
A typical spindle encoder uses 2 channels for quadrature and in index channel for alignement. This allows rigid tapping (threading holes with a tapping tool held rigidly in the spindle. Quadrature gives both angle and direction information, whereas a single channel only gives angle. If you look at my video, when I turn the spindle backwards and forwards the workholder turns backwards and forwards.
You can almost certainly manage with only one sensor, and an encoder set to counter mode.
So if I resume, you use 3 sensor (2 sensor for the two direction and 1 sensor for counter) ?
Also, how I must determinate the resolution for the encoder ?
The higher the resolution the better. However you will be limited by the space around the spindle, the sensing diameter of your sensors, the speed of your sensors and the speed of the parallel port. (And the speed of your interface circuit)
don't expect to sample at much more than 10kHz through the parallel port.
it seem be difficult to know exactly what I need , for you what is the minimum ? what do you use ? and do you think that you current homemade encoder is enough for good hobbing or not ?
Please Log in or Create an account to join the conversation.
They should work fine for thatwhen I speak about this sensors, it's just for test passing my hand in front, and check if the system works, not for use directly on the machine
50 teeth = 100 edges.can you explain how you calculate for that 50 teeth can make up to 600rpm on the spindle speed because I don't understand very well
100 edges x 1mS = 0.1 seconds per rev = 600rpm.
By "Step generator" I mean: www.linuxcnc.org/docview/html/hal_rtcomps_fr.html#sec:Stepgen (It's all software)you speak about step generator, it's for why you use a mesa 7i43 card ? The step generator are not made by the hal function ? In fact I believed that I can use directly the optical encoder on the input pin of my // port and that the software make all the work
Not exactly. 2 sensors arranged so that one sees the middle of a gap or a tooth every time the other sees an edge. That allows the software to determine direction. If A sees a rising edge and B is a gap, then that indicates that the wheel is turning the opposite direction to if A sees a falling edge when B is in a gap. en.wikipedia.org/wiki/Rotary_encoderSo if I resume, you use 3 sensor (2 sensor for the two direction and 1 sensor for counter) ?
The index simply gives a once-per-rev alignment and is not used at all by the hobbing configuration.
Yes, it works well.do you think that you current homemade encoder is enough for good hobbing or not ?
Please Log in or Create an account to join the conversation.
a picture is worth a thousand words, if you are agree, can you send me some pictures in detail about your installation (encoder) I think it's more easy if I try to make the same model for understand and test it
but I can already test with my current big sensor, for do simple, what I must do for recognize the sensor in emc2 and test them ?
Please Log in or Create an account to join the conversation.
There must be a billion words in that Youtube video then.a picture is worth a thousand words, if you are agree, can you send me some pictures in detail about your installation (encoder) I think it's more easy if I try to make the same model for understand and test it
It's a disc, with slots in. That is all there is to it, I don't know what more I can tell you.
but I can already test with my current big sensor, for do simple, what I must do for recognize the sensor in emc2 and test them ?
Connect it to the parallel port, start EMC2, look in Machine->show hal configuration then select the "Watch" tab to see the pin change state when the sensor senses something.
Or, you could use Halmeter. Or Halscope. Or any of the other things that the web page links I keep posting for you explain.
Please Log in or Create an account to join the conversation.
darty367 wrote:
There must be a billion words in that Youtube video then.a picture is worth a thousand words, if you are agree, can you send me some pictures in detail about your installation (encoder) I think it's more easy if I try to make the same model for understand and test it
It's a disc, with slots in. That is all there is to it, I don't know what more I can tell you.
but I can already test with my current big sensor, for do simple, what I must do for recognize the sensor in emc2 and test them ?
Connect it to the parallel port, start EMC2, look in Machine->show hal configuration then select the "Watch" tab to see the pin change state when the sensor senses something.
Or, you could use Halmeter. Or Halscope. Or any of the other things that the web page links I keep posting for you explain.
I just mean that I don't understand how you calculate the minimum of teeth on your wheel encoder for have enough precision for hobbing because I don't understand how it's really works I mean, for me if your spindle move with x degree, your encoder can't move with exactly the same degree because it's depending of the resolution, so I don't see how the synchronism can be perfect and make good hobbing.
Please Log in or Create an account to join the conversation.
I mean, for me if your spindle move with x degree, your encoder can't move with exactly the same degree because it's depending of the resolution, so I don't see how the synchronism can be perfect and make good hobbing.
The software in the "encoder" HAL module calculates an interpolated position based not only on how many teeth it has seen, but _when_ the last tooth was seen, and the spindle velocity. The stepgen module then sends pulses at the correct rate to stay exactly in synch.
Please Log in or Create an account to join the conversation.
for be more realist, the good thing to do is to use the maximum of teeth for maximum of resolution, but price are very expensive with very good resolution, I don't know how I can determinate a good number of teeth.
I just check about my sensor but I think it's not possible to use directly because, Voltage are minimum 10VCC
I try with connect pin with 5V but I don't see anything
I look in hal configuration > pin > stepgen > 0, 1 and 2 categorie and on watch categorie but nothing happen
Please Log in or Create an account to join the conversation.
Yes, you can even cut threads that way, though it isn't ideal.yes I had not thought, so in the principe, I can use encoder with just 2 position (half with a teeth and half with nothing) and interpolation can simulate the speed by rpm ?
You never would use it directly, if by that you mean just connecting straight to the parallel port. There should be documents on how to interface it to a TTL input.I just check about my sensor but I think it's not possible to use directly because, Voltage are minimum 10VCC
I try with connect pin with 5V but I don't see anything
hal configuration -> watch tab -> pins -> parport.0.pin-NN-in.I look in hal configuration > pin > stepgen > 0, 1 and 2 categorie and on watch categorie but nothing happen
The stepgen pins are outputs, of course you can't see your sensor there.
_please_ read that Introduction to HAL page. Here is the link to the French docs, again.
www.linuxcnc.org/docview/html/hal_intro_fr.html
www.linuxcnc.org/docview/html/hal_basic_hal_fr.html
Please Log in or Create an account to join the conversation.