Spindle index

More
18 Jul 2017 17:40 #96010 by andypugh
andypugh replied the topic: Spindle index
So it does look like you have lost the A-phase.

I think you need to see if it is still electrically functional, and if it is then track the signal through the HAL (with halmeter) from the IO pin.
More
18 Jul 2017 17:53 #96013 by russkinch
russkinch replied the topic: Spindle index
Ok, I have made progress. So I changed a line in the ahl files, it was net spindle-index encoder.0.phase-Z and I changed it to net spindle-index encoder.0.phase-A and now I have a speed output, my motion.spindle-revs is increasing. The hal scope is seeing the index and has a nice square pitch. But, when I use the O word for metric threading that was on this forum, I write the program, it says all is good, it goes to Z0 where it starts the thread, and then just sits there......nothing at all, no movement from the z axis. I have lowered the speed etc, nothing. I did a small check and found the displayed RPM was different to the spindle-revs in the hal meter. maybe this is it??
More
18 Jul 2017 18:12 #96015 by andypugh
andypugh replied the topic: Spindle index
You need the index _and_ the A-phase for threading.
They can be the same thing, but you should have a 60-slot A and single-slot Z? (From reading back)

So put the index back like it was, and try to find where your A-phase input is getting lost.

Or attach the HAL, and we can try to figure it out for you.
More
18 Jul 2017 20:11 #96018 by russkinch
russkinch replied the topic: Spindle index
ok. when I am back at the workshop I will post the hal. Everything else works fantastic, just no threading which is the main reason for having a cnc lathe. My phase-a shows but rpms above 250 it drops to 0. I am sure its probably a simple setting somewhere. I really though that linuxcnc would of been kinda plug and play and just work out of the box. this lathe however has been a steep learning curve and not much has 'just worked'. all part of the fun though.
More
19 Jul 2017 08:52 #96037 by russkinch
russkinch replied the topic: Spindle index
Andy,

I am at work and this is mu current HAL file. It gives me an RPM readout on my display. The red / green spindle at speed LED works, but no threading. It goes to the start and hangs.
Attachments:
More
19 Jul 2017 09:19 #96039 by andypugh
andypugh replied the topic: Spindle index
This is the relevant portion of the HAL.
setp encoder.0.position-scale 1
setp encoder.0.counter-mode 1
net spindle-position encoder.0.position => motion.spindle-revs
net spindle-velocity-feedback-rps encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=> motion.spindle-index-enable
#net spindle-phase-a encoder.0.phase-A
#net spindle-phase-b encoder.0.phase-B
net spindle-index encoder.0.phase-A
...
net spindle-index   <= parport.0.pin-13-in-not
#net spindle-phase-a <= parport.0.pin-15-in-not

You need to un-comment some lines. You need to connect spindle-phase-a to the correct parport pin, and to the encoder phase-A, and you also need to connect the index to the correct parport pin and to the encoder phase-Z. Also, for a 60-slot wheel, your encoder scale is wrong.
linuxcnc.org/docs/2.7/html/man/man9/encoder.9.html
setp encoder.0.position-scale 60
...
net spindle-phase-a encoder.0.phase-A
net spindle-phase-b encoder.0.phase-B
net spindle-index encoder.0.phase-Z
...
net spindle-index   <= parport.0.pin-13-in-not
net spindle-phase-a <= parport.0.pin-15-in-not

(Maybe the parport pins are the wrong way round there?)
More
19 Jul 2017 11:46 #96046 by russkinch
russkinch replied the topic: Spindle index
So I changed it all back to standard. It works but RPM stops at 267RPM and goes back to 0, even with motor running at full RPM. I have tried swapping the input signals. Also the inverted box changing, but still no joy. In hal meter my spindle.position increase as i rotate chuck by hand. spindle.index changes from true to false but spindle.index.enabled stays at false. also i have no spindle.revs which i did befoe which increased by 1 each revolution of the chuck.
More
19 Jul 2017 11:51 #96048 by andypugh
andypugh replied the topic: Spindle index
Rather than just swapping things at random, set up everything in HAL as it should be, then look for why that doesn't work.

What is your [EMCMOT]BASE_PERIOD?

It looks like your opto-sensor or interface electronics might be too slow. Is there any chance to check the signals with an oscilloscope? A multimeter in frequency mode might work too.
More
19 Jul 2017 12:01 #96049 by russkinch
russkinch replied the topic: Spindle index
my base_period is 112436 (at bottom on stepconf). My sensor could be too slow. Its an ebay Infrared Slotted Speed Measuring Sensor Optocoupler(LM393) For Motor Test. Do you have any suggestions for an encoder / sensor?
More
19 Jul 2017 12:23 #96053 by andypugh
andypugh replied the topic: Spindle index
112436 is a somewhat longer than average.
But, that still should allow you to sense up to 2000 rpm with a 60-slot disc.

LM393 is normally an optocoupler, not a slotted sensor.
I guess you mean that it is one of these, with the LM393 acting as the interface?
www.ebay.co.uk/itm/262755532498

That has capacitors (filters) on the board that could well be limiting the pulse rate. But it would be good to be sure that was the case before attempting modifications or replacement.

I haven't used pre-mounted devices, I have always made up my own interface circuit. Something like
uk.rs-online.com/web/p/slotted-optical-switches/6666473/
looks ideal, it only needs a current-limiting resistor for the LED as an external component, and that could be used as the link between the 5V Vcc and the LED Anode.
Time to create page: 0.086 seconds
Powered by Kunena Forum