Brother carousel encoders

More
20 Sep 2021 08:43 - 20 Sep 2021 08:52 #221178 by beakersBestFriend
Hi, I just finished retrofitting a Brother TC225 with LinuxCNC and QtPyVCP , still using the old servo drives .
What has been a little strange to me from the beginning , was the way the carousel encoder encodes the carousel  position.

I'm curious, if this is done the same way on all Brother Tapping centers ?!
Please have a look at the pictures attached.

The disk has five tracks, red is a "slowdown, close to target" signal for each pocket that tells the two speed carousel motor to change to
low speed not to overrun the target pocket  position.
Four lines (green) are binary encoded, representing the pocket number.
These four lines have a very small gap, so they act as "in position", too.
BTW1: I checked this out with the original control 
BTW2: They are offset by some degree, because the photo sensors are mounted this way on the pcb

I would have expected this to be the other way around.
Wide gaps for the pocket number encoding and a small gap as "in position"and "pocket number vaild".
The wide pocket gaps could easily be used to slow down, because I have a absolute position of the coming pocket in advance.
This could be handled by the "normal" LinuxCNC carousel component .

Because I wanted to be able to return to the old control just by changing the servo and I/O connectors,
I solved this with a new carousel software component.
At startup i read the absolute position from the encoder lines and increment/decrement the value (depending on the
direction of rotation) with the rising "slowdown" signal.
If the next pocket is the target pocket, slowdown is passed to the carousel motor.
When it stops in target position  the incremented value is compared to the absolute value from the four encoder lines.
A warning is thrown, if they do not match.

Wrote a test g-code that changes tools for half an hour. Unfortunately the warning is generated for approx 0.5% of the changes.

IMHO the cause is, that I do not have a information when to read the four encoder lines exactly.
I'm already doing a 3 times overscan. I could  extend this, but it would slow down the toolchange.

I'm about to change the encoder disk with a new one made of 1mm black GFK.
It's not a big deal from mechanical or software point of view.
Because I'm free in the choice of how to do the coding on a new disk (binary, gray, gray with rollover capability, ...) I would like
to do it in the way other Brother tapping centers do it.
I'm quite sure that more modern machines (my TC225 is from 1988) do the encoding in a smarter way.

So, if there is anybody out there knowing what kind of carousel encodings have been used on Brother tapping centers,
it would be nice if he shares his knowledge.

If there is someone in need for the software component that handles the kind of TC225 encoders, I would be glad to share it.

Thanks in advance.

Rainer
Attachments:
Last edit: 20 Sep 2021 08:52 by beakersBestFriend. Reason: improved text formatting, offered my solution.

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

More
09 Oct 2021 20:28 #222685 by Dinuka_Shehan
Use omron encoder.

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

More
12 Oct 2021 21:34 #222976 by andypugh
Replied by andypugh on topic Brother carousel encoders
I agree, that's wierd. I don't know how it knows when it has seen the full set of holes and can stop. Maybe the "slowdown" track has an edge used as the "strobe"?

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

More
25 Nov 2021 18:54 #227579 by ihavenofish
hi, the brother carousel is really easy, but theres a few tricks.

you have 4 tracks on it that encode the tool position. and the deceleration track.

what you havent seemed to figure out is the way the decel track works.

you continuously read that track when the carousel is in motion - use it to count spaces if you like. then when you are at the tool you want, you read again for the decel, and then hit brake. HOWEVER, you need to dwell 200ms before hitting the brake after reading the decel track, or it would often stop too early (seems to be whats happened to you). every machine may brake differently due to resistor variation, so yo might need 150ms, or 250. .but if you start with 200, you should be able to get in the right zone quickly. The point is, you need to time the braking so its hitting the right spot on the geneva mechanism.

with the decel track dwell, and closest path tool seeking, my tool changer was 100% reliable - i just never got to the point where my Z would move before i had to sell off the machine.

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

More
25 Nov 2021 19:09 - 25 Nov 2021 19:10 #227580 by ihavenofish
i was wrong i have 100ms.

here is my tool change code - entirely in a subroutine - minus any actual z motion as mentioned.

o<toolchange> sub

m66 P11 L0 Q1
#1=#5399
m66 P12 L0 Q1
#2=#5399
m66 P13 L0 Q1
#3=#5399
m66 P14 L0 Q1
#4=#5399

#<currenttool>=[[#1*1]+[#2*2]+[#3*4]+[#4*8]]

#<counter>=0

#<tool> = #<selected_tool>

// #<tool> = 9

#<goodtogo>=1

o180 if [#<currenttool> EQ 0]
	(MSG, BROKEN!!!)
	#<tool>=#<currenttool>
	#<goodtogo>=0
o180 endif

o120 if [#<tool> GT 0]
	#<newtool>=#<tool>
o120 else
	(MSG, failed because no tool requested)
	#<newtool>=#<currenttool>
	#<goodtogo>=0
o120 endif

#<movepos>=[#<newtool>-#<currenttool>]
#<absmovepos>=ABS[#<movepos>]


m66 P16 L0 Q1
#<atcready>=#5399

o111 if [#<absmovepos> GT 5]
	#<shortmovepos>=[ABS[10-#<absmovepos>]]
o111 endif

#<finalmovepos>=#<absmovepos>

o106 if [#<movepos> LT 0]
	M64 p4
	o119 if [#<absmovepos> GT 5]
	M65 p4
	#<finalmovepos>=#<shortmovepos>
	o119 endif
o106 else
	M65 p4
	o129 if [#<absmovepos> GT 5]
	M64 p4
	#<finalmovepos>=#<shortmovepos>
	o129 endif
o106 endif

o199 if [#<goodtogo> EQ 1]
	G53 G1 Z25.34 F5
	o112 if [#<atcready> EQ 0]
		o104 if [#<currenttool> NE #<newtool>]
			m64 p3
			
			o101 while [#<counter> LT [#<finalmovepos>]]
				m66 P10 L1 Q1
				#<counter>=[#<counter>+1]
			o101 endwhile
			g4 p.1
			m65 p3
			m65 p4
		o104 else
			(MSG, failed because you are already on that tool)
		o104 endif
	o112 else
		(MSG, failed because not at ATC HOME)
	o112 endif
	G53 G1 Z17.72 F5
o199 else
	(MSG, YOU FAILED< I AINT MOVING!!!!)
o199 endif

m66 P11 L0 Q1
#1=#5399
m66 P12 L0 Q1
#2=#5399
m66 P13 L0 Q1
#3=#5399
m66 P14 L0 Q1
#4=#5399
#<wherewenow>=[[#1*1]+[#2*2]+[#3*4]+[#4*8]]

o150 if [#<newtool> NE #<wherewenow>]
	(MSG, failed because we are on the wrong tool or between stations)	
o150 elseif [#<wherewenow> EQ 0]
	(MSG, STILL BROKEN!!!)
o150 else
	(MSG, GOOD!!!!)
	#<tool_in_spindle>=#<selected_tool>
o150 endif

o<toolchange> endsub

m2
Last edit: 25 Nov 2021 19:10 by ihavenofish.

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

More
29 Dec 2023 18:41 - 30 Dec 2023 04:48 #289325 by BerTiN
Replied by BerTiN on topic Brother carousel encoders
Hello ihavenofish. Did you entirely wrote this subroutine ?
Is it some LinuxCNC o-code or some Python (I'm sorry, I'm very new to programming, LinuxCNC, and even Linux, and I just received my TC-225, with broken control, that I want to retrofit.)

Cheers. 
Last edit: 30 Dec 2023 04:48 by BerTiN.

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

More
31 Dec 2023 20:13 - 31 Dec 2023 20:16 #289446 by ihavenofish
Hi, I wrote the carousel routine as an o-sub, but not the axis motion to go with it yet. Someone else here has done the motion and limit swapping parts. The code is on a drive that was in the machine, but I currently can't go fetch it. It may be posted somewhere in the "tc229 adventure" thread but I'm not sure. I think it was "icebear" that did it.

I can explain how it works roughly from memory.
As you can see in the o-sub I created some variables to read and write: I read the 5 encoder tracks on inputs, and I write to outputs controlling the "brake pack" running the atc motor which I think is direction and on/off. turning it off immediately shorts to a resistor, hence the "brake".

The encoder is 4 bit BCD format, so you add those up to know what pocket you are on.

The basic procedure is:
1 - read encoder position
2 - determine the shortest path to the new tool
3 - spin the carousel in that direction
4 - *count* the deceleration track (one count, is one pocket position)
5 - when you get to the right pocket, read the deceleration track again, then wait (in my case) 200ms, and then hit the brakes.
6 - read the encoder position to make sure you have actually landed in the right spot. You will need to play with brake timing to get it to stop in just the right position.

I put a lot of error handling in to make sure nothing would move unless you were on the right tool, in position on the upper limits, etc.

BEFORE this code, you need to add code that swaps the limits form the lower to the upper, then moves the Z up to the first limit, orients the spindle, then moves up to the top "atc" limit.

Then AFTER my code you move back down to the lower limit, and swap the limits back to normal, and then resume the main program.

This gets a basic reliable operation. Fancier modes of operation I want to implement are single motion (orient on the way up as a coordinated A axis), and repositioning the table during the carousel motion.
Last edit: 31 Dec 2023 20:16 by ihavenofish.

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

Moderators: cncbasher
Time to create page: 0.102 seconds
Powered by Kunena Forum