Gear cutting with HAL function

More
25 Mar 2011 14:07 - 25 Mar 2011 14:15 #8067 by darty367
Hello everyone, I'm a beginner of emc2 and I don't know yet very well about HAL function but I would like learn how make a gear cutting function. I'm come here for find some help.

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
Last edit: 25 Mar 2011 14:15 by darty367.

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 15:11 - 25 Mar 2011 15:11 #8070 by andypugh
darty367 wrote:

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.

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.

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.

Last edit: 25 Mar 2011 15:11 by andypugh.

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 16:27 - 25 Mar 2011 16:30 #8072 by darty367

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 :laugh:
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 :lol:
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 :unsure: , 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 ?
Last edit: 25 Mar 2011 16:30 by darty367.

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 17:18 #8074 by andypugh
darty367 wrote:

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 :laugh:

They should work fine for that

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

50 teeth = 100 edges.
100 edges x 1mS = 0.1 seconds per rev = 600rpm.

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

By "Step generator" I mean: www.linuxcnc.org/docview/html/hal_rtcomps_fr.html#sec:Stepgen (It's all software)

So if I resume, you use 3 sensor (2 sensor for the two direction and 1 sensor for counter) ?

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_encoder
The index simply gives a once-per-rev alignment and is not used at all by the hobbing configuration.

do you think that you current homemade encoder is enough for good hobbing or not ?

Yes, it works well.

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 19:44 #8078 by darty367
I'll try to make step by step.

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.

More
25 Mar 2011 19:55 #8079 by andypugh
darty367 wrote:

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

There must be a billion words in that Youtube video then.

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.

More
25 Mar 2011 20:16 - 25 Mar 2011 20:18 #8080 by darty367
andypugh wrote:

darty367 wrote:

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

There must be a billion words in that Youtube video then.

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 :blush: 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.
Last edit: 25 Mar 2011 20:18 by darty367.

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 20:40 #8081 by andypugh
darty367 wrote:

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.

More
25 Mar 2011 21:25 #8086 by darty367
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 ?
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.

More
25 Mar 2011 21:41 #8089 by andypugh
darty367 wrote:

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 ?

Yes, you can even cut threads that way, though it isn't ideal.

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

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 look in hal configuration > pin > stepgen > 0, 1 and 2 categorie and on watch categorie but nothing happen

hal configuration -> watch tab -> pins -> parport.0.pin-NN-in.
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.

Time to create page: 0.159 seconds
Powered by Kunena Forum