homing a step/direction spindle

Post anything you want to discuss with others about the software.

Re: homing a step/direction spindle

Postby dezsoe » Fri Jul 13, 2018 1:42 pm

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
dezsoe
 
Posts: 576
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: homing a step/direction spindle

Postby dezsoe » Fri Jul 13, 2018 1:47 pm

After using the spindle as an axis the dir signal may remain in the opposite state, so again: be careful with shared pins!
dezsoe
 
Posts: 576
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: homing a step/direction spindle

Postby Battwell » Fri Jul 13, 2018 2:35 pm

cool- if it wont conflict- it should be easy.
just waiting for my new pulley- why is mechanical stuff always different sizes!
Uc300eth on router and mill
If they say it can't be done- I find a way!
Battwell
 
Posts: 387
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: homing a step/direction spindle

Postby Vmax549 » Fri Jul 13, 2018 3:10 pm

Just remember you have to be aware of teh posibilties of running teh spindle at top rpm then slamming it into reverse by calling the C axis into play while the spindle is running.

M3 S6000
code
code
G0 C-180
IF the C axis call reversed teh rotation direction then this would be a NONO without a M3/M5 safety in place.

M3 S6000
code
code
M5 ( Set the time delay to stop in config based on deacceration values at max rpm)
M6 ( macro contains teh Spindle index routine G28.1 C0 , G0 C45 )
M3 S6000 ( return to work with new tool )


What I did in the past with mach3 was to invoke a safety in teh M3 and M5 macros. When M3 was called it disabled the C axis and when the M5 was called it enabled the C axis again.

Just a thought, (;-) TP
Vmax549
 
Posts: 1384
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: homing a step/direction spindle

Postby dezsoe » Fri Jul 13, 2018 4:15 pm

That's good, but only for the half of the problem. The bad news is that both the spindle control and the axis control assumes that the dir pin is in the state it left before, so won't chage it until a direction change.
dezsoe
 
Posts: 576
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: homing a step/direction spindle

Postby Battwell » Fri Jul 13, 2018 6:06 pm

i can handle that in the macros. (both m3/m4 and position to index using c axis)
there is a zero speed output on the drive i can use as an input to check for
if i command m3 it should set + direction
if i command c+ number it should set direction etc
and vice versa.
homing should set homing direction etc ?

otherwise - i can switch the mode of the servo drive from speed to position using 1 output from uccnc
so the spindle would be run analog but its homing/ indexing would be run step/direction in position mode.
it wont swap modes unless at zero speed.

this may be a safer option. ?
something else to ponder while waiting for the new pulley to arrive
ive just set up the servo drive on old usb300. il try a few things over the weekend.
Uc300eth on router and mill
If they say it can't be done- I find a way!
Battwell
 
Posts: 387
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: homing a step/direction spindle

Postby dezsoe » Fri Jul 13, 2018 6:33 pm

Battwell wrote:if i command m3 it should set + direction
if i command c+ number it should set direction etc and vice versa.
homing should set homing direction etc ?

Yes, it should. But doesn't set it, because normally you never mix them. The program assumes that if it ran last time to dir+ and now you command dir+ again then it doesn't have to do anything with the dir output. In normal use it is true, but if you use the same pins once as a spindle output and once as axis output, both thinks that nothing bothered the pins. So, for example, M3 makes dir low, then G0 C... makes it high, after the G0 you command M3 and the dir pin will remain high, because the spindle controller program thinks that last time it set dir low, so nothing to do with that pin. I'm curious that with my method what will happen. :)
dezsoe
 
Posts: 576
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: homing a step/direction spindle

Postby Battwell » Fri Jul 13, 2018 6:52 pm

so. if i made a tiny move in the code in the opposite direction first- it should toggle to the correct moement direction
say i want c6
i command g91 c-0.0001 first
then g90 c6 and land me at c6
that should toggle it to correct direction.

or check the spindle direction led and reset it to as it was prior to positioning. ?

or. get balacz to add spindle homing and make it really easy for myself lol
Uc300eth on router and mill
If they say it can't be done- I find a way!
Battwell
 
Posts: 387
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: homing a step/direction spindle

Postby Vmax549 » Fri Jul 13, 2018 7:12 pm

HUM, I cannot see WHY uccnc would keep track of teh direction pin status over just issuing teh direction call each time.



That was never a problem in mach3 that I remember.

(;-) TP
Vmax549
 
Posts: 1384
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: homing a step/direction spindle

Postby Battwell » Sat Jul 14, 2018 11:34 am

[/quote]

Yes, it should. But doesn't set it, because normally you never mix them. The program assumes that if it ran last time to dir+ and now you command dir+ again then it doesn't have to do anything with the dir output. In normal use it is true, but if you use the same pins once as a spindle output and once as axis output, both thinks that nothing bothered the pins. So, for example, M3 makes dir low, then G0 C... makes it high, after the G0 you command M3 and the dir pin will remain high, because the spindle controller program thinks that last time it set dir low, so nothing to do with that pin. I'm curious that with my method what will happen. :)[/quote]

i just tested and if the spindle has been run ccw ( so i could see diagnostic led on) and then moves are made- with final move leaving the direction led off. ie last movement was cw motor rotation.
then i use m4 button it does in fact re set the direction of spindle correctly.

G1 c-10 F300
G4 P3
G1 c10 F300
g4p3
c-10
m4 S400
G4 P3
G0 c10
G4 P3
c-10
g4p3
c10
g4p3
c110
M5
M30
Uc300eth on router and mill
If they say it can't be done- I find a way!
Battwell
 
Posts: 387
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

PreviousNext

Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 8 guests