Hardinge CHNC retrofit- Another one on the way!
- Alloy Craft
- Offline
- Premium Member
-
Less
More
- Posts: 97
- Thank you received: 1
29 Aug 2014 11:20 - 29 Aug 2014 11:27 #50440
by Alloy Craft
Replied by Alloy Craft on topic Hardinge CHNC retrofit- Another one on the way!
Almost done with this conversion, this has been a long project, however the lathe is working pretty well now. Its very fast compared to the old servos. Max velocity is 600 ipm using 75% of the servos rated speed, I may up the speed a little later. I will be setting up a bar feed job in a week or so, I will post a video of it when It comes through.
last 2 things I need to do is get the vertical slide ladder program working with its custom M code I cant seem to figure out how to pass a variable to the M code from inside a g code program. I also need to have the ladder program turn on the vertical slide untill it hits the bottom limit switch. I beleive I need to use a sealed circuit witha reset coil connected to the limit switch. Just not sure if I can call out a classic ladder pin directly inside my custom Mcode? Anyway here is a video of it cutting some thread, and some pics.
last 2 things I need to do is get the vertical slide ladder program working with its custom M code I cant seem to figure out how to pass a variable to the M code from inside a g code program. I also need to have the ladder program turn on the vertical slide untill it hits the bottom limit switch. I beleive I need to use a sealed circuit witha reset coil connected to the limit switch. Just not sure if I can call out a classic ladder pin directly inside my custom Mcode? Anyway here is a video of it cutting some thread, and some pics.
![File Attachment:](http://i1009.photobucket.com/albums/af218/alloycraft/20140828_190734_zps2973ebe5.jpg)
![File Attachment:](http://i1009.photobucket.com/albums/af218/alloycraft/20140828_190723_zpseee97de0.jpg)
![File Attachment:](http://i1009.photobucket.com/albums/af218/alloycraft/20140828_190911_zpscfe83e4e.jpg)
Last edit: 29 Aug 2014 11:27 by Alloy Craft.
Please Log in or Create an account to join the conversation.
29 Aug 2014 15:10 #50444
by andypugh
You call withOr similar
Then in a bash script the variables appear as $1 or $2
The M100 example here covers it:
www.linuxcnc.org/docs/html/gcode/m-code.html#sec:M100-to-M199
If you are calling Python instead then I am not sure how it works, but they probably come in as arguments in some way.
Replied by andypugh on topic Hardinge CHNC retrofit- Another one on the way!
I cant seem to figure out how to pass a variable to the M code from inside a g code program.
You call with
M101 P[#1]
M101 P100 Q200
M102 P#1 Q#2
Then in a bash script the variables appear as $1 or $2
The M100 example here covers it:
www.linuxcnc.org/docs/html/gcode/m-code.html#sec:M100-to-M199
If you are calling Python instead then I am not sure how it works, but they probably come in as arguments in some way.
Please Log in or Create an account to join the conversation.
29 Aug 2014 21:10 #50468
by dgarrett
Replied by dgarrett on topic Hardinge CHNC retrofit- Another one on the way!
python example using sim example configs/sim/axis/axis.ini:Execute mdi:results in:
$ cd the_dir_for_the_ini_file
$ cat ../../nc_files/M109
#!/usr/bin/python
import sys
print "sys.argv=",sys.argv
M109 P123 Q456
sys.argv= ['../../nc_files//M109', '123.000000', '456.000000']
Please Log in or Create an account to join the conversation.
- Alloy Craft
- Offline
- Premium Member
-
Less
More
- Posts: 97
- Thank you received: 1
30 Aug 2014 11:34 - 30 Aug 2014 11:37 #50504
by Alloy Craft
Replied by Alloy Craft on topic Hardinge CHNC retrofit- Another one on the way!
Thanks guys, passing a variable to the M code is working now, however I cant seem to get the mcode to work. the M code shoud control the vertical slide as well as extend the part catcher slide when the part is cut off. The first part is the vertical slide start, the second is the part catcher extend.
Here is the M code
#!/bin/bash
delay=$1
outtime=$2
halcmd setp classicladder.0.in-11 1
sleep1
halcmd setp classicladder.0.in-11 0
sleep $delay
halcmd setp hm2_5i23.0.gpio.064.out 1
sleep $outtime
halcmd setp hm2_5I23.0.gpio.064.out 0
sleep .5
exit 0
Inside my Hal file is the following
net vert-slide hm2_5i23.0.gpio.048.in => classicladder.0.in-12
net slidstart hm2_5i23.0.gpio.070.out => classicladder.0.out-11
Here is the M code
#!/bin/bash
delay=$1
outtime=$2
halcmd setp classicladder.0.in-11 1
sleep1
halcmd setp classicladder.0.in-11 0
sleep $delay
halcmd setp hm2_5i23.0.gpio.064.out 1
sleep $outtime
halcmd setp hm2_5I23.0.gpio.064.out 0
sleep .5
exit 0
Inside my Hal file is the following
net vert-slide hm2_5i23.0.gpio.048.in => classicladder.0.in-12
net slidstart hm2_5i23.0.gpio.070.out => classicladder.0.out-11
Last edit: 30 Aug 2014 11:37 by Alloy Craft.
Please Log in or Create an account to join the conversation.
01 Sep 2014 22:59 #50578
by andypugh
Which part doesn't work?
Does the script execute, for example?
Replied by andypugh on topic Hardinge CHNC retrofit- Another one on the way!
Thanks guys, passing a variable to the M code is working now, however I cant seem to get the mcode to work.
Which part doesn't work?
Does the script execute, for example?
Please Log in or Create an account to join the conversation.
- Alloy Craft
- Offline
- Premium Member
-
Less
More
- Posts: 97
- Thank you received: 1
02 Sep 2014 02:56 #50601
by Alloy Craft
Replied by Alloy Craft on topic Hardinge CHNC retrofit- Another one on the way!
The script does execute, well the second half of it anyway. It's the classic ladder section that's not firing. I think I see the problem now though, I think my arrow notation is incorrect. I think it should be
net slidstart hm2_5i23.0.gpio.070.out <= classicladder.0.out-11
not
net slidstart hm2_5i23.0.gpio.070.out => classicladder.0.out-11
net slidstart hm2_5i23.0.gpio.070.out <= classicladder.0.out-11
not
net slidstart hm2_5i23.0.gpio.070.out => classicladder.0.out-11
Please Log in or Create an account to join the conversation.
02 Sep 2014 02:58 #50602
by PCW
Replied by PCW on topic Hardinge CHNC retrofit- Another one on the way!
The arrows are just for looks (and ignored by linuxcnc)
Please Log in or Create an account to join the conversation.
- Alloy Craft
- Offline
- Premium Member
-
Less
More
- Posts: 97
- Thank you received: 1
12 Sep 2014 07:12 - 12 Sep 2014 07:13 #51103
by Alloy Craft
Replied by Alloy Craft on topic Hardinge CHNC retrofit- Another one on the way!
Well I threw in the towel on getting the ladder to work with the limit switch, I'm just running the vertical slide on a timer for the time being. Anyway here is a video of a bar job I spent the last 3 days running.
This project is pretty much done. Next is a 3d printer!
thanks for all the help guys, Linux cnc rocks!
This project is pretty much done. Next is a 3d printer!
thanks for all the help guys, Linux cnc rocks!
Last edit: 12 Sep 2014 07:13 by Alloy Craft.
Please Log in or Create an account to join the conversation.
- Alloy Craft
- Offline
- Premium Member
-
Less
More
- Posts: 97
- Thank you received: 1
01 Feb 2015 11:23 #55540
by Alloy Craft
Replied by Alloy Craft on topic Hardinge CHNC retrofit- Another one on the way!
Another video of a barfeed job. Cutting 4-40 threaded standoffs.
Please Log in or Create an account to join the conversation.
01 Feb 2015 20:55 #55550
by BigJohnT
Replied by BigJohnT on topic Hardinge CHNC retrofit- Another one on the way!
What were you trying to do in classicladder?
I'm also building a 3D printer, if you see tjb1 on the IRC he's built 5 of them and is a big help.
JT
I'm also building a 3D printer, if you see tjb1 on the IRC he's built 5 of them and is a big help.
JT
Please Log in or Create an account to join the conversation.
Moderators: cncbasher
Time to create page: 0.104 seconds