How to stop spindle 3 mm before end of the line ?

More
13 Aug 2014 22:28 #49820 by PCW
"Anything done in the HAL layer will have problems in some scenarios. It really can't see the future."

Well not quite, if you delay the motion commands (with a HAL delay comp) you can see "future" motion before the delay
and so look-ahead

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

More
13 Aug 2014 23:21 - 13 Aug 2014 23:23 #49823 by Woj123
PCW can you help me to write such component. I have no idea how to do that

thanks in advance
W
Last edit: 13 Aug 2014 23:23 by Woj123.

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

More
14 Aug 2014 00:24 #49826 by PCW
I'm not good at component writing but basically a delay component
would have a circular buffer of N samples (N would be a parameter)

To avoid motion discontinuities at startup , the delay parameter would probably need to be adjusted by
a step per sample time so for example, the initial delay is always 0, and if you set the delay for 100 samples
(100 ms at 1 KHz servo thread) the delay would increase from 0 to 100 one step per sample
(basically following the input data in the buffer)

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

More
18 Aug 2014 15:13 #49991 by Nick
We have done exact task:
In two words, we've added path's length to Gcode in Gcodetools (CAM extension for Inkscape).
it was like
(path len XXX.XXXmm)
then we change it with the filter to

M64 P0 (to reset integ)
M68 E0 Q... (to set path length)
M65 P0 (to reset integ's reset)


then we net motion.current-vel with integ's input and put it's output to wcomp with motion.analog-out-00 with sum2 -3mm. Thus wcomp will turn the spindle off 3mm before the path end. But you have to use Gcodetools, or any other CAM that adds trajectory length into Gcode.
The following user(s) said Thank You: Woj123

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

More
06 Sep 2014 14:23 #50834 by Woj123
Hi All,
thanks to you I'm close to solve the problem. According to NICK's advice I am using inscape's Gecodetools to generate gcode. I replace (path len XXX.XXXmm) into M64 P0,M68E0Q( path length),M65 P0
and move it after G01 (Penetrate).
I did custom.hal to stop pump 3mm before end.It works but there is no delay at the start .I was tring to put G04 P.. after M65 but there is delay of the move ( pump starts when move is beginning). Is there any way to turn on the pump, than set delay , than start the movement of the machine.

Thanks for help
W
Attachments:

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

More
07 Sep 2014 13:13 #50873 by Nick
Try to use another M code to start the spindle. There are twotypes of codes synchronised with motion and not synchronised.
If you use synchronised then pin turns on at the time next motion starts. Use immediate M code. Some thing in M 64-67
The following user(s) said Thank You: Woj123

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

More
08 Sep 2014 20:05 #50945 by Woj123
I have tried M64, 65 66, 67 I have still the same problem. Pump is ON when G01 move starts. If I use G04 there is delay of the move ( pump is waiting for move ) Is there any way to set delay between pump-ON and move (G01)

Thanks
W

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

More
09 Sep 2014 15:06 - 09 Sep 2014 15:09 #50971 by Nick

M62 P- - turn on digital output synchronized with motion. The P- word specifies the digital output number.
M63 P- - turn off digital output synchronized with motion. The P- word specifies the digital output number.
M64 P- - turn on digital output immediately. The P- word specifies the digital output number.
M65 P- - turn off digital output immediately. The P- word specifies the digital output number.


So
M64 P0
G04 P3.0
G01 x10
Should work. Check it once again.

May be you define g4p3 instead of g4p3.0. In some cnc if you define integer P (with out dot) delay is in micro seconds. I am not sure about how it works in Linuxcnc.
Last edit: 09 Sep 2014 15:09 by Nick.

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

More
09 Sep 2014 19:38 #50975 by BigJohnT
M62/63 require you to move an axis by any amount however tiny, any axis even one you don't have!

JT

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

More
09 Sep 2014 20:34 #50977 by Woj123
M64 P0
M68 E0 Q323.36218
G4 P0.1
M65 P0
G4 P0.7
G01 X10
(part of my gcode - above I attached custom.hal and sample of gcode)

Spindle is turned on when move starts (G01 X10). G4 works fine I just thinking why pump is off before G04 ( pump is waiting for move)

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

Time to create page: 0.131 seconds
Powered by Kunena Forum