VMC related HAL questions.

More
02 Sep 2019 17:00 - 02 Sep 2019 17:15 #143903 by CNCDoc
Replied by CNCDoc on topic VMC related HAL questions.
Loaded tool 3. Pocket 4 on the tool changer and in programs.



Unable to get photocell for tool in holder to interrupt tool change sequence.:dry:
Attachments:
Last edit: 02 Sep 2019 17:15 by CNCDoc.

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

More
02 Sep 2019 17:30 #143908 by andypugh
Replied by andypugh on topic VMC related HAL questions.
Which pocket is tool 3 in in the tool table?
(typically you will have more tools than pockets, so there is a separate entry in the tool table for the pocket)
The following user(s) said Thank You: CNCDoc

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

More
02 Sep 2019 17:31 #143909 by andypugh
Replied by andypugh on topic VMC related HAL questions.
You can also use Halmeter to check if the state of motion.digital-in-nn changes when there is a tool in the spindle.

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

More
02 Sep 2019 17:53 #143915 by CNCDoc
Replied by CNCDoc on topic VMC related HAL questions.
Removed tool 0. Now it works. Motion.digital-in-05 changes when I have tool in the spindel.



Attachments:

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

More
03 Sep 2019 05:49 - 03 Sep 2019 08:03 #144048 by CNCDoc
Replied by CNCDoc on topic VMC related HAL questions.
Someone who understands why the step below doesn't alarm.
Have tried to replace P5 to P6 but no difference.
Tried L0 to L4 no alarm.

The sequence passes the step for the message "Checking MagPos 02" appear.
After "endif" does the program jump to M2?

(MSG, Checking MagPos 02)
M66 P5 L3 Q2 ; Check if mag pos is empty change to L0?
o103 if [#5399 EQ -1]
(MSG, Tool in Magazine! 03)
o103 endif



o<toolchange> sub

; only unload the tool if there is a tool in the spindle
; This assumes that the carousel is already aligned correctly. 
; It is important to unload the tool before shutting down the machine. 

	o900 IF [#<tool_in_spindle> EQ 0]
		(MSG, Dual orient)
		M19 R180 P1
		M19 R0 P1
	o900 ENDIF
	(MSG, orienting)
	M3 S1	;slow down spindle before orient
	G4 P3	;dwell
	M19 R0  ;align the spindle
	
o100 IF [#<tool_in_spindle> GT 0] ;If there is a tool in the spindle then unload
	(MSG, MovingToLowerTC-Pos 01)
    G53 G0 Z-88.6
	(MSG, Checking MagPos 02)
     M66 P5 L3 Q2 ; Check if mag pos is empty change to L0?
		o103 if [#5399 EQ -1]
		  (MSG, Tool in Magazine! 03)
		o103 endif
	(MSG, Moving arm 04)
    M64 P2 ; move arm in
	(MSG, Waiting for arm 05)
    M66 P2 L3 Q5 ; wait for arm-in = true
		o104 if [#5399 EQ -1]
			(abort, failed to move arm in 06)
		o104 endif
	G4 P1
	(MSG, Starting pump 07)
    M64 P3 ;Start Pump "release tool"
	G4 P1.5
	(MSG, Spindle air on 08)
    M64 P5 ;Spindle air on
	(MSG, Wating for toolrelease signal 09)
    M66 P3 L3 Q2 ; wait for tool-released = true
		o105 if [#5399 EQ -1]
			(abort, failed to release tool 10)
		o105 endif
	
	(MSG, Air off 12)
    M65 P5 ;Turn off Spindle Air
o100 ENDIF

	(MSG, Moving up 13)
    G53 G0 Z7
	(MSG, Pump off 11)
    M65 P3 ;Turn off Pump

o200 IF [#<selected_tool> GT 0]
	(MSG, Unlock car 14)
    M64 P1 ; unlock carousel
	(MSG, Wait for unlock 15)
    M66 P1 L4 Q2 ; wait for unlock "LOW signal"
		o106 if [#5399 EQ -1]
			(abort, failed to unlock carousel 16)
		o106 endif
	(MSG, starting car 17)
    M68 E0 Q#<selected_pocket> ; Start "hal file" set the carousel to move to the right pocket
    M64 P0 ; start carousel
    G4 P2
	(MSG, waiting for car 18)
    M66 P0 L3 Q20 ; wait for carousel finished
		o107 if [#5399 EQ -1]
			(abort, failed to align carousel 19)
		o107 endif
	(MSG, stopping car 20)
    M65 P0 ;stop carousel
	(MSG, locking car 21)
    M65 P1 ;lock carousel
	(MSG, waiting for lock 22)
	;G4 P5
    M66 P1 L3 Q5 ;wait for locked=true
		o108 if [#5399 EQ -1]
			(Abort, failed to lock carousel 23)
		o108 endif
	(MSG, move arm in if not already 24)
	

    M64 P2 ; move arm in (might already be in)
	(MSG, waiting for arm 25)
    M66 P2 L3 Q5 ; wait for arm-in = true
		o109 if [#5399 EQ -1]
			(abort, failed to move arm in 26)
		o109 endif
	M64 P3 ;OpenDrawbar
	M66 P3 L3 Q10 ; wait for tool-released = true
		o112 if [#5399 EQ -1]
			(abort, Failed to activate drawbar! 27)
		o112 endif
	(MSG, MovingDownForAirBlast 28)
	G53 G0 Z-80 ;prepForAirBlast
	(MSG, AirBlast ON 29)
	M64 P5 ;Spindle air on
	(MSG, moving down 30)
    G53 G0 Z-88.6 ;pick up the tool
	M65 P3 ;TurnOffPump
	(MSG, AirBlast OFF 31)
	M65 P5 ;Turn off Spindle Air
o200 ENDIF 

(MSG, Turn off Pump;clamp tool 32)
M65 P3 ;Turn off Pump;clamp tool
	(MSG, waiting for toolLocked 33)
M66 P3 L4 Q10 ; wait for tool-released = false
O110 if [#5399 EQ -1]
    (abort, failed to clamp tool 34)
O110 endif
M65 P4
	(MSG, move arm out 35)
M65 P2 ; move arm back out
	(MSG, waiting for arm 36)
M66 P4 L3 Q10 ; wait for arm-out = true
O111 if [#5399 EQ -1]
    (abort, failed to move arm in 37)
O111 endif


o<toolchange> endsub [1]


M2
Last edit: 03 Sep 2019 08:03 by CNCDoc.

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

More
03 Sep 2019 20:14 #144085 by andypugh
Replied by andypugh on topic VMC related HAL questions.
Let me ask again. Why are you using L3 ?

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

More
03 Sep 2019 20:15 #144086 by andypugh
Replied by andypugh on topic VMC related HAL questions.
And have you checked the input pins with Halmeter?

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

More
04 Sep 2019 05:50 #144125 by CNCDoc
Replied by CNCDoc on topic VMC related HAL questions.

Let me ask again. Why are you using L3 ?


Hello
I have tried L0.1.2.3.4.
Don't get any alarm on any of them.

What does this line mean in the manual?
"Mode 0 is the only one permitted for an analog input."
16. M66 Wait on Input

M66 P- | E- <L->

    P- - specifies the digital input number from 0 to 3.

    E- - specifies the analog input number from 0 to 3.

    L- - specifies the wait mode type.

        Mode 0: IMMEDIATE - no waiting, returns immediately. The current value of the input is stored in parameter #5399

        Mode 1: RISE - waits for the selected input to perform a rise event.

        Mode 2: FALL - waits for the selected input to perform a fall event.

        Mode 3: HIGH - waits for the selected input to go to the HIGH state.

        Mode 4: LOW - waits for the selected input to go to the LOW state.

    Q- - specifies the timeout in seconds for waiting. If the timeout is exceeded, the wait is interrupt, and the variable #5399 will be holding the value -1. The Q value is ignored if the L-word is zero (IMMEDIATE). A Q value of zero is an error if the L-word is non-zero.

    Mode 0 is the only one permitted for an analog input.

M66 Example Lines

M66 P0 L3 Q5 (wait up to 5 seconds for digital input 0 to turn on)

M66 wait on an input stops further execution of the program, until the selected event (or the programmed timeout) occurs.

It is an error to program M66 with both a P-word and an E-word (thus selecting both an analog and a digital input). In LinuxCNC these inputs are not monitored in real time and thus should not be used for timing-critical applications.

The number of I/O can be increased by using the num_dio or num_aio parameter when loading the motion controller. See the Motion Section for more information.
Note
	M66 will not function unless the appropriate motion.digital-in-nn pins or motion.analog-in-nn pins are connected in your hal file to an input.
Example HAL Connection

net signal-name motion.digital-in-00 <= parport.0.pin10-in


I don't want the arm to go in if it is a tool in the spindle and a tool in the current holder in the carousel

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

More
04 Sep 2019 05:56 #144126 by CNCDoc
Replied by CNCDoc on topic VMC related HAL questions.

And have you checked the input pins with Halmeter?


Have check all the following signals and see the status of the photocell on everyone in the hallmeter

pos-is-empty-mag
hm2_7i92.0.7i77.0.0.input-29
motion.digital-in-05

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

More
04 Sep 2019 09:51 #144142 by andypugh
Replied by andypugh on topic VMC related HAL questions.

What does this line mean in the manual?
"Mode 0 is the only one permitted for an analog input."l


It means that you can not do a "wait on input" with an analogue input.

This makes sense, there is likely to be too much dither in the input to properly define a rise or fall event, and how would the system know what was "high" and what was "low" for an analogue input?

Try this test code:
 M66 P5 L0
O100 IF [#5399 EQ 1]
    (DEBUG, Tool in spindle: #5399)
O100 ELSEIF [#5399 EQ 0] 
   (DEBUG, NO Tool in Spindle: #5399)
O100 ELSEIF [#5399 EQ -1]
   (DEBUG, Timeout, should be impossible with L=0)
O100 ELSE
   (DEBUG, Totally unexpected value for digital input M66 = #5399)
O100 ENDIF
M2
The following user(s) said Thank You: CNCDoc

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

Time to create page: 0.135 seconds
Powered by Kunena Forum