Here are a few notes. I'm sleep deprived, but hopefully this will help a bit. This code below may require some tweaking for your machine configuration, so start slow and do one axis at a time. Also, depending on the version of CNC12 if you open and save settings using the wizard it may over-write the home file. So be sure to make a master copy of the old one, and the new one, etc.
note. the negative sign after "P" defines the direction of the move in that axis. So you may have to remove the "-" negative sign for your axis to move the appropriate direction, it all depends on how you configured each axis for your home direction. So keep everything slow initially, so it won't go the wrong way and crash your valuable machine.
You can and probably should "comment out lines" ( disable them) by using a semi colon ( for example ;Move Z plus at 20in/m until 1 opens ). Its commented out because it has a ";" , basically anything after a ";" won't be used as an instruction. Normally, the comments are only there to help someone reading the code understand what's going on on that line. But its a nice tool to use so you can easily comment out ( disable ) a couple of the axis and just work with one initially to test with. Also, the jog/feed/rapid rate is 20in/m which should be reduced to 5 initially for testing. just use F5 instead of F20. You can also make it move really slow to search for the ZRI trigger / index pulse by changing F to "F .1" ( aka 1/10th of an inch per minute ). If you do that it will allow you to see the index pulse on the "virtual" Led's but it'll still be hard to see. ( the input LED's can be viewd by hitting ALT-i ) I'm going to upload a video with various shots of each screen that should help you understand what is happening. Each axis gets backed off the index pulse so it won't interfere with the next axis finding its index pulse. When you are ganging the ZRI inputs like I have, it requires the axis to back off. This is also true of the home switch The code is below.
Also some very important other settings, in the wizard, **at least with my configuration and version of the software ( i'm not running the latest release currently ) , you should set Input 1 ( all home switches in series ) to UNUSED and ALSO set to NO ( normally open ). Yeah, its strange, my switches are wired as NC , I don't know why it works this way honestly, but it does matter which way I set the input type for this to work. Input 4 is the ganged ZRI inputs. Set the input 4 to UNUSED and the input type to NC. For this "anomaly" its very important to make sure the speed of the axis is set to very slow while you are trying it out the first time, especially. So :
****I STRONGLY suggest setting all your homing speeds to F5 or slower not F20 like my example. And the ZRI input to 0.3 INITIALLY And I also suggest commenting out lines so only one axis tries to home initially. If things aren't working as they should, comment out the axis you are working on, and try another. I had a motor with a faulty ZRI index encoder, which caused me a lot of grief trying to figure out what was wrong. But assume all your hardware is good initially but do try commenting out to test different axis to determine if it could be a hardware issue, by the slim chance it is.
Most of this was knowledge is from Marty's videos and JoeG's help as well. I had to make some changes for my configuration, so likely you'll need to adjust something. Remember, my version of the software is likely different, but hopefully yours works the same as mine wrt to the wizard settings.
LINK TO THE VIDEO I JUST MADE THAT SHOWS THE INPUTS TRIGGERING :
https://youtu.be/CYIUzVfrWpo
P.s. you won't see the ZRI ( input 4 ) LED flash, because I have mine moving too fast ( F1 ) and in one line of the video ( line 19 ) it says 10ipm but it should say 20ipm.
Jake
Code: Select all
N100 ;Check for active home switch
IF [#50001] THEN M225 #100 "HomeAll Switch Tripped!!!"
IF [#50001] THEN GOTO 100
M106 /Z P-1 F20 ;Move Z plus at 20in/m until input 1 ??opens??
M105 /Z P-4 F1 ;Move Z plus at 1in/m until input 4 ??closes??
M26 /Z ;Set Z home here
M105 /Z P1 F25 ;Back Z off Switch at 25in/m
M105 /X P-1 F20 ;Move X minus at 20in/m until input 1 ?
M106 /X P-4 F1 ;Move X minus at 1in/m until in 4 ?
M26 /X ;Set Z home here
M106 /X P1 F25 ;Back X off Switch at 25in/m
M105 /Y P-1 F20 ;Move Y minus at 20in/m until input 1 ?
M106 /Y P-4 F1 ;Move Y minus at 1in/m until input 4 ?
M26 /Y ;Set Z home here
M106 /Y P1 F25 ;Back Y off Switch at 25in/m