how to make M7 (mist on) generate step pulses

More
24 Nov 2021 17:23 #227513 by mikeT
Hello Andy
I modified my Hal as instructed by adding

loadrt stepgen step_ type=0,0,0,0,0 ctrl_type=p,p,p,p,v
setp stepgen.4.velocity-command 100

And all the other lines

When I try to launch LinuxCNC it get an error message .The debug says:
Parameter or pin " stepgen.4.velocity-command " not found.

Sounds like we are close but not quite there yet. Any ideas?

Thanks
Mike

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

More
26 Nov 2021 15:47 - 26 Nov 2021 15:58 #227659 by mikeT
Hello Andy,

I have attempted to add an additional stepgen to drive a peristaltic mist pump.

My HAL now includes these lines

loadrt stepgen step_ type=0,0,0,0,0 ctrl_type=p,p,p,p,v
setp stepgen.4.velocity-command 100

When I try to launch LinuxCNC it get an error message .The debug says:
              Parameter or pin " stepgen.4.velocity-command " not found.

What is that telling me? Has the loadrt line failed to set up the stepgen.4. pin correctly or is there somethng wrong with the "setp stepgen.4.velocity-command 100" line?

I realy would like to nail this.

Thanks

Mike
Last edit: 26 Nov 2021 15:58 by mikeT.

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

More
26 Nov 2021 16:36 #227662 by tommylight
Just bardging in, but try without "command" at the end of the line.
The following user(s) said Thank You: mikeT

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

More
26 Nov 2021 17:58 - 26 Nov 2021 20:51 #227666 by mikeT
Thanks Tommy.

Ye, tried that. Now when I try to launch LinuxCNC it get an error message .The debug says:
Parameter or pin " stepgen.4.velocity" not found.

That is what makes me suspicious of the first loadrt line

loadrt stepgen step_type=0,0,0,0,0 ctrl_type=p,p,p,p,v

Can anyone see anything wrong with this line?

The four existing stepgens are 'step' , only the new fifth stepgen is a velocity.

Gee, nuts and bolts are so much easier to see and fix.

Thanks

Mike
Last edit: 26 Nov 2021 20:51 by mikeT.

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

More
26 Nov 2021 21:52 #227691 by PCW
The velocity command is:

stepgen.4.velocity-cmd

You don't need to guess at this.

The pin name is in the stepgen manual page:

man stepgen

and also listable with halshow or halcmd:

halcmd show pin stepgen.4
The following user(s) said Thank You: tommylight, mikeT

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

More
27 Nov 2021 12:14 #227734 by mikeT
Thank you PCW, for your help and support.

Using 'stepgen.4.velocity-cmd 100' sorted out that problem.
Thank you also for pointing out the stepgen manual. lots of reference info but so much to try and learn.

My updated HAL now contains and loads without error messages

loadrt stepgen step_ type=0,0,0,0,0 ctrl_type=p,p,p,p,v
setp stepgen.4.velocity-cmd 100
net pump-on iocontrol.0.coolant mist => stepgen.4.enable

But when I add the final line sugested by Andy

net pump pulse stepgen.4.step parport.0.pin-14-out

I get the error message pin 'pulse' does not exist

Clearly there is still more setting up to do, but I am out of my depth again.

Thanks for all the support

Mike

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

More
27 Nov 2021 12:26 #227737 by chris@cnc
net pump pulse stepgen.4.step parport.0.pin-14-out
there is a space between pump and pulse. 
try 
net pump-pulse stepgen.4.step parport.0.pin-14-out
 
The following user(s) said Thank You: mikeT

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

More
27 Nov 2021 14:12 - 27 Nov 2021 14:33 #227745 by mikeT
Thank you Chris and everyone else who has contributed, It was my typo error.

My updated HAL now contains

loadrt stepgen step_ type=0,0,0,0,0 ctrl_type=p,p,p,p,v
setp stepgen.4.velocity-cmd 1
net pump-on iocontrol.0.coolant mist => stepgen.4.enable
net pump-pulse stepgen.4.step parport.0.pin-14-out

and loads without error messages

I have now reduced the stetgen.4. velocity to 1 pulse per second and would expect parport.0. pin 14 to give 5 volt pulses at 1 per second. unfortunately parport pin 14 remains at 0 volts.

Can anyone see whats wrong with how stepgen.4. connects to parport pin 14 when M7 or  'coolant mist' button is pressed. The 'coolant mist' button was set up with stepconfig and appears on the Axis screen

Thanks
Mike
Last edit: 27 Nov 2021 14:33 by mikeT.

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

More
29 Nov 2021 20:53 #227946 by mikeT
Thanks to the advice from Andy and others, I have got this far in getting M7 (coolant mist) to generate step pulses.

My HAL includes:
loadrt stepgen step_ type=0,0,0,0,0 ctrl_type=p,p,p,p,v
setp stepgen.4.velocity-cmd 1
net pump-on iocontrol.0.coolant mist => stepgen.4.enable
net pump-pulse stepgen.4.step parport.0.pin-14-out

I am reasonably confident about adding the new stepgen and setting the velocity correctly.
However, the last lines in which I attempt to use M7 or the 'coolant mist' button to send the velocity pulses to pin 14 of the parport, have prooved to be beyond my limited programming ability
That has forced me to abandon this attempt to modify the LinuxCNC software. I will need to consider other (hardware?) options to drive my peristaltic coolant mist pump.

Thanks again for all your help and support.

Mike

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

More
30 Nov 2021 22:24 #228076 by andypugh
You will generally not be able to see a step pulse with a multimeter, they will be very short, even at very low step rates.

In fact, did you even set the step pulse length? I forgot to mention that bit.
You can copy what the other stepgens have.
The following user(s) said Thank You: mikeT

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

Time to create page: 0.119 seconds
Powered by Kunena Forum