Small victory in the war against the Cincinnati cinturn 12u

More
15 Nov 2022 15:40 #256778 by andypugh
Why not just use the built-in decoding of the carousel comp?
Set num-sense to 3, connect the switches to IO pins and then to the sense pins in HAL, wire up the strobe the same way (to the carousel.0.strobe pin).

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

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

More
15 Nov 2022 21:46 #256802 by smc.collins

andypugh post=256778 userid=723Why not just use the built-in decoding of the carousel comp?
Set num-sense to 3, connect the switches to IO pins and then to the sense pins in HAL, wire up the strobe the same way (to the carousel.0.strobe pin).

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



  That was indeed my exact plan. I just don't know how the encoding works ? is it absolute or relative ? does it home ? having a persistent machine state is my preference, so I don't have to constantly reprogram my tools every time I restart the machine. I'm also fleshing out notes for a good tutorial, for Linux CNC and pnconf. 

Is there a document explaining the binary encoding or are all BCD enodings the same ? Anyways, I have a PLC engineer coming tonight, and I think we should be able to get this working. 

I am looking at the 2 speed gear box stuff right now 

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

More
16 Nov 2022 00:06 #256818 by andypugh
The encoding is absolute. The carousel component should always know which tool is selected with no need to home.

For a lathe you probably don't need a remap, just connect iocontrol.0.selected-pocket to the carousel.0.pocket-number, iocontrol.0.tool-change to the carousel.0.enable and carousel.0.ready to iocontrol.0.tool-changed.

(You probably need to make sure that your G-code moves to a safe place to tool-change. A mill can just retract to max-Z in general but that doesn't always work for a lathe.

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

More
16 Nov 2022 02:30 - 16 Nov 2022 03:26 #256826 by smc.collins
I was thinking of setting it to call a offset, then just set the offset during setup.

Touch off Z
Touch off X

Set Gxx as the offset, I am not super familiar with G code so I have been trying to figure which type of Gcode to call here. I have been reading the G code reference a lot. I can also program the tool change position in the post processor to. I am thinking g53  and set the potion clear of the work, this will save cycle time and the potential for a accident. 

Defective relay board stalled the evening, but we did make some progress with ladder programming, now I am getting it all wired up in the hal files. I did fire up the bcd switches and get a station number. 



"For a lathe you probably don't need a remap, just connect iocontrol.0.selected-pocket to the carousel.0.pocket-number, iocontrol.0.tool-change to the carousel.0.enable and carousel.0.ready to iocontrol.0.tool-changed."

Can you explain this in a bit more detail. It's just looking like a lot of IO calls with no particular rationality
Last edit: 16 Nov 2022 03:26 by smc.collins.

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

More
16 Nov 2022 12:37 - 16 Nov 2022 12:39 #256852 by andypugh
I don't think you need any ladder logic. But if you want to use Ladder to control the toolchanger that will work. At that point you would not need the carousel component. Do you plan to use ladder programming or use the carousel component?

For the moment I will ignore the fact that lathes normally change tools with just a T command not an M6.

When LinuxCNC encounters a T command it puts the pocket number on the pin iocontrol.0.tool-prep-pocket and sets the pin iocontrol.0.tool-prepare

The tool changer logic is expected to monitor these pins and act accordingly.

When iocontrol.0.tool-prepared is set to true, execution continues.

It is very common to connect these two pins so that execution passes straight through while the changer is selecting the next tool. eg:
net T-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

When LinuxCNC sees an M6 command, it pauses and sets the pin iocontrol.0.tool-change and waits for iocontrol.0.tool-changed to go high.

So, you use iocontrol.0.tool-change to activate the carousel motion, and when it has done its thing, you use carousel to set iocontrol.0.tool-changed, and programme execution continues.
net start-tool-change iocontrol.0.tool-change => carousel.0.enable
net tool-change-finished carousel.0.ready => iocontrol.0.tool-changed

With the HAL connections here your G-code would need t use the M6 Tnn G43 combination for each tool change. Using T-only needs a remap and is probably best handled later.
Last edit: 16 Nov 2022 12:39 by andypugh.

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

More
16 Nov 2022 13:33 #256858 by smc.collins
i have the chuck, the tailstock , parts cather etc and i have multiple machines that need refits. also he's a automation engineer, i want to automate everything i can. finding people is Hard .

he's also wanting to learn Linux cnc for custom projects, it's a win for everyone.

I'll digest the t commands, I'm going to swap the tailstock for a sub spindle soon. i might want to use the m6 command i have mapped and modify my post

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

More
17 Nov 2022 22:10 #256971 by smc.collins
My post processor calls a g53 command on every tools change, so I am not terribly worried about the Gcode side of programming the lathe.

I think I will stick with the current m6 remap for now.

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

More
18 Nov 2022 03:18 #257001 by smc.collins
Note: Using POSIX realtime
HAL: ERROR: function 'conv-float-s32' not found
./toolchangeBCD.hal:4: addf failed
7761
Stopping realtime threads
Unloading hal components
RTAPI_PCI: Unmapped 65536 bytes at 0x7f2242f56000
Note: Using POSIX realtime


ok, I've read the through threads, why is this working in sim yet failing here ???
Attachments:

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

More
18 Nov 2022 10:34 #257025 by tommylight
Seems you have in hal:
addf conv-float-s32
But there is no :
loadrt conv-float-s32
Try adding the last line in hal, before the addf line.
The following user(s) said Thank You: smc.collins

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

More
18 Nov 2022 14:06 #257037 by andypugh
The conv instances are numbered (starting at zero)

linuxcnc.org/docs/stable/html/man/man9/conv_float_s32.9.html

Try
addf conv-float-s32.0   servo-thread
The following user(s) said Thank You: smc.collins

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

Moderators: piasdom
Time to create page: 0.382 seconds
Powered by Kunena Forum