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

More
12 Aug 2014 18:59 #49754 by Woj123
Can anybody check HAL file and tell me why motion.current-vel doesn't work
Pum is working as usually

File Attachment:

File Name: karwood.hal
File Size:3 KB



Thank you
W
Attachments:

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

More
12 Aug 2014 22:53 - 12 Aug 2014 22:57 #49766 by Todd Zuercher
I think your problem is on the lines where you have "net and2.0.out".
You may have missunderstood how the net command works.


net (signal name) (ouput pin name) => (input pin name)

Think of the signal name as the wire connecting the pins
The signal name is required for every net command and must come first.
You can have multiple net commands using the same signal name connecting the same output pin to multiple inputs.
and the little => and <= symbols are optional and have no real affect on what is happening (they are just for readability)

So
net spindle-on and2.0.out => parport.0.pin-16-out => some-other-pin-in
in this net command "spindle-on" is the signal name, "and2.0.out" is the ouput pin suppling the signal, and "parport.0.pin-16-out" and "some-other-pin-in" are recieving the signal.

The following 3 lines do exactly the same thing as the privious example
net spindle-on and2.0.out
net spindle-on parport.0.pin-16-out
net spindle-on some-other-pin-in

The different net lines using the same signal name do not have to be next to eachother or in any particular order, they don't even have to be in the same hal file. An important rule is that there can be only one output assigned to a signal name, but there can be as many inputs recieving it as you like.
Last edit: 12 Aug 2014 22:57 by Todd Zuercher.
The following user(s) said Thank You: Woj123

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

More
12 Aug 2014 23:13 #49767 by BigJohnT
It looks like you need to read the Basic HAL Tutorial page.

JT

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

More
12 Aug 2014 23:25 #49768 by Todd Zuercher
Attachments:
The following user(s) said Thank You: Woj123

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

More
13 Aug 2014 00:04 - 13 Aug 2014 19:56 #49771 by Woj123
Todd Zuercher I realy appreciate your help. Your hal file is OK . but there is one more problem.

1.pump starts
2.After G04 starts cnc maschine
3 than pump stops ( i think getting our parametr) - I need pump running
4. Cnc is going to the end of the line
5 Pump starts ( I think getting our factor) - I need pump to be stopped
6.End of the line


Thanks All for help and understand me please. I have never heard about linuxcnc before
Last edit: 13 Aug 2014 19:56 by Woj123.

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

More
13 Aug 2014 06:39 #49788 by andypugh
I have only just looked at this, but there may be a different way.
Create a new G-code which acts just like G1, except it splits the move into two G1 moves, one with "spindle" on, and one with it off.
(I was hoping that G1 could be remapped, but it looks like it would have to be G1.1 or something like that).
www.linuxcnc.org/docs/html/remap/structure.html

So, you would create a G1.1 which calls an ngc routine a bit like this:

In the INI file, section [RS274NGC]
REMAP=G1.1 argspec=xy modalgroup=5 ngc=extrude

Then create a G-code file called "extrude.ngc" that contains:
O<extrude> sub
#<dist> = 3
#<dx> = [#<x> - #<_x>]
#<dy> = [#<y> - #<_y>]
#<r> = SQRT[#<dx> * #<dx> + #<dy> * #<dy>]
;ATAN has a unique format
#<theta> = ATAN[#<dx>]/[#<dy>]
M3
O100 IF [#<hyp> GT #<dist>]
    G1 X[[#<_x> + [#<hyp> - #<dist>] * SIN[#<theta>]] Y[[#<_y> + [#<hyp> - #<dist>]]
    M5
    G1 X#<x> Y#<y>
O100 ELSE
    ;do a shorter version of the move here, or maybe just a normal move
    ;#<hyp> * 0.9 maybe? 
    G1 X#<x> Y#<y>
O100 ENDIF
O<extrude> ENDSUB
M2

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

More
13 Aug 2014 20:24 #49813 by Todd Zuercher
So are you saying

Todd Zuercher I realy appreciate your help. Your hal file is OK . but there is one more problem.

1.pump starts
2.After G04 starts cnc maschine
3 than pump stops ( i think getting our parametr)
4. Cnc is going to the end of the line
5 Pump starts ( I think getting our factor)


Thanks All for help and understand me please. I have never heard about linuxcnc before


So are you saying that the pump runs opposite of what we wanted, It run then shuts off for the majority of the line then turns off for the last little bit? Or is it mostly right but shutting off for the initial acceleration and is on for most of the move (a foreseen problem)?

Andy's idea is a novel one. Unfortunately I think it will have as many problems to overcome as this one.

I think the delay component would probably be the best solution, but I don't have the programming skills to write it.

Alternatively, this could all be done in the G-code fairly easily, if your cam program is flexible enough in its post creation. If you have a paid for cam program with decent technical support, ask them to write you a post that will do what your asking

If you give the pure g-code route a try, you might need to use M62/M63 to turn it on/off as I am not sure if M3/M5 are cue busters (stop movement). To make a 20mm line
G21 G91
M62 P1
G4 P5
G1 X17 M63 P1
G1 X3

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

More
13 Aug 2014 20:41 - 13 Aug 2014 20:45 #49814 by Woj123
That all I can do in CAM program. I have changed posprocesor so I can do :

1.Start pomp
2.delay of moving cnc

speed of tha pump and revers is runnig by another program

what I need, is to stop somehow pump before end of each line ( I think about 2-3 mm )
that is because at the end there is too much resin and that is looking not so nice ( even because of reverse of the pump )

motion.current-vel would be great if ignore first factor
Last edit: 13 Aug 2014 20:45 by Woj123.

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

More
13 Aug 2014 21:08 #49817 by andypugh

what I need, is to stop somehow pump before end of each line ( I think about 2-3 mm )


I do actually think that the way to do this is in CAM. Only in CAM do you know that the machine is approaching a stop.

It might be possible to make a filter that looks through the G-code, notes every point where the system is going to stop and splits the preceeding G1 move.

Anything done in the HAL layer will have problems in some scenarios. It really can't see the future.

Having said that...

Perhaps instead of looking at axis velocity you should look at axis acceleration.

Pass axis velocity through a ddt block, turn the "spindle" on for any positive or zero acceleration moves, turn it off for deceleration moves.

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

More
13 Aug 2014 22:05 #49819 by Woj123
to be honest I thought that will be much easier to do so. That is why I change mach to Linux. Anyway I do not regret my decision but all is new for me

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

Time to create page: 0.083 seconds
Powered by Kunena Forum