# Teach Programm for Easy Teaching

• Hi

I am pretty new to Fanuc programming and I'm now on an existing program which should be improved. The program actually handles pretty easy pick and place motions which are executed in different loops and also storing points in position registers during the program.
With this structure it is the problem, that the guys that work on the robot can not easily re-teach points. Their procedure is to let the robot run and stop at the point where they want to reteach. Unfortunately this is often on a position register, which they can not touchup.

So my idea is to write some kind of a teach program, where they can go from point to point and reteach these. The problem is that I do not have enough position registers to copy the points from the "teach"-program to the "run"-program. Is there another way of solving this problem or a smoother way of doing all this?

• You can make a program using only 1 position register and multiple points. Just set the PR to each point you want to move. This way you only utilize 1 PR. The point position data is local to the program.

For Example

1:PR[1]=P[1];
2: ;
3: L PR[1] 100 mm/sec FINE ;
4: ;
5: PR[1]=P[2];
6: ;
7: L PR[1] 100 mm/sec FINE ;
8: ;
98: JMP LBL[999];
99: ;
100: ! Teaching Point Section ;
101: L P[1] 100 mm/sec FINE;
102: ;
103: L P[2] 100 mm/sec FINE;
104: ;
105: L P[3] 100 mm/sec FINE;
106: ;
107: LBL [999];

• This is acutally the way the program is built up till now. The thing is, that with this structure it can be difficult to teach the points. Our workers are usually running the program until the robot is standing in a certain position and stop it then to watch where the coursor stoped. They tried to teach there but usually this was a PR. So the changes did not hold for long
This is why I came up with a programming section like the following:

42: !TEACH POSITIONS ;
43: R[57:Teach Point 1]=14 ; -> change here
44: R[58:Teach Flag]=1 ;
45: PR[30:DynTeachPoint]=PR[100:NULL] ;
46: PR[30:DynTeachPoint]=P[R[57]] ;
47: CALL TEACH0024 ;
48:L P[14] 5mm/sec FINE ; -> change here
49: PAUSE ;
50: R[58:Teach Flag]=2 ;
51: PR[30:DynTeachPoint]=P[R[57]] ;
52: CALL TEACH0024 ;
53: PAUSE ;
54: R[58:Teach Flag]=3 ;
55: R[59:Teach Point 2]=R[57:Teach Point 1]+100 ;
56: PR[30:DynTeachPoint]=PR[100:NULL] ;
57: PR[30:DynTeachPoint]=P[R[59]] ;
58: CALL TEACH0024 ;
59:L P[114] 40mm/sec FINE ; -> change here
60: PAUSE ;
61: R[58:Teach Flag]=4 ;
62: PR[30:DynTeachPoint]=P[R[59]] ;
63: CALL TEACH0024 ;
64: PAUSE ;

With this procedure one full motion can be done without searching it in the full program. The user just has to change the position numbers where I marked it with "-> change here". The program TEACH0024 has different prepositions and points to do depending on the R[58:Teach Flag].

What do you guys think about this? Is this a common thing to solve this issue like this?

Unfortunately I ran into a different problem now. Somehow the points after line 54 are showing me the error "position not reachable" after a tool change. If I reteach, the position data is exactly the same but then everything works perfect. The used tool is the same for all four motions but only motion 3 and 4 are giving me the error. Do you have an idea where I could look for solving this error?

• I am curious. Why is it necessary to constantly reteach points?
Do you need recipes or offset control?

• Reteaching points should hopefully stay a rare functionality. But we are often teaching new parts to our system and this is why I made a basic structure for our program which can be copied. The only thing that needs to be changed then for a new part is that the points need to be reteached. This procedure should be made as easy and fast as possible.

Often we also see only after a certain amount of time, that one point is not exactly how we expected and ends sometimes in errors. Like this we can easily reteach this point.

The last question from my post was actually a bug in the tool chosing routine. So its solved.

• Sounds to me like you need better descriptions on your PR's. This way they just touch up the PR in the data structure. I don't see the need to make another program for this.

What I have done at other places is to make a diagram of the part, and the PR's associated with that part. Then the guys/gals know exactly which PR is where.

I think you are actually making this harder than it needs to be with creating another program, for a simple touchup.

• That's right, they just touchup the PR and ask themselves why the correction is not working.

...
What I have done at other places is to make a diagram of the part, and the PR's associated with that part. Then the guys/gals know exactly which PR is where.
...

I guess you mean a diagram of the points right?