Well, it all comes from the "sim/axis/vismach/VMC_toolchange" example in LinuxCNC 2.8. I just implemented it as it was used there, but adapted it for my lathe. So it uses the remap.py, remap.pyc, toolchange.ngc files, plus the toolchange_index.hal. But the toolchange.ngc is very small. Just move away the turret, set the tool, wait for completion and then continue. But that part seems to work.
Regarding the tools I might have been unclear about the result. The lagging of the physical pocket compared to the required isn't constantly one position, the lag accumulates by one position for each change. Thereby it will lag one, two, three, four positions, and so on after the same amount of changes. The tool table itself is quite simple with T1 i pocket 1, T2 in pocket 2 , all the way up to T6. I will try your simplified HAL configuration to if it works but to be honest I'm having trouble getting my head around how it's supposed to work if the carousel doesn't ignore the first pocket trigger when changing pocket. Adding one to the target it will behave physically correct but it will not *carousel.**N**.ready* not be set high due to some other discrepancy i suppose. Den sön 10 jan. 2021 kl 17:34 skrev andy pugh <bodge...@gmail.com>: > The HAL is rather strange. What drives the analogue and digital outputs? > > All you should need is: > > loadrt carousel pockets=6 encoding=index dir=1 > addf carousel.0 servo-thread > > #Tool turret encoder input > net car-index carousel.0.sense-0 <= [HMOT](CARD0).7i76.0.0.input-20-not > net car-pulse carousel.0.sense-1 <= [HMOT](CARD0).7i76.0.0.input-21-not > > #Tool turret forward output > net car-fwd carousel.0.motor-fwd => [HMOT](CARD0).7i76.0.0.output-00 > > net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared > net tool-change-cmd iocontrol.0.tool-change carousel.0.enable > net tool-change-fb iocontrol.0.tool-changed carousel.0.ready > net tool-slot iocontrol.0.tool−prep−pocket carousel.0.pocket-number > > loadusr sim_pin carousel.0.jog-fwd > > Then when you issue an M6 Tn G43 the tool changer should go to the > numbered pocket. > (You can configure to change on Tnn like most commercial lathes do, > but that can come later, once it works) > > Do you have the tools set up in the right pockets? Tnn looks in the > tool table to find which pocket Tnn is in. > Your example above has T3 setting pocket-number to 4, and T4 setting > pocket-number to 5. pocket-number is the _input_ to carousel which > seems to be coming via a G-code output. > If TnM6 is working at all then I think that your remap is still in > place, and is doing odd things. > > > -- > atp > "A motorcycle is a bicycle with a pandemonium attachment and is > designed for the especial use of mechanical geniuses, daredevils and > lunatics." > — George Fitch, Atlanta Constitution Newspaper, 1912 > > > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users >
loadrt carousel pockets=6 encoding=index dir=1 loadrt conv_float_s32 addf carousel.0 servo-thread addf conv-float-s32.0 servo-thread #Tool turret encoder input net car-index carousel.0.sense-0 <= [HMOT](CARD0).7i76.0.0.input-20-not net car-pulse carousel.0.sense-1 <= [HMOT](CARD0).7i76.0.0.input-21-not #net car-pulse carousel.0.sense-1 carousel.0.strobe <= [HMOT](CARD0).7i76.0.0.input-21-not #net car-strobe carousel.0.strobe <= [HMOT](CARD0).7i76.0.0.input-21 #Tool turret forward output net car-fwd carousel.0.motor-fwd => [HMOT](CARD0).7i76.0.0.output-00 #M64 and M65 digital outputs net car-enable motion.digital-out-00 => carousel.0.enable #M68 Analog output net car-pos-req motion.analog-out-00 conv-float-s32.0.in #M66 digital inputs net car-ready carousel.0.ready => motion.digital-in-00 net x-is-homed halui.joint.0.is-homed => motion.digital-in-01 #Carousel Soft Signals net car-pos-s32 conv-float-s32.0.out carousel.0.pocket-number net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed loadusr sim_pin carousel.0.jog-fwd
o<toolchange> sub G53 G0 X80 Z100; Go to safe position for tool change M68 E0 Q#<selected_pocket> ;set the carousel to move to the right pocket M64 P0 ; start carousel G4 P2 M66 P0 L3 Q10 ; wait for carousel finished o110 IF [#5399 LT 0] (Abort, failed to align carousel) o110 ENDIF M65 P0; stop carousel o<toolchange> endsub [1] M2
_______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users