Hi everyone,
I have spend the last week to finally get my tool changer going. I had build the mechanics at some point last year, but only now got to play with the software implementation.
I went the route of using probe_basic for the UI and Andypughs carousel.comp (most recent version @ master from late May 223) to control the carousel.
Setup:
16 Pockets for ISO20, forks mounted to large aluminium disk mounted to an 1:80 reduction harmonic drive gearbox. The carousel is driven by a clsoed loop stepper motor auf Nema23 size through a 1:1 belt drive. Three sensors are used:
1 1xInductive sensor against a target on the disk for homing
2 1xInductive sensor for pockets against a target per pocket (targets are M6 SHCS mounted to the disk in cnc milled locations)
3 1x Optical Diffuse Reflection sensor ("laser") to check if a pocket is actually empty
Operation is done in index mode with forward and backward motion enabled. AlignDC is set low, to reliably hit the pocket. After roughly 100 M6 through various pockets I have not encountered any problems.
Probe Basic Integration: Honestly, too much to quickly type up. Main elements are described in the bullets below:
- I have replaced most of the macros and added various additional ones. All carousel logic is handled by carousel.comp, Direction of rotation and number of steps is also determined within the macros but only for the purpose of moving the animation in the right direction.
- Key pins of carousel.comp and the spindle are linked into custom m_codes (see folder m_codes in link below)
- Mcode wrappers are used to bundle key functions such as release tool and check drawbar state into a single command to clean up the code
- UI has been modified to adjust to my specific needs including debugging. Since my carousel is openly accessible by the operator, I have added some macro functions which required UI interaction.
- Force empty carousel: Macro to reset all pockets and the animation to zero values
- Check carousel: Macro to run through each pocket and check if a tool is physically present (sensor 3) and remove all entries where there should be a tool (according to numbered variables) but none could be found
- Manually enter tool to pocket: Macro to receive tool and pocket from the ui to directly write that information into carousel control (without physically moving anything)
- Manually remove tool from pocket: Macro to clear a specific pocket from tool information
- General ATC process: atc_toolchange.ngc works as a master document doing the following
- Distinguish between tools in the carousel and those outside, specific handling of probe (must not be in atc for me)
- Puts tools back to where they came from - this is used to ensure that some tools are not being put back into the carousel although they were manually put into the machine (I have some tools that are too long/ too heavy) for the carousel)
- Check if current tool in spindle is: 0, from the carousel or not from the carousel and perform actions accordingly (do nothing, drop into original pocket at atc, drop off at manual tool change location)
- Check for the new tool: Is 0, is from carousel, not from carousel and perform accordingly
- General assumptiona:
- Tools in the carousel have received tool lenght measurement and have a correctly determined offset
- Tools manually changed in during M6 are considered unknown and forced to do tool lenght measurement
- Tools can be put into and removed from the carousel using UI interaction and physical operation of the machine. These are assumed to be known, i.e. the tool length offset has previously been determined
Video of a sequence of M6 here:
Automatic Tool Change with carousel.comp and probe_basic in LinuxCNC 2.9 - YouTube
The whole configuration can be viewed here:
GuiHue/kondor: Repository for all things related to the control system of my Kondor CNC router (github.com)
Note that the modified probe_basic.ui file is also a part of the repository and needs to be placed whereever your ui file usually is located.
@devs: I'll be happy to clean this up and provide an example for the official repo
Many thanks to the wonderful developers of the various bits used. Specifically andypugh for carousel.comp and the qtpyvcp team (turboss for helping out on the discord).