VMC related HAL questions.

More
7 years 2 months ago - 7 years 2 months ago #143555 by rodw
Replied by rodw on topic VMC related HAL questions.
Carousel is a standard Linuxcnc component and is thus fully documented. The "latest" version of linuxcnc is 2.9 so this is the latest document of Carousel

linuxcnc.org/docs/devel/html/man/man9/carousel.9.html

If you type man carousel.comp you should get this document.
Last edit: 7 years 2 months ago by rodw.
The following user(s) said Thank You: CNCDoc

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #143557 by CNCDoc
Replied by CNCDoc on topic VMC related HAL questions.

andypugh wrote:

sspeed33317 wrote: 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
Code:
[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/
4) Put the toplevel.py and remap.py files in your config directory.

And that should be it.

Do you need spindle alignment too?


Okay then I have misunderstood. Thought it was "carousel.comp" the whole tool change sequence was placed ..
The actual tool change sequence is located in "Toolchanges.ngc"?

Is the cited post the correct instructions for implementing the tool change sequence?

I just need to set an output for spindle origination.

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #143562 by andypugh
Replied by andypugh on topic VMC related HAL questions.

CNCDoc wrote: Okay then I have misunderstood. Thought it was "carousel.comp" the whole tool change sequence was placed ..
The actual tool change sequence is located in "Toolchanges.ngc"?


In the example, config, yes. It could be handles with classic ladder, or with a Python remap, but anything that requires axis movement or M19 spindle orient is most readily done with a G-code remap.


Is the cited post the correct instructions for implementing the tool change sequence?
I just need to set an output for spindle origination.


I think it is close to what you seem to need.
If your spindle drive controls orient internally then you can use the M19 outputs to control the orient. (ignoring the angle output, just handshaking with spindle.0.orient and spindle.0.is-oriented )
The following user(s) said Thank You: CNCDoc

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #143780 by CNCDoc
Replied by CNCDoc on topic VMC related HAL questions.
Hi almost made the tool change work.

Have some problems.
Do not get the photocell to see that there is no tool in the tool changer before the arm goes in to work properly.

The input on 7i77 works.

Has made the following connections:

M66 P5 L3 Q2 ; Check if mag pos is empty change to L0?
o103 if [#5399 EQ -1]
(MSG, Tool in Magazine! 03)


net pos-is-empty-mag hm2_7i92.0.7i77.0.0.input-29 motion.digital-in-05 #Carousellposempty


when I use M68 E0 Q {pocket number} M64 P0 to start the carousel and M65 P0 to stop it. Positioned carousel in the correct position but when I use with M6 T1 it stays on T2 instead. Haven't been able to look at so much yet.

Then the carousel continues to position when the emergency stop is reset.

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #143806 by andypugh
Replied by andypugh on topic VMC related HAL questions.

CNCDoc wrote: Do not get the photocell to see that there is no tool in the tool changer before the arm goes in to work properly.

The input on 7i77 works.

Has made the following connections:

M66 P5 L3 Q2 ; Check if mag pos is empty change to L0?
o103 if [#5399 EQ -1]
(MSG, Tool in Magazine! 03)

Should this maybe be an L0? Just read the status of the photocell and act accordingly? L3 waits until the pin goes high, but your code will wait 2 seconds if it is low, which seems like a waste of time?

when I use M68 E0 Q {pocket number} M64 P0 to start the carousel and M65 P0 to stop it. Positioned carousel in the correct position but when I use with M6 T1 it stays on T2 instead. Haven't been able to look at so much yet.


That's odd. Can you check what pocket number the carousel comp is getting at its input pin with halmeter?
Which version of carousel are you using? (ie, from which LinuxCNC version?)

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago - 7 years 1 month ago #143878 by CNCDoc
Replied by CNCDoc on topic VMC related HAL questions.
Which version of carousel are you using?
I use carousel from the following post:

post=67358

andypugh wrote: This version of carousel.comp should work for your turret.
You will need to install it with "sudo halcompile --install carousel.comp"
If you get a message that halcompile does not exist then look for linuxcnc-dev in the synaptic package manager.

In your particular case you will need to connect the input-pin-name....-not HAL pin to the carousel input pins, because your logic is inverted.

loadrt carousel encoding=bcd pockets=16 num_sense=5 bidirectional=2

Last edit: 7 years 1 month ago by CNCDoc.

Please Log in or Create an account to join the conversation.

Time to create page: 0.071 seconds
Powered by Kunena Forum