User Tools

Site Tools


mycnc:rtcp_setup

RTCP setup

1. Arm length for RTCP correction is stored in Global Variable #7215 (#define GVAR_RTCP_SHOULDER 7215). RTCP correction calculated depends on Arm Length and tilt A and B angle. RTCP correction should be disabled BEFORE change the register value. Changing the value while RTC correction active will leads to lost position and mechanical hit.

2. CNC controller register 0x80 represents current RTCP status.
Writing “2” to this register will enable RTCP correction.
Writing “0” to the register will disable RTCP correction.

Switching RTCP Enable/Disable should be done in the vertical position (A=0, B=0) only. Real machine position with and without RTCP correction is the same for vertical. In this case, machine position will not be changed while RTCP switching.

We used M101.plc procedure to disable(OFF) RTCP correction

M101.plc
#include pins.h
#include vars.h
 
main()
{
  timer=0;
 
  command=0x80; //RTCP Control register
  parameter=0;  //RTCP OFF
  message=PLCCMD_SET_CNC_VAR;
  timer=50; do{timer--;}while(timer>0);//50msec pause
  exit(99);
};

and M102.plc procedure to enable(ON) RTCP correction

M102.plc
#include pins.h
#include vars.h
 
main()
{
  timer=0;
 
  command=0x80; //RTCP Control register
  parameter=2;  //RTCP ON
  message=PLCCMD_SET_CNC_VAR;
  timer=50; do{timer--;}while(timer>0);//50msec pause
  exit(99);
};

4. The following macro can be used to calculate and store in the register #7215 current Arm Length for RTCP correction

M250
(Tool length measure for RTCP control macro)
#100= 800.0 (Speed Z)
#101= 800.0 (Speed XY)
G28.2 X0 Y0 Z0(save current position into Position Register #1)
G53 G0 Z[#5433-1.0] F#100 (Move up to safe position)
G53 G0 X#5471 Y#5472 F#101 (move to Tool Sensor Position)
 
M88 P#10 L#11 (Smooth stop if sensor activated)
G91 G0 Z-100 F1000 (First fast probing)
G04 P0.1
G91 G0 Z3.0 F1000 (Move up to Gap)
M89 P#10 L#11 (Stop if sensor activated)
G91 G0 Z-6.0 F50 (Second slow probing )
 
G10 L81 P100 Q5043 (Store to #100 Current Z position)
G10 L190 P100 Q270  (Add 270 to #100)
G10 L81 P7215 Q100  (Store the result as RTCP Shoulder Length)
 
G53 G0 Z[#5433-1.0] F#100 (Move up to safe position)
G53 G28.5 F#101 X0 Y0 (move back to saved XY/Register1.XY)
G53 G90 G28.5 Z0 F#100 (move down to saved Z/Register1.Z)
 
M102 (Turn ON RTCP Correction)

Note: See comments on G0G53 usage.

mycnc/rtcp_setup.txt · Last modified: 2023/09/29 14:17 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki