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

More
09 Aug 2014 01:21 #49608 by Todd Zuercher
That is where the and2 comes in.

you need to loadrt the and2 (just like you did comp.)

net ink_off_bit and2.0.in0 => comp.1.out
(I don't know what your old signal names were change the signal names to suit your needs)
net spindle_signal and2.0.in1 => spindle-on

net pump_command parport.0.pin-16-out => and2.0.out

basically you find the line in your hal file that had the spindle-on and parport.0.pin-16-out pins, and replace the spindle-on with and2.0.out.
The following user(s) said Thank You: Woj123

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

More
10 Aug 2014 14:39 #49636 by Woj123
Todd Zuercher was absolutely right. Pump is stopping in every single element of polilline.My pomp is driven with a stepper motor and making shapes from resin on the glass.At the beginning of each line pump needs 0,5 to 0,9 s before cnc will run.At the end stepper motor runs the pump backwards a few steps before moving to a new line ( to suck a resin ) , and there is my problem – there is to much resin at the end of the lines, so somehow I shoul stop pump before end (about 3 mm). Mayby pin "motion.current-vel" is better way but I don’t know how to do that. (my speed of work is usually 2000-3000 mm/min, acceleration 500 mm/s). There is another question if ‘motion.current-vel" will stop pump at the beggining of the line ( till cnc will get our speed)? Considering all above I am asking you ( specially Todd Zuercher) to help me to use "motion.current-vel" pin.

Thanks for understending and help.
W

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

More
11 Aug 2014 03:14 - 11 Aug 2014 03:16 #49670 by Todd Zuercher
For some reason the math to calculate the exact number you need for the shut off velocity would be is escaping me. You could do a little trial and error testing to find the best setting (might need to do that anyway.)

Then then just replace motion.distance-to-go with motion.current-vel. Then change the number in setp comp.0.in1 to the velocity of your choice
Last edit: 11 Aug 2014 03:16 by Todd Zuercher.

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

More
11 Aug 2014 03:46 #49673 by Woj123
That is what I did but there is :"motion.current-vel." invalid for float, setp failed

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

More
11 Aug 2014 03:55 - 11 Aug 2014 12:37 #49674 by Woj123
loadrt comp count=1
setp comp.0.in1 2000
comp.0.in0 => motion.current-vel.


loadrt and2 count=1
net ink_off_bit and2.0.in0 => comp.0.out
net spindle-on <= and2.0.in1
net and2.0.out => parport.0.pin-16-out

That is what put into hal file

No all looks ok - there was no "net" before comp.0.in0

Can you kindly explain me what will be at beginning of the lines. Pump will be stoped till speed is 2000? In my case pump should start from the very beginning and stop about 2-3 mm to the end of each line

one more time many thanks for help
Last edit: 11 Aug 2014 12:37 by Woj123.

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

More
11 Aug 2014 20:26 #49693 by Todd Zuercher
It only takes your machine 3mm to go from 0-2000? I think that number probably needs to be much lower (probably more like 5, or 0.003). I am not sure what is up with the invalid float error. perhaps you need to add a decimal point.

As to getting it to turn on. I am not sure. Perhaps someone a little more clever with logic can offer a better solution. Do you also need to turn on the pump x amount of time before the start of your move or simultaneously?

Sounds like you need exactly what ever it is the 3-d printer people use.
The following user(s) said Thank You: Woj123

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

More
11 Aug 2014 20:55 #49694 by Woj123
yes my maschine is almost same like 3-d printer. At the beginning I need time about 0,5 s before cnc will starts.
So, first pump is starting than (after about 0,5 s) maschine. That I can make with g-code but not sure if using motion.current-vel pump will be stopped till maschine get set speed

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

More
11 Aug 2014 21:24 #49695 by PCW
One possibility is to have one of the linuxcnc component gurus to write a delay component.
Then you would wire the commanded position X,Y,Z to the delay inputs,
and drive your X,Y,Z stepgens from the delay outputs.
This would give you a programmable "lookahead" for the velocity channel, which has no delay.

A delay component is nothing more than a circular (ring) buffer with some mechanism for initialization

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

More
11 Aug 2014 22:59 #49703 by Todd Zuercher
This is getting a little complicated, (just idea forming here)

command your pump on in G-code (M64 P? or what ever you were using now)
0.5 sec delay (G4 P0.5)
movement code
falling edge from motion.current-vel see linuxcnc.org/docs/html/man/man9/edge.9.html
That and the output from M64 P? connected to linuxcnc.org/docs/html/man/man9/toggle2nist.9.html
the output from the toggle2nist turns the pump on/off.

You would have to specify the pump on at the beginning of each series moves.

The delay component sounds like a more elegant solution.

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

More
11 Aug 2014 23:46 #49709 by Woj123
that is to complicated for me :(

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

Time to create page: 0.124 seconds
Powered by Kunena Forum