Jump to content
OMRON Forums

turbo pmac nc thread problem


mohsin ahmad
 Share

Recommended Posts

i am facing problem while i am trying to make threads on my lathe. actually it goes off track or its path while in threading mode.i have tried g32 and g76. here is my configuration for spindle and z axis. z axis has no backlash , max following error 0.003mm. ixx28=0, 10000 counts/ revolution.

 

for spindle

encoder counts 4096/rev

max spindle speed 1875rpm

i7042=3

i've checked c channel pulse .its fine and updating.

but problem is still there. threading goes off track about 0.1mm every round.

Link to comment
Share on other sites

  • Replies 13
  • Created
  • Last Reply

Top Posters In This Topic

Is the lead off by the exact amount (within the specs of the machine) every rev of the spindle?

 

steave i have checked it by removing the c channel pulse signal wire . still machine goes to threading mode . it means machine does not wait for c channel pulse. if it does not check c channel pulse then how it will make the healthy threads.

Link to comment
Share on other sites

Note that I7042 should only ever be 1 or 5. If the trigger is not correct the motion should be locked if triggered timebase is active. Something is not correct in the your code to setup triggered timebase

 

The triggered timebase is automatically setup in the “standard” files described next.

 

Thread mode is set in the G32 code which is also called by G76 (see next). The OVERRIDE.PLC looks at this.

 

LatheA.G:

=======================================================================================

OPEN PROG 1000 CLEAR //(at line 43 in text file)

 

. . .

 

// G32 THREAD CUT COORD SYS 1 /////////////////////////////////////////// (at line 1504 in text file)

N32000

READ(X,Z,U,W,E,F)

LINEAR

 

// Set flag in timebase PLC that indicates we are threading

THREAD_MODE = 1

 

// thread in linear mode and set slew rate to max

// set timebase to use threading so move is based on spindle revolutions

S_TIMEBASE_M == SEL_TIMEBASE_THREADING

TIMEBASE_M == THREAD_TIMEBASE

TIME_BASE_SLEW_I = MAX_SLEW

CS1_TIMEBASE_UNITS_I = 60000/VS_SPINDLE_MAX_LIM_M

VS_GGROUP1_1_M == 32

 

. . .

 

// arm thread process bits so thread cut starts on the (at line 1528 in text file)

// index pulse ( encoder C chanel) of the spindle encoder (the spindle looks for the arming to start the timebase)

(see SPINDLE.PLC below)

THREAD_PROC_BITS_M=$9

 

. . .

 

// G76 Multiple Repetitive threading (at line 2129 in text file)

//----------------------------------

N76000

READ(X,Z,U,W,I,E,F,R,P,Q,D) ; ALL MUST BE PASSED SO NO NEED TO CHECK

// X : Thread dia or radius

 

. . .

 

GOSUB 32000 X(X_POS) Z(Z_POS) U(X_RELIEF) W(Z_RELIEF) F(F_ARG_Q) E(F_ARG_Q) //(line 2267 & 2309)

 

. . .

 

CLOSE (line 3135)

//---------------------------------------------------

// This code is generated by Setup Program based on Axis information.

//STARTMOTIONPROG Position reporting program

 

 

The OVERRIDE plc uses the flag “THREAD_MODE” to setup PMAC for timebase also.

 

OVERRIDE.PLC:

=======================================================================================

OPEN PLC OVERRIDE CLEAR //(line 14)

WHILE (1<2)

 

. . .

 

IF (S_ROVRD_M != SEL_ROVRD_FEED) //(line 39)

AND(FPR_MODE_P = 1 OR THREAD_MODE = 1)

AND(S_SPND_M!=SEL_SPND_OFF)

AND(ABS(VS_SPINDLE_ACT_RPM_M)>5)

CS1_TIMEBASE_UNITS_I = MINUTES_MS / VS_SPINDLE_MAX_LIM_M

IF (TIMEBASE_M != THREAD_TIMEBASE)

AND(THREAD_MODE>0)

TIME_BASE_SLEW_I = MAX_SLEW

S_TIMEBASE_M = SEL_TIMEBASE_THREADING

TIMEBASE_M = THREAD_TIMEBASE

 

. . .

 

CLOSE //(line 86)

 

 

SPINDLE.PLC:

=======================================================================================

OPEN PLC SPINDLE CLEAR //(at line 13)

VS_SPINDLE_COUNTS_REV_M = 2000.00000 //(make seure these are correct for your spindle)

VS_SPINDLE_MAX_RPM_M = 6000

VS_SPINDLE_MAX_LIM_M = 6000

 

. . .

 

// ----------------Time Base Monitoring for Threading --------------- (line 40) .

IF (THREAD_PROC_BITS_M = $9)

THREAD_PROC_BITS_M = $B

ENDIF

 

. . .

 

// ----------------Spindle Speed WRT Spindle OVERRIDE --------------- . (line 96)(calculates thread scale)

SPINDLE_TEMP = SPINDLE_TEMP * VS_SPINDLE_OVERRIDE_M * 0.01

VS_SPINDLE_CMD_RPM_M = SPINDLE_TEMP

IF (VS_SPINDLE_CMD_RPM_M > VS_SPINDLE_MAX_RPM_M)

VS_SPINDLE_CMD_RPM_M = VS_SPINDLE_MAX_RPM_M

ENDIF

RTIF = VS_SPINDLE_COUNTS_REV_M*VS_SPINDLE_MAX_LIM_M/60000

IF (RTIF > 0)

IF (S_SPND_M = SEL_SPND_CW)

THREAD_SCALE_M = 16384 / RTIF

FPR_SCALE_M = 131072 / RTIF

ELSE

 

. . .

 

CLOSE //(line 151)

Link to comment
Share on other sites

Note that I7042 should only ever be 1 or 5. If the trigger is not correct the motion should be locked if triggered timebase is active. Something is not correct in the your code to setup triggered timebase

 

The triggered timebase is automatically setup in the “standard” files described next.

 

Thread mode is set in the G32 code which is also called by G76 (see next). The OVERRIDE.PLC looks at this.

 

LatheA.G:

=======================================================================================

OPEN PROG 1000 CLEAR //(at line 43 in text file)

 

. . .

 

// G32 THREAD CUT COORD SYS 1 /////////////////////////////////////////// (at line 1504 in text file)

N32000

READ(X,Z,U,W,E,F)

LINEAR

 

// Set flag in timebase PLC that indicates we are threading

THREAD_MODE = 1

 

// thread in linear mode and set slew rate to max

// set timebase to use threading so move is based on spindle revolutions

S_TIMEBASE_M == SEL_TIMEBASE_THREADING

TIMEBASE_M == THREAD_TIMEBASE

TIME_BASE_SLEW_I = MAX_SLEW

CS1_TIMEBASE_UNITS_I = 60000/VS_SPINDLE_MAX_LIM_M

VS_GGROUP1_1_M == 32

 

. . .

 

// arm thread process bits so thread cut starts on the (at line 1528 in text file)

// index pulse ( encoder C chanel) of the spindle encoder (the spindle looks for the arming to start the timebase)

(see SPINDLE.PLC below)

THREAD_PROC_BITS_M=$9

 

. . .

 

// G76 Multiple Repetitive threading (at line 2129 in text file)

//----------------------------------

N76000

READ(X,Z,U,W,I,E,F,R,P,Q,D) ; ALL MUST BE PASSED SO NO NEED TO CHECK

// X : Thread dia or radius

 

. . .

 

GOSUB 32000 X(X_POS) Z(Z_POS) U(X_RELIEF) W(Z_RELIEF) F(F_ARG_Q) E(F_ARG_Q) //(line 2267 & 2309)

 

. . .

 

CLOSE (line 3135)

//---------------------------------------------------

// This code is generated by Setup Program based on Axis information.

//STARTMOTIONPROG Position reporting program

 

 

The OVERRIDE plc uses the flag “THREAD_MODE” to setup PMAC for timebase also.

 

OVERRIDE.PLC:

=======================================================================================

OPEN PLC OVERRIDE CLEAR //(line 14)

WHILE (1<2)

 

. . .

 

IF (S_ROVRD_M != SEL_ROVRD_FEED) //(line 39)

AND(FPR_MODE_P = 1 OR THREAD_MODE = 1)

AND(S_SPND_M!=SEL_SPND_OFF)

AND(ABS(VS_SPINDLE_ACT_RPM_M)>5)

CS1_TIMEBASE_UNITS_I = MINUTES_MS / VS_SPINDLE_MAX_LIM_M

IF (TIMEBASE_M != THREAD_TIMEBASE)

AND(THREAD_MODE>0)

TIME_BASE_SLEW_I = MAX_SLEW

S_TIMEBASE_M = SEL_TIMEBASE_THREADING

TIMEBASE_M = THREAD_TIMEBASE

 

. . .

 

CLOSE //(line 86)

 

 

SPINDLE.PLC:

=======================================================================================

OPEN PLC SPINDLE CLEAR //(at line 13)

VS_SPINDLE_COUNTS_REV_M = 2000.00000 //(make seure these are correct for your spindle)

VS_SPINDLE_MAX_RPM_M = 6000

VS_SPINDLE_MAX_LIM_M = 6000

 

. . .

 

// ----------------Time Base Monitoring for Threading --------------- (line 40) .

IF (THREAD_PROC_BITS_M = $9)

THREAD_PROC_BITS_M = $B

ENDIF

 

. . .

 

// ----------------Spindle Speed WRT Spindle OVERRIDE --------------- . (line 96)(calculates thread scale)

SPINDLE_TEMP = SPINDLE_TEMP * VS_SPINDLE_OVERRIDE_M * 0.01

VS_SPINDLE_CMD_RPM_M = SPINDLE_TEMP

IF (VS_SPINDLE_CMD_RPM_M > VS_SPINDLE_MAX_RPM_M)

VS_SPINDLE_CMD_RPM_M = VS_SPINDLE_MAX_RPM_M

ENDIF

RTIF = VS_SPINDLE_COUNTS_REV_M*VS_SPINDLE_MAX_LIM_M/60000

IF (RTIF > 0)

IF (S_SPND_M = SEL_SPND_CW)

THREAD_SCALE_M = 16384 / RTIF

FPR_SCALE_M = 131072 / RTIF

ELSE

 

. . .

 

CLOSE //(line 151)

 

 

if you see this example it is using in ect $AF8018 for motor 4. but in my case it is $A7804. but i am using turbo pmac so it should be $AF8018.

Setup On-line Command

I8008=$AF8018 ; Triggered time base from PMAC2 channel 4

I8009=64 ; TBSF=16384/256

I7042=1 ; Servo IC 0 Channel 4 trigger on rising index

I5193=@I8009 ; C.S.1 use I8009 result for time base

M403->X:$07801B,0,24,S ; Channels’ captured position register

Motion Program Segment

DWELL 0 ; Stop any lookahead

I8008=$9F8018 ; Freeze the time base

P403=M403 ; Dummy read to ensure capture logic reset

X10 ; Calculate first move

PLC Program Segment

IF (I8008=$9F8018) ; If frozen

I8008=$BF8018 ; Then arm

ENDIF

 

 

and in OEM.H there are definitions for ECT

#define RAPID_TIMEBASE2 $0010F3

->#define THREAD_TIMEBASE_ADR Y:$00350B,0,24,S // I8010 11th entry of modified ECT

#define THREAD_TIMEBASE $00350C // I8011 12th entry of modified ECT

->#define THREAD_PROC_BITS_ADR Y:$00350B,20,4 // I8010 11th " " " "

#define THREAD_SCALE_ADR Y:$00350C,0,24,S // I8011 12th " " " "

#define FPR_TIMEBASE $0010F4 // Open Usage Register

#define FPR_TIMEBASE_ADR X:$0010F4,0,24,S

#define SPND_TIMEBASE_ADR X:$00350A,0,24,S // I8009 10th entry of standard ECT

#define FPR_SCALE_ADR Y:$00350A,0,24,S // I8009 10th entry of standard ECT

// the above uses ENCODER 4 by default

 

if you follow the arrow key . i think there is a problem in address.

Link to comment
Share on other sites

turbo SRM page 239. i think it says address starts from X.

 

Triggered Time Base ($9, $A, $B): A triggered time-base entry is like a regular untriggered time-base

entry, except that it is easy to freeze the time base, then start it exactly on receipt of a trigger that captures

the starting master position or time.

In a triggered time-base entry, the first setup line (I-variable) contains a 9 A or B in the method digit (bits

20 – 23), depending on its present state. It contains the address of the source register in bits 0 – 18. The

source register for triggered time base must be the starting (X) address for one of the machine interface

channels of a Servo IC. The bit 19 mode switch must be set to 0 if a PMAC-style Servo IC (DSPGATE)

is addressed; it must be set to 1 if a PMAC2-style Servo or MACRO IC (DSPGATE1 or DSPGATE2) is

addressed. Note that setting bit 19 to 1 changes the second hex digit of the I-variable from 7 to F.

Link to comment
Share on other sites

The settings are correct. They assume a “standard” ECT setup (created in ENCODER.TAB):

(note that I have added the first four standard entries for completeness assuming Turbo PMAC2)

 

// Encoder Conversion Table for Lathe with standard 1/T feedback type.

// For any other feedback device user will have to change this file for

// Lathe FPR mode to work Correctly.

// Typical Lathe Motor 1, 3 and 4.

// we will add 4 dummy entries in Encoder table.

//---------------------------------------------------------

//I8000=$78000 //$3501

//I8001=$78008 //$3502

//I8002=$78010 //$3503

//I8003=$78018 //$3504

I8004=$78100 //Dummy ECT Entry 4 $3505

I8005=$78108 //Dummy ECT Entry 5 $3506

I8006=$78110 //Dummy ECT Entry 6 $3507

I8007=$78118 //Dummy ECT Entry 7 $3508

I8008=$403504 //$3509

I8009=$64 //$350A

I8010=$A78018 //$350B

I8011=$F5C //$350C

I8012=0

 

If you have modified the ECT to have a different structure then you will need to edit this file.

Link to comment
Share on other sites

ok fine.. but this is not understandable

->#define THREAD_TIMEBASE_ADR Y:$00350B,0,24,S // I8010 11th entry of modified ECT

->#define THREAD_PROC_BITS_ADR Y:$00350B,20,4 // I8010 11th " " " "

whatever you have sent me i have checked everything is fine and according to standard .so machine should stop stop and wait for trigger pulse while there is no pulse signal wire attached .

one more thing according to manual I8010=$AF8018 for turbo. but in encoder.tab file it is $A78018 this is for pmac style .

Link to comment
Share on other sites

This should not be a problem as long as it was done through the NC Setup program.

 

I will research this - I'm not sure about it:

->#define THREAD_TIMEBASE_ADR Y:$00350B,0,24,S // I8010 11th entry of modified ECT

 

This is correct:

->#define THREAD_PROC_BITS_ADR Y:$00350B,20,4 // I8010 11th " " " "

Link to comment
Share on other sites

The settings are correct. They assume a “standard” ECT setup (created in ENCODER.TAB):

(note that I have added the first four standard entries for completeness assuming Turbo PMAC2)

 

// Encoder Conversion Table for Lathe with standard 1/T feedback type.

// For any other feedback device user will have to change this file for

// Lathe FPR mode to work Correctly.

// Typical Lathe Motor 1, 3 and 4.

// we will add 4 dummy entries in Encoder table.

//---------------------------------------------------------

//I8000=$78000 //$3501

//I8001=$78008 //$3502

//I8002=$78010 //$3503

//I8003=$78018 //$3504

I8004=$78100 //Dummy ECT Entry 4 $3505

I8005=$78108 //Dummy ECT Entry 5 $3506

I8006=$78110 //Dummy ECT Entry 6 $3507

I8007=$78118 //Dummy ECT Entry 7 $3508

I8008=$403504 //$3509

I8009=$64 //$350A

I8010=$A78018 //$350B

I8011=$F5C //$350C

I8012=0

 

If you have modified the ECT to have a different structure then you will need to edit this file.

I8010=$A78018 //$350B

The bit 19 mode switch must be set to 0 if a PMAC-style Servo IC (DSPGATE)

is addressed; it must be set to 1 if a PMAC2-style Servo or MACRO IC (DSPGATE1 or DSPGATE2) is addressed. Note that setting bit 19 to 1 changes the second hex digit of the I-variable from 7 to F. TurboSRM page 240.

I8010=$AF8018.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...