How to stop spindle 3 mm before end of the line ?
07 Aug 2014 21:22 #49578
by Woj123
Replied by Woj123 on topic How to stop spindle 3 mm before end of the line ?
Thank you for answers and help. I think distance to go would be a good solution but I don't know how to do that. I am using Linuxcnc since one week so understand me please. If anybady knows how to write such hal componet help me please
Thanks in adwance
wojtek
Thanks in adwance
wojtek
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5008
- Thank you received: 1441
07 Aug 2014 22:45 - 08 Aug 2014 20:09 #49580
by Todd Zuercher
Replied by Todd Zuercher on topic How to stop spindle 3 mm before end of the line ?
I think you would use comp (see man comp.9)
You will need to add things like this to your hal file .
This would send an on/off signal for any movement. You will need to add something to over ride it when you don't want it on (like positioning moves) or to enable it when you do want it on.
I still think that the velocity pin would be a better option because, with distance to go, if you have a complex shape or line (poly line) 100mm long made up of 2mm segments, your pump will never turn on. If you are sure you would never use code like that then it should work fine. Using the velocity pin the number and size of segments in a line would not matter. You would just need to calculate the best rate to shut off at. What are your feed and acceleration rates? Maybe your accel is to high to make a velocity shut off practical?
There may be a better way to do this though. How are the 3-d printer people doing it?
[Oops duh, forgot to count from 0 naming comp.N, changed 1 to 0]
You will need to add things like this to your hal file .
#load comp real time component to the servo thread
loadrt comp count=1
#set the value where your pump turns on and off
setp comp.0.in1 3.000
#connect the distance to go pin to the comp
net ink_off_float comp.0.in0 => motion.distance-to-go
#connect pin to your pump control output
net ink_off_bit (insert your pin name here) => comp.0.out
This would send an on/off signal for any movement. You will need to add something to over ride it when you don't want it on (like positioning moves) or to enable it when you do want it on.
I still think that the velocity pin would be a better option because, with distance to go, if you have a complex shape or line (poly line) 100mm long made up of 2mm segments, your pump will never turn on. If you are sure you would never use code like that then it should work fine. Using the velocity pin the number and size of segments in a line would not matter. You would just need to calculate the best rate to shut off at. What are your feed and acceleration rates? Maybe your accel is to high to make a velocity shut off practical?
There may be a better way to do this though. How are the 3-d printer people doing it?
[Oops duh, forgot to count from 0 naming comp.N, changed 1 to 0]
Last edit: 08 Aug 2014 20:09 by Todd Zuercher. Reason: code mistake
The following user(s) said Thank You: Woj123
Please Log in or Create an account to join the conversation.
07 Aug 2014 23:34 #49582
by BigJohnT
Replied by BigJohnT on topic How to stop spindle 3 mm before end of the line ?
2.6 does have a mode pin now so you can tell if your in G1/2/3 I'm surprised to not see G0 in the list...
JT
JT
Please Log in or Create an account to join the conversation.
07 Aug 2014 23:38 - 07 Aug 2014 23:39 #49583
by PCW
Replied by PCW on topic How to stop spindle 3 mm before end of the line ?
The latest 3DP thing using machineikit seems to be "velocity extrusion"
which seems better for "painting" type applications
If there is significant lag in the "spindle", extruder, glue gun, whatever
it might be nice to delay the motion with a delay comp (n samples delay),
so the velocity can have a bit of lookahead
which seems better for "painting" type applications
If there is significant lag in the "spindle", extruder, glue gun, whatever
it might be nice to delay the motion with a delay comp (n samples delay),
so the velocity can have a bit of lookahead
Last edit: 07 Aug 2014 23:39 by PCW.
Please Log in or Create an account to join the conversation.
08 Aug 2014 03:24 - 08 Aug 2014 04:31 #49585
by Woj123
Replied by Woj123 on topic How to stop spindle 3 mm before end of the line ?
'comp.1.in1' not found
loadrt comp count=1
setp comp.1.in1 3.000
net ink_off_float comp.1.in0 => motion.distance-to-go
net ink_off_bit parport.0.pin-16-out => comp.1.out
loadrt comp count=1
setp comp.1.in1 3.000
net ink_off_float comp.1.in0 => motion.distance-to-go
net ink_off_bit parport.0.pin-16-out => comp.1.out
Last edit: 08 Aug 2014 04:31 by Woj123.
Please Log in or Create an account to join the conversation.
08 Aug 2014 04:41 #49588
by PCW
Replied by PCW on topic How to stop spindle 3 mm before end of the line ?
The first comp is comp.0
Please Log in or Create an account to join the conversation.
08 Aug 2014 05:35 - 08 Aug 2014 12:05 #49589
by Woj123
Replied by Woj123 on topic How to stop spindle 3 mm before end of the line ?
comp.1.in0 not found ,
Last edit: 08 Aug 2014 12:05 by Woj123.
Please Log in or Create an account to join the conversation.
08 Aug 2014 17:26 #49593
by BigJohnT
Replied by BigJohnT on topic How to stop spindle 3 mm before end of the line ?
When you load a component the first instance of the component is 0. The pin names are as in the following link.
linuxcnc.org/docs/html/man/man9/comp.9.html
comp.N.in0 float in Inverting input to the comparator
The N is the comp instance. the in0 is a pin name.
JT
linuxcnc.org/docs/html/man/man9/comp.9.html
comp.N.in0 float in Inverting input to the comparator
The N is the comp instance. the in0 is a pin name.
JT
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5008
- Thank you received: 1441
08 Aug 2014 20:28 #49597
by Todd Zuercher
Replied by Todd Zuercher on topic How to stop spindle 3 mm before end of the line ?
You will probably need to use the and2 component to combine the distance to go signal with your current pump on signal.
linuxcnc.org/docs/html/man/man9/and2.9.html
Connect the comp.1.out pin and what every you had connected to your parallel port output pin, to the two and2 inputs. Then connect the output from the and2 to the parallel port pin.
Then when ever you have the pump commanded on, and distance to go is greater than 3mm the pump would run. If either of those two conditions are not met the pump would be off.
(just don't pause the machine during a drawing move, I am pretty sure your pump will keep running, another argument for using the velocity pin)
linuxcnc.org/docs/html/man/man9/and2.9.html
Connect the comp.1.out pin and what every you had connected to your parallel port output pin, to the two and2 inputs. Then connect the output from the and2 to the parallel port pin.
Then when ever you have the pump commanded on, and distance to go is greater than 3mm the pump would run. If either of those two conditions are not met the pump would be off.
(just don't pause the machine during a drawing move, I am pretty sure your pump will keep running, another argument for using the velocity pin)
Please Log in or Create an account to join the conversation.
08 Aug 2014 20:50 #49598
by Woj123
Replied by Woj123 on topic How to stop spindle 3 mm before end of the line ?
Thanks a lot for help. I have change comp.1 into comp.0. Now there is : PIN parport.0.pin-16-out was al ready linked to signal 'spindle-on'
Please Log in or Create an account to join the conversation.
Time to create page: 0.093 seconds