how to make M7 (mist on) generate step pulses

More
01 Dec 2021 16:18 #228132 by mikeT
Thank you for your continued support Andy,
Success !!!!!!!!!!!!!
I had given up hope of doing this with software due to my limited software abilities.
However, adding the steplen and stepspace parameters fixed it.
Now I can run my peristaltic mist pump at a predefined speed at the press of the coolant mist button or M7 command.

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

Happy happy happy
Thanks again

Mike
The following user(s) said Thank You: tommylight

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

More
02 Dec 2021 15:18 #228192 by andypugh
I am slightly surprised it works with such short step-length.
Just to be on the safe side, try 5000 for both.
The following user(s) said Thank You: mikeT

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

More
02 Dec 2021 17:08 #228201 by tommylight
stepgen.N.steplen u32 rw

The length of the step pulses, in nanoseconds. Measured from rising edge to falling edge.

stepgen.N.stepspace u32 rw (step types 0 and 1 only) The minimum

space between step pulses, in nanoseconds. Measured from falling edge to rising edge. The actual time depends on the step rate and can be much longer. If stepspace is 0, then step can be asserted every period. This can be used in conjunction with hal_parport’s auto-resetting pins to output one step pulse per period. In this mode, steplen must be set for one period or less.
In the HAL file, those timings are supposed to be in periods, not nanoseconds, if the parallel port reset time is set. From the time of LinuxCNC2.5 i have only seen those two values as 1 and 0.
So if the reset time is 5000, steplen will be 5000.
Not sure what happens if there is no reset time, but from the above it seems it would revert to using nanoseconds.
The following user(s) said Thank You: mikeT

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

More
02 Dec 2021 21:59 - 02 Dec 2021 22:07 #228227 by mikeT
Interesting !

My HAL was created automatically by stepconfig.

The four linear mation axes all have steplen 1 and.stepspace 1. I simply copied that to stepgen .4.

I cannot see anything obvious to set the paraport reset time, it appears to be locked to the base period, However, all the axes have dirhold 2750 and dirsetup 2750. Could this be setting the pulse durations?

Mike
Last edit: 02 Dec 2021 22:07 by mikeT.

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

More
02 Dec 2021 22:43 #228234 by tommylight
No worries, it is working, and that is the important part.
The following user(s) said Thank You: mikeT

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

Time to create page: 0.073 seconds
Powered by Kunena Forum