Page 1 of 3
homing a step/direction spindle
Posted:
Fri Jul 13, 2018 12:51 am
by Battwell
im going to try and fit an ac servo to the mill im converting. just waiting for a new taper lock pulley to arrive before i can do this.
my question is re homing the spindle.
can i use say the c axis with the same step and direction port pin numbers as the spindle step/direction to home it- and backoff to a set position (to index the spindle)?
or would i have to use a macro to enable the axis etc? - so they dont conflict.
i know its a weird feature- but im sure im not going to be the only one to require it.
or in a future release could spindle homing be added- same as other axis are handled? doesnt need to be on screen set.
or- am i over thinking it and theres an easy way? ive already exhausted the not real time detect and stop tests with the original analogue spindle.
Re: homing a step/direction spindle
Posted:
Fri Jul 13, 2018 12:56 am
by ger21
Maybe use SwapAxis in a macro before homing, then unswap?
Re: homing a step/direction spindle
Posted:
Fri Jul 13, 2018 6:23 am
by dezsoe
SwapAxis cannot swap the spindle with an axis. The spindle homing feature would be a nice thing, but now it's not implemented. What you can do is that in a macro you stop the cycle, change the configuration to see the spindle as an axis, press Apply (that is why you have to stop!), run homing for the spindle, revert the config changes, Apply again and finally restart cycle. It seems a bit extreme, but I think it works. In my M6 macro I call a self-made "pause" instead of M0, where I stop the cycle and wait for start to be pressed again, so I can move the axes and call M31 to measure the tool and continue the g-code. The only thing I'm afraid of is the length of the index signal, because homing needs an active home signal to stop and reverse the axis. I'm not sure how it would work, but if you want I can write the whole stuff to test it.
Re: homing a step/direction spindle
Posted:
Fri Jul 13, 2018 9:09 am
by dezsoe
I made a quick test and I could home the spindle to the index signal. (In fact, I have no spindle with step/dir control and encoder, but I have an emulator which I made for G33/G76 testing. It is a PIC12F683 that receives step/dir inputs and generates A, B and index outputs.)
Re: homing a step/direction spindle
Posted:
Fri Jul 13, 2018 9:16 am
by Battwell
I can use the original index sensor of the machine instead of the encoder index pulse. ( encoder is 19 bit so z pulse would be way too short))
Re: homing a step/direction spindle
Posted:
Fri Jul 13, 2018 10:03 am
by dezsoe
That's also good if it's in the right position.
Re: homing a step/direction spindle
Posted:
Fri Jul 13, 2018 10:56 am
by Battwell
the problem i have is the max frame size servo i can get into the casting space is 80mm.
the only servos i have in stock at that frame size are mitsubishi 750w.
(original dc servo was 750 watt)
annoyingly - mitsubishi dont have a position to encoder position function in their firmware- that ive found or used prior anyway.
so- it looks like im stuck with doing this in the control for the moment.
if you have already written the code- do you mind sharing it with me. will save me going through hours of checking the error log to see what ive coded wrong-!
Re: homing a step/direction spindle
Posted:
Fri Jul 13, 2018 11:26 am
by dezsoe
I haven't written any code yet, just tested the homing. I'll write and share it, but now I have another job. I hope, I'll be ready with it tomorrow. Just for understanding: do you need this stuff for starting a tool change while g-code is running?
Re: homing a step/direction spindle
Posted:
Fri Jul 13, 2018 11:39 am
by Battwell
i will need to do this at every tool change.
Re: homing a step/direction spindle
Posted:
Fri Jul 13, 2018 1:42 pm
by dezsoe
Terry's right! I've just tried it and it works. I didn't think that two set of settings on the same pins are not conflicting. Use it carefully, because the step and dir signals mess up if the spindle is rotating and the axis is moving in the same time!
- Code: Select all
M3 S400
G4 P3
G1 B10 F300
G4 P3
G0 B0
G4 P3
M5
M30