Hurco BMC30 toolchanger setup with Pico PPMC

More
04 Nov 2021 10:16 #225222 by Jake
Well I am going to try to get my tool changer going again.  Looks like it has been to long since I have been around and the old topic was archived or lost forever.....

I have found the VMC_toolchange files that Andy has on Git 

I have the "toolchange.ngc, toolchange_gray.hal,  file.  The point I was struggling with was how to assign the physical I/O that are associated with the tool changer.  The below is a line from Andy's "toolchange_gray.hal" and "toolchange.ngc"
net car-lock motion.digital-out-01
Then in the subroutine 
M64 P1 ; lock carousel

I can not connect the dots where I am getting from the physical pin to the M64 M code.  I know the M64 P1 is commanding the car-lock digital output true to lock the carriage.  Is this being handled somewhere that I am missing?  I thought there were certain HAL commands that make all this happen.  I did find some of the information in 8.7.5 in the new manual that I am trying to comprehend.  

I will end up with 

inputs 
carousel is in
carousel is out
tool is locked (which is already in use)
spindle is oriented (which is already in use)

outputs 
carousel in
carousel out
tool unlock (already in use)
spindle orient (already in use)
carousel forward 
carousel reverse

There are also 2 proximity switches for the carosuel home and index which appear to be handled differently.


My routine should be 

Stop spindle
Orient Spindle
Raise spindle to tool change height
tool changer in
unlock tool
raise spindle
index tool changer
lower spindle
lock tool
retract tool changer 

resume program (of course there are permissive in the above)


   I still need to work through the tool changer board itself to check it out and make sure its happy.  

I just realized after looking at Github its been 4 years since I have last tried to get this moving forward again....No wonder I can not find the thread here anymore.  The machine still runs great though.  I am thinking about CNC'in a small LeBlond that needs a decent amount of work this winter. 

@tommylight   I do remember you talking about getting a machine similar to the one I have did you ever get it all up and going along with the tool changer? 

I hope this makes some sense.  Thank you in advance.  

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

More
07 Nov 2021 22:14 #225593 by tommylight
forum.linuxcnc.org/30-cnc-machines/33529-hurco-bmc-20p-retrofit
That might help. there is also a config attached somewhere, but not the final one.

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

More
08 Nov 2021 12:08 #225670 by Jake
I just had a thought last night like on the below as this would be part of the M66
net arm-retracted motion.digital-in-02 ppmc.0.din.21.in

with the above being digital-in-02  would this mean that in the subroutine this would be M66 P2 in the subroutine?

I have a few hours this morning before I need to go to bed so I am going to go see what I can get done this morning.  I need to update also I think I still have 2.5 going....

# M66 INPUTSnet spindle-is-oriented motion.digital-in-06 ppmc.0.din.07.innet spindle-stopped motion.digital-in-09 ppmc.0.din.XX.in-notnet is-z-homed motion.digital-in-08 halui.joint.2.is-homednet arm-retracted motion.digital-in-02 ppmc.0.din.21.innet arm-extended motion.digital-in-03 ppmc.0.din.22.innet tool-released motion.digital-in-05 ppmc.0.din.10.innet tool-locked motion.digital-in-06 ppmc.0.din.09.in#M62-65 OUTPUTSnet orient-spindle motion.digital-out-06 ppmc.0.dout.05.outnet arm-retract motion.digital-out-01 ppmc.0.dout.10.outnet arm-extend motion.digital-out-02 ppmc.0.dout.11.outnet tool-release motion.digital-out-03 ppmc.0.dout.09.out

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

More
09 Nov 2021 23:25 - 09 Nov 2021 23:25 #225895 by andypugh

with the above being digital-in-02  would this mean that in the subroutine this would be M66 P2 in the subroutine?

Yes:
linuxcnc.org/docs/2.8/html/gcode/m-code.html#mcode:m66
Last edit: 09 Nov 2021 23:25 by andypugh.

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

More
12 Nov 2021 07:05 #226194 by Jake
Thanks Andy,

Hopefully I will be back on normal work schedule and days next week and can get back to it and get it done. I have the tool changer and some of the machine error messages I need to mess with.

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

More
23 Nov 2021 22:32 - 23 Nov 2021 22:34 #227440 by Jake
Finally headway!!

I am to the point where it goes into the subroutine, gets the spindle oriented, spindle at commanded height, then it stops and gives me error " Line 60 O108 unknown. 
This is an umbrella tool changer with a index pin on the motor to rotate and a pin at pocket 24, rotates in both directions.  I am stuck here, When I use the HAL meter for pocket it stays at pocket 1, does not change when I move the changer.  I am not quite sure how the tool changer would home itself at this point either.  All my sensors, switches, solenoids are functional.  I do have lines 138,139 commented out right now as I could not get a startup with them not. 

I still need to get the button to function so I can manually pull a tool out if need be.  I think I need to add a or2 to get that to work.

Do you have any ideas on why it might jump all the way to O108  ?
THANKS!!
; HURCO BMC30 11/23/2021
o<toolchange> sub

; M66 inputs
; P0 carosuel completed
; P1 spindle-oriented
; P2 arm-retracted
; P3 arm-extended
; P4 tool-locked
; P5 tool-released
; P6 air-alarm

; M64 outputs
; P0  start carosuel
; P1  spindle-orient
; P2  arm-retract
; P3  arm-extend
; P5  release-tool

M64 P1         ;spindle orient command
M66 P1 L3 Q5   ;spindle oriented complete
    O030 if [#5399 LT 0]
    O030 endif

; 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.

O100 IF [#<tool_in_spindle> GT 0]
    G53 G0 Z -4
    M66 P6 ; air-alarm
    M64 P3 ; extend arm
    M66 P3 L3 Q5 ; wait for arm-extended = true
    O104 if [#5399 LT 0]
        (abort, failed to move arm-extended)
    O104 endif

    M64 P5 ; release tool
    M66 P5 L3 Q2 ; wait for tool-released = true
    O105 if [#5399 LT 0]
        (abort, failed to release tool)
    O105 endif

O100 ENDIF

    G53 G0 Z0

O200 IF [#<selected_tool> GT 0]


    M68 E0 Q#<selected_pocket> ;set the carousel to move to the right pocket

    M64 P0 ; start carousel
    G4 P2
    M66 P0 L3 Q60 ; wait for carousel finished
    O107 if [#5399 LT 0]
        (abort, failed to align carousel)
    O107 endif
   
    O108 endif

    M66 P6 ; air-alarm
    M64 P3 ; move arm extend (might already be in)
    M66 P3 L3 Q5 ; wait for arm-extended = true
    O109 if [#5399 LT 0]
        (abort, failed to move arm in)
    O109 endif

    G53 G0 Z-4 ; pick up the tool

O200 ENDIF

M64 P5 ; release-tool (release tool false)
M66 P4 L4 Q2 ; wait for tool-locked = true
O110 if [#5399 LT 0]
    (abort, failed to lock tool)
O110 endif

M64 P2 ; arm-retract
M66 P2 L3 Q5 ; wait for arm-retracted = true
O111 if [#5399 LT 0]
    (abort, failed to move arm out)
O111 endif


o<toolchange> endsub [1]


M2
#24 Pocket tool changer, Home pin @#24 Index switch on rotator.
loadrt carousel pockets=24 dir=2 encoding=index num_sense=2
loadrt conv_float_s32
addf carousel.0 servo-thread
addf conv-float-s32.0 servo-thread
net car-enable motion.digital-out-00 carousel.0.enable  
net car-ready carousel.0.ready motion.digital-in-00
net sense-0 carousel.0.sense-0 ppmc.0.din.19.in
net sense-1 carousel.0.sense-1 ppmc.0.din.20.in
net car-pos-req motion.analog-out-00 conv-float-s32.0.in
net car-pos-s32 conv-float-s32.0.out carousel.0.pocket-number  

# RELEASE-BUTTON    DI 32
net release-button  ppmc.0.din.31.in-not and2.1.in1

# Mag ROTATE   
net car-fwd carousel.0.motor-fwd ppmc.0.dout.01.out
net car-rev carousel.0.motor-rev ppmc.0.dout.15.out
# net jog-fwd motion.digital-in-10 ppmc.0.din.29.in

# M66 INPUTS
net spindle-is-oriented motion.digital-in-01 ppmc.0.din.10.in
#net spindle-stopped motion.digital-in-09 ppmc.0.din.02.in-not
#net is-z-homed motion.digital-in-08 halui.joint.2.is-homed
net arm-retracted motion.digital-in-02 ppmc.0.din.21.in
net arm-extended motion.digital-in-03 ppmc.0.din.22.in
net tool-locked motion.digital-in-04 ppmc.0.din.07.in
net tool-released motion.digital-in-05 ppmc.0.din.11.in
net air-alarm motion.digital-in-06 ppmc.0.din.28.in-not

#M62-65   OUTPUTS
net spindle-orient motion.digital-out-01 ppmc.0.dout.05.out
net arm-retract motion.digital-out-02 ppmc.0.dout.12.out
net arm-extend motion.digital-out-03 ppmc.0.dout.13.out
net tool-release motion.digital-out-05 ppmc.0.dout.09.out #or2.1.out
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
Last edit: 23 Nov 2021 22:34 by Jake. Reason: code formatting

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

More
23 Nov 2021 23:06 #227449 by andypugh
    O107 if [#5399 LT 0]
        (abort, failed to align carousel)
    O107 endif
   
    O108 endif

    M66 P6 ; air-alarm

It looks like there is no O108 IF to match the O108 ENDIF

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

More
23 Nov 2021 23:27 #227454 by Jake
Dang didn't even see that. I'll get that fixed and head back out to the shop after dinner.

Thanks!

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

More
03 Dec 2021 22:53 #228325 by Jake
I have a question on the abort logic.

For instance I had a "arm failed to move in" which has a O104 after it to abort.  What is supposed to happen after the abort? I am having a challenge with the output staying true It gets to the M64 P3 and its stuck there.  (I was having a relay issue causing lack of movement)  Which I was going to test the failures to ensure the logic and abort logic was correct.  Especially with the type of solenoid this arm has I need to be able to reset.  The only way I can get it to back out of the toolchanger sub is to restart LCNC.  The output will stay true even with toggling the ON/OFF.  It will go false with an estop, but comes right back after the estop is reset.
Am I missing something in my abort code or the the [#5399 LT 0] wrong?


Thanks!!!

O100 IF [#<tool_in_spindle> GT 0]
    G53 G0 Z -4
    M66 P6 ; air-alarm
    M64 P3 ; extend arm
    M66 P3 L3 Q5 ; wait for arm-extended = true
    M65 P3 ; arm extend off
    O104 if [#5399 LT 0]
        (abort, failed to move arm-extended)
    O104 endif

    M64 P5 ; release tool
    M66 P5 L3 Q2 ; wait for tool-released = true
    O105 if [#5399 LT 0]
        (abort, failed to release tool)
    O105 endif

O100 ENDIF

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

More
03 Dec 2021 23:31 - 03 Dec 2021 23:34 #228327 by Michael
Some quick thoughts. After you do have a fail make sure to manually in mdi set #5399 = 0 otherwise you will always error when you get to an abort even if it's not true. After an abort you should get the message in text on the screen. I have a feeling your not actually getting to the abort though.

Also in your code you need to move o104 if statement directly under the M66
I would go through your tool change sequence manually in the mdi to make sure it works. You can test each section one at a time. Use HAL show to watch all the pins and make sure they are working.
Last edit: 03 Dec 2021 23:34 by Michael.

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

Time to create page: 0.099 seconds
Powered by Kunena Forum