how to cheat carousel component

More
16 Dec 2021 20:48 - 16 Dec 2021 22:19 #229202 by wellingtoncsouza
hello friends, this is my first post, but i'm registered and follow the forum for a long time, i have a problem that has taken my sleep.
I use linuxcnc on a Mazak CNC lathe, with an 8-position hydraulic turret, however, I don't know why, the turret's encoder has 16-positions.
I can work with the machine, using the carousel component, but I can only use the odd tools, if I call an even numbered tool, I have an error and the turret stops between two positions.
I need to find a way to lie to the component like this:

0000 => 0000
0001 => 0001
0010 => 0000
0011 => 0010
0100 => 0000
0101 => 0011
0111 => 0000
1000 => 0100
1001 => 0000
1010 => 0101
1011 => 0000
1100 => 0111
1101 => 0000
1111 => 1000
it looks so easy, but i can't find the solution, i tried using mux16 => conv-s32-u32=>demux, but i got an error when trying to convert s32 to u32, and the demux doesn't accept s32 inputs, and mux16 doesn't has output u32.

if anyone has an idea, i would be very grateful

forgive the bad english.

greetings from Brazil
Last edit: 16 Dec 2021 22:19 by wellingtoncsouza.

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

More
17 Dec 2021 15:32 #229297 by BigJohnT
I use ClassicLadder to control my turret on the Hardinge CHNC.
All my files are on my web site.
gnipsel.com/shop/hardinge/hardinge.xhtml

JT
The following user(s) said Thank You: wellingtoncsouza

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

More
17 Dec 2021 16:50 #229308 by BigJohnT
I'm pretty sure the lut5 component can do what you need.

I think your binary list is missing a few entries
 D   B       B      D
 0 > 0000 => 0000 > 0
 1 > 0001 => 0001 > 1
 2 > 0010 => 0000
 3 > 0011 => 0010 > 2
 4 > 0100 => 0000
 5 > 0101 => 0011 > 3
 7 > 0111 => 0000
 8 > 1000 => 0100 > 4
 9 > 1001 => 0000
10 > 1010 => 0101 > 5
11 > 1011 => 0000
12 > 1100 => 0111 > 7
13 > 1101 => 0000
15 > 1111 => 1000 > 8

 D   B       B      D
 0 > 0000 => 0000 > 0
 1 > 0001 => 0001 > 1
 2 > 0010 => 0000
 3 > 0011 => 0010 > 2
 4 > 0100 => 0000
 5 > 0101 => 0011 > 3
 6 > 0110 => ?
 7 > 0111 => 0000
 8 > 1000 => 0100 > 4
 9 > 1001 => 0000
10 > 1010 => 0101 > 5
11 > 1011 => 0000
12 > 1100 => 0111 > 7
13 > 1101 => 0000
14 > 1110 => ?
15 > 1111 => 1000 > 8

JT
The following user(s) said Thank You: wellingtoncsouza

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

More
17 Dec 2021 16:53 #229309 by BigJohnT
I think this is what you meant...
 D   B       B      D
 0 > 0000 => 0000
 1 > 0001 => 0001 > 1
 2 > 0010 => 0000
 3 > 0011 => 0010 > 2
 4 > 0100 => 0000
 5 > 0101 => 0011 > 3
 6 > 0110 => 0000
 7 > 0111 => 0100 > 4
 8 > 1000 => 0000
 9 > 1001 => 0101 > 5
10 > 1010 => 0000
11 > 1011 => 0110 > 6
12 > 1100 => 0000
13 > 1101 => 0111 > 7
14 > 1110 => 0000
15 > 1111 => 1000 > 8

JT
The following user(s) said Thank You: wellingtoncsouza

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

More
17 Dec 2021 17:39 #229315 by wellingtoncsouza
yes, that was exactly it, I must have gotten involved with the numbers when typing

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

More
17 Dec 2021 17:45 #229318 by wellingtoncsouza
Thanks! BigJohnT
I managed to solve the problem, changing the sensor type of the carousel from binary to single, and using the 8 demux outputs, 1 for each position of the turret, I'll attach my hal file, it might be interesting for someone who has a 16-position encoder in an 8-position turret 

File Attachment:

File Name: my_LinuxCN...hine.hal
File Size:16 KB
Attachments:
The following user(s) said Thank You: BigJohnT, tommylight

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

Time to create page: 0.101 seconds
Powered by Kunena Forum