VMC related HAL questions.
20 May 2015 14:49 #58886
by andypugh
Replied by andypugh on topic VMC related HAL questions.
I updated the zip file in post 58732 to include the latest changes.
Please Log in or Create an account to join the conversation.
20 May 2015 23:25 #58901
by thewho
Replied by thewho on topic VMC related HAL questions.
Had a look in your "spindle.hal" and I somewhat understand what's happening. Not enough to adapt it to my machine though
I'm at the stage that I might get a physical button to do something
I'm at the stage that I might get a physical button to do something
Please Log in or Create an account to join the conversation.
21 May 2015 00:06 #58902
by andypugh
Replied by andypugh on topic VMC related HAL questions.
It shouldn't need that much adaption. I tried to write it in a way that it could just be "plugged in"
(And the same for the tool changer)
0) Make a copy of your entire working config folder and rename it, then rename the INI file in that folder.
Make all changes to that folder so that the existing config can be used to run the machine.
1) Move anything spindly out of your existing HAL file into the bottom of the new spindle.hal file
2) Add the complete [SPINDLE] section in the sample iNI file to your INI file
3) Add HALFILE=spindle.hal to the [HAL] section of your INI file.
Now you need to figure out the signals in this section here:
#for a real spindle run by a VFD
# loadrt abs
# addf abs.0.servo-thread
# net spindle-cmd mux2.0.out abs.0.in
# net spindle-cmd-abs abs.0.out pwmgen.0.value
# net spindle-pwm pwmgen.0.pwm parport.0.pin-NN-out
# net spindle-fwd abs.0.is-positive parport.0.pin-NN-out
# net spindle-rev abs.0.is-negative parport.0.pin-NN-out
Looking at your existing spindle stuff should help figure it out.
Keep the exact signal names (ie, the name immediately after the "net" command) from my signal.hal but use the pin names from your HAL file.
Keep and "setp" commands from your HAL file exactly the same.
Delete the line "net spindle-cmd mux2.0.out" and un-comment the block of net commands above (ie, remove the # chars)
I expect that you would end up with something rather like:
loadrt abs
addf abs.0.servo-thread
net spindle-cmd mux2.0.out abs.0.in
net spindle-cmd-abs abs.0.out hm2_5i25.0.7i77.0.analogout-04
net spindle-fwd abs.0.is-positivehm2_5i25.0.7i76.0.0.output-01
net spindle-rev abs.0.is-negative hm2_5i25.0.7i76.0.0.output-02
(You don't need a pwmgen with a 7i76.)
But I am just guessing as I haven't seen your config.
(And the same for the tool changer)
0) Make a copy of your entire working config folder and rename it, then rename the INI file in that folder.
Make all changes to that folder so that the existing config can be used to run the machine.
1) Move anything spindly out of your existing HAL file into the bottom of the new spindle.hal file
2) Add the complete [SPINDLE] section in the sample iNI file to your INI file
3) Add HALFILE=spindle.hal to the [HAL] section of your INI file.
Now you need to figure out the signals in this section here:
#for a real spindle run by a VFD
# loadrt abs
# addf abs.0.servo-thread
# net spindle-cmd mux2.0.out abs.0.in
# net spindle-cmd-abs abs.0.out pwmgen.0.value
# net spindle-pwm pwmgen.0.pwm parport.0.pin-NN-out
# net spindle-fwd abs.0.is-positive parport.0.pin-NN-out
# net spindle-rev abs.0.is-negative parport.0.pin-NN-out
Looking at your existing spindle stuff should help figure it out.
Keep the exact signal names (ie, the name immediately after the "net" command) from my signal.hal but use the pin names from your HAL file.
Keep and "setp" commands from your HAL file exactly the same.
Delete the line "net spindle-cmd mux2.0.out" and un-comment the block of net commands above (ie, remove the # chars)
I expect that you would end up with something rather like:
loadrt abs
addf abs.0.servo-thread
net spindle-cmd mux2.0.out abs.0.in
net spindle-cmd-abs abs.0.out hm2_5i25.0.7i77.0.analogout-04
net spindle-fwd abs.0.is-positivehm2_5i25.0.7i76.0.0.output-01
net spindle-rev abs.0.is-negative hm2_5i25.0.7i76.0.0.output-02
(You don't need a pwmgen with a 7i76.)
But I am just guessing as I haven't seen your config.
The following user(s) said Thank You: thewho
Please Log in or Create an account to join the conversation.
21 May 2015 00:41 #58903
by andypugh
Replied by andypugh on topic VMC related HAL questions.
I am glad that I made that simulated machine. It took me a few tool-changes to spot a problem with the tool-change sequence.
When there is no tool in the spindle and the spindle moves down to pick up the tool, the drawbar is not released.
It is fine if a tool has just been unloaded, as the drawbar is left released.
This is a minor change to the G-code toolchange routine, but does need to be done.
When there is no tool in the spindle and the spindle moves down to pick up the tool, the drawbar is not released.
It is fine if a tool has just been unloaded, as the drawbar is left released.
This is a minor change to the G-code toolchange routine, but does need to be done.
Please Log in or Create an account to join the conversation.
21 May 2015 18:44 #58915
by andypugh
Replied by andypugh on topic VMC related HAL questions.
I also spotted some things in the spindle config that are needed for a real-world setup.
linuxcnc.org/index.php/english/forum/10-...nent-g33-works#58914
linuxcnc.org/index.php/english/forum/10-...nent-g33-works#58914
Please Log in or Create an account to join the conversation.
- sspeed33317
- Offline
- Premium Member
Less
More
- Posts: 90
- Thank you received: 1
25 May 2015 10:09 #58989
by sspeed33317
Replied by sspeed33317 on topic VMC related HAL questions.
Hello Andy,
I am going to take another shot at getting my HAAS running soon. I kinda lost interest when it became too difficult but i can't give up.
I think this topic is the way to go for me. I would have liked to try to get Tkamskers component
to work but there is lot of adapting to do to make it work with my Mesa boards...
I have a question, I have two tool changers, a side arm and a carousel, the carousel is on the machine now and
is a geneva wheel... In order to make the geneva into a rotary axis i was wondering if i could refit the geneva motor with a servo
and rotary encoder instead of using a grey code on the carousel wheel itself. Effectively turning the carousel into a rotary axis.
But with the carousel i still need to move the Z axis... with the side arm will be a big project to fit it , but can be totally controlled with classic ladder.
With the side arm I will gain a few tool holders also.
I am going to take another shot at getting my HAAS running soon. I kinda lost interest when it became too difficult but i can't give up.
I think this topic is the way to go for me. I would have liked to try to get Tkamskers component
to work but there is lot of adapting to do to make it work with my Mesa boards...
I have a question, I have two tool changers, a side arm and a carousel, the carousel is on the machine now and
is a geneva wheel... In order to make the geneva into a rotary axis i was wondering if i could refit the geneva motor with a servo
and rotary encoder instead of using a grey code on the carousel wheel itself. Effectively turning the carousel into a rotary axis.
But with the carousel i still need to move the Z axis... with the side arm will be a big project to fit it , but can be totally controlled with classic ladder.
With the side arm I will gain a few tool holders also.
Please Log in or Create an account to join the conversation.
25 May 2015 18:05 - 25 May 2015 18:05 #59001
by andypugh
You could, but there shouldn't be any need.
The "carousel" HAL component that I have written should operate most forms of carousel without hardware modifications.
Have you tried looking at the files in my sample configuration? There are a few parts to it that need to fit together.
1) The "carousel" HAL component. "sudo comp --install --install-docs carousel.comp" should install that. Then it is available for use if you want to.
2) Add an extra few digital IO lines for G-code, change one line in the HAL file. This change is safe:
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES num_dio=6
3) Put the toplevel.py and remap.py files in your config directory. (You can do this without anything breaking)
4) Get the carousel control HAL file working with your carousel. You should be able to add a the (short) toolchange.hal file to your INI file [HAL] section. You probably need to change the number of pockets etc to suit your machine.
You should then be able to move the carousel from MDI with M68 E0 Q{pocket number} followed by M64 P0 to start the carousel and M65 P0 to stop it.
4) Get the toolchange.ngc G-code routine working on your machine. You can set the G-code parameters #<tool-in_spindle>, #<selected_tool> and #<selected_pocket> in MDI then call O<toolchange>CALL.
Various switches need to be wired up in HAL to move actuators and sense positions. look in toolchange.hal to see what the tol change routine is expecting. As an example the signal for moving the carousel in to the spindle is net arm-act motion.digital-out-02 so if that was a parallel port output 17 you would add net arm-act parport.0.pin-17-out to that HAL file.
5) Once the G-code routine is working you can re-map the M6 command to run the tool change G-code routine. First some extra items in the INI file [RS274NGC] and section and either a new [PYTHON] section or modifications to the existing [PYTHON] section4) Put the toplevel.py and remap.py files in your config directory.
And that should be it.
Do you need spindle alignment too?
Replied by andypugh on topic VMC related HAL questions.
I have a question, I have two tool changers, a side arm and a carousel, the carousel is on the machine now and
is a geneva wheel... In order to make the geneva into a rotary axis i was wondering if i could refit the geneva motor with a servo
and rotary encoder instead of using a grey code on the carousel wheel itself. Effectively turning the carousel into a rotary axis.
You could, but there shouldn't be any need.
The "carousel" HAL component that I have written should operate most forms of carousel without hardware modifications.
Have you tried looking at the files in my sample configuration? There are a few parts to it that need to fit together.
1) The "carousel" HAL component. "sudo comp --install --install-docs carousel.comp" should install that. Then it is available for use if you want to.
2) Add an extra few digital IO lines for G-code, change one line in the HAL file. This change is safe:
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES num_dio=6
3) Put the toplevel.py and remap.py files in your config directory. (You can do this without anything breaking)
4) Get the carousel control HAL file working with your carousel. You should be able to add a the (short) toolchange.hal file to your INI file [HAL] section. You probably need to change the number of pockets etc to suit your machine.
You should then be able to move the carousel from MDI with M68 E0 Q{pocket number} followed by M64 P0 to start the carousel and M65 P0 to stop it.
4) Get the toolchange.ngc G-code routine working on your machine. You can set the G-code parameters #<tool-in_spindle>, #<selected_tool> and #<selected_pocket> in MDI then call O<toolchange>CALL.
Various switches need to be wired up in HAL to move actuators and sense positions. look in toolchange.hal to see what the tol change routine is expecting. As an example the signal for moving the carousel in to the spindle is net arm-act motion.digital-out-02 so if that was a parallel port output 17 you would add net arm-act parport.0.pin-17-out to that HAL file.
5) Once the G-code routine is working you can re-map the M6 command to run the tool change G-code routine. First some extra items in the INI file [RS274NGC] and section and either a new [PYTHON] section or modifications to the existing [PYTHON] section
[RS274NGC]
PARAMETER_FILE = vmc.var
SUBROUTINE_PATH = ./
REMAP=M6 modalgroup=6 prolog=change_prolog ngc=toolchange epilog=change_epilog
[PYTHON]
TOPLEVEL=./toplevel.py
PATH_APPEND= ./
PATH_APPEND= /usr/share/linuxcnc/ncfiles/remap_lib/python-stdglue/
And that should be it.
Do you need spindle alignment too?
Last edit: 25 May 2015 18:05 by andypugh.
The following user(s) said Thank You: sspeed33317
Please Log in or Create an account to join the conversation.
- sspeed33317
- Offline
- Premium Member
Less
More
- Posts: 90
- Thank you received: 1
26 May 2015 00:48 #59023
by sspeed33317
Replied by sspeed33317 on topic VMC related HAL questions.
OK wow.... thank you.
I will start looking at files.
And yes I need to line up the spindle, I can do it two ways
I want to add a spindle encoder , very easy on my machine since
there are provisions for it.
Or I can use the mechanical method which is the way it was done on my machine.
Spindle would turn at a slow rpm then a shot pin would set and then a prox switch would sense
when the pin dropped and locked the spindle and then sent a signal to the control and VFD a stop signal.
I will start looking at files.
And yes I need to line up the spindle, I can do it two ways
I want to add a spindle encoder , very easy on my machine since
there are provisions for it.
Or I can use the mechanical method which is the way it was done on my machine.
Spindle would turn at a slow rpm then a shot pin would set and then a prox switch would sense
when the pin dropped and locked the spindle and then sent a signal to the control and VFD a stop signal.
Please Log in or Create an account to join the conversation.
26 May 2015 02:33 #59029
by andypugh
That is fairly easy to control with LinuxCNC from the G-code sub.
You probably need to be quite careful to make sure that you can't try to start the spindle with the lock energised, but that sort of interlocking is what HAL is good at.
Replied by andypugh on topic VMC related HAL questions.
Or I can use the mechanical method which is the way it was done on my machine.
Spindle would turn at a slow rpm then a shot pin would set and then a prox switch would sense
when the pin dropped and locked the spindle and then sent a signal to the control and VFD a stop signal.
That is fairly easy to control with LinuxCNC from the G-code sub.
You probably need to be quite careful to make sure that you can't try to start the spindle with the lock energised, but that sort of interlocking is what HAL is good at.
Please Log in or Create an account to join the conversation.
- sspeed33317
- Offline
- Premium Member
Less
More
- Posts: 90
- Thank you received: 1
26 May 2015 03:48 #59034
by sspeed33317
Replied by sspeed33317 on topic VMC related HAL questions.
i believe with the way HAAS did it was the Orient Pin sensor was wired directly to the VFD
When I removed all the factory wiring there was a harness that led directly up to the spindle from the VFD
and was labeled stop.
Also if i remember correctly the way they did it was power up the spindle 25 rpm, then let it coast , drop the pin and then the stop signal.
When I removed all the factory wiring there was a harness that led directly up to the spindle from the VFD
and was labeled stop.
Also if i remember correctly the way they did it was power up the spindle 25 rpm, then let it coast , drop the pin and then the stop signal.
Please Log in or Create an account to join the conversation.
Time to create page: 0.094 seconds