Digital Input

  • vre
  • Away
  • Platinum Member
  • Platinum Member
More
21 Apr 2025 14:07 - 21 Apr 2025 21:31 #326812 by vre
Digital Input was created by vre
If i have this in hal
#M66 Digital Inputs
net spindle-stoped motion.digital-in-03 mesa_input_pin
and this subroutine code
M66 P3 L3 Q4 ;Check for spindle stopped - wait up to 4 seconds for digital input 3 to turn on
o307 if [#5399 LT 0]
(abort, spindle not stopped)
o307 endif

How can change this code to check if spindle is stopped
if i have not set this pin
net spindle-stoped motion.digital-in-03 mesa_input_pin

In reality spindle is connected to mesa daughter card 7i33
and i want to check from subroutine code if it is stopped.
Last edit: 21 Apr 2025 21:31 by vre.

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

More
21 Apr 2025 17:12 #326819 by andypugh
Replied by andypugh on topic Digital Input
is "mesa-input-pin" just a placeholder?

I don't really understand the question. Are you wanting to not have the HAL entry for some reason?

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

  • vre
  • Away
  • Platinum Member
  • Platinum Member
More
21 Apr 2025 21:27 - 21 Apr 2025 21:29 #326840 by vre
Replied by vre on topic Digital Input
The code needs a digital input pin for stopped-spindle to work
because i do not have this stopped-spindle digital input how can check
in subroutine code if spindle is stopped ?

mesa_input_pin can be hm2_7i80.0.gpio.003.in
Last edit: 21 Apr 2025 21:29 by vre.

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

More
21 Apr 2025 22:47 #326847 by rodw
Replied by rodw on topic Digital Input
Probably what you need is spindle.0.at-speed but its true when running
Being a mesa card your pin probably has a matching .not signal otherwise, use the not component to invert the signal

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

  • vre
  • Away
  • Platinum Member
  • Platinum Member
More
21 Apr 2025 23:11 #326852 by vre
Replied by vre on topic Digital Input
So this code does the same thing?
(pwmgen.00 is the spindle pwmgen)
	o307 if [#<_hal[[pwmgen.00.enable]> GT 0]
		(abort, spindle not stopped)
	o307 endif

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

More
22 Apr 2025 14:55 #326895 by andypugh
Replied by andypugh on topic Digital Input
If you want to be sure that the spindle is actually stopped, then use something like a HAL "wcomp" to provide a "true" signal when the spindle encoder velocity is very close to zero.

linuxcnc.org/docs/stable/html/man/man9/wcomp.9.html

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

Time to create page: 0.268 seconds
Powered by Kunena Forum