RTCP setup for 5axis A/B table/table horizontal mill

Moderators: TomKerekes, dynomotion

User avatar
TomKerekes
Posts: 2679
Joined: Mon Dec 04, 2017 1:49 am

Re: RTCP setup for 5axis A/B table/table horizontal mill

Post by TomKerekes » Mon Aug 17, 2020 4:43 pm

Hi daredevil,

Yes, I would try changing:

Code: Select all

    double CP_Rotated_C_x,CP_Rotated_C_y,CP_Rotated_C_z;
    double CP_Rotated_AC_x,CP_Rotated_AC_y,CP_Rotated_AC_z;

	if (m_MotionParams.TCP_Active)
	{
		x -= m_MotionParams.TCP_X;
		y -= m_MotionParams.TCP_Y;
		z -= m_MotionParams.TCP_Z;

		// Determine where the commanded XYZ point will be after C rotation
		Rotate3(CTableAZeroXCenterpoint, CTableAZeroYCenterpoint, CTableAZeroZZero, x, y, z, 0, 0, -c, &CP_Rotated_C_x, &CP_Rotated_C_y, &CP_Rotated_C_z);
		// Determine where the commanded XYZ point will be after A rotation
		Rotate3(CTableAZeroXCenterpoint, ASaddleYCenterpoint, ASaddleZCenterpoint, CP_Rotated_C_x, CP_Rotated_C_y, CP_Rotated_C_z, -a, 0, 0, &CP_Rotated_AC_x, &CP_Rotated_AC_y, &CP_Rotated_AC_z);

		// Translate XYZ target for AC rotation
		x = CP_Rotated_AC_x + m_MotionParams.TCP_X;
		y = CP_Rotated_AC_y + m_MotionParams.TCP_Y;
		z = CP_Rotated_AC_z + m_MotionParams.TCP_Z;
	}


To:

Code: Select all

    double CP_Rotated_B_x,CP_Rotated_B_y,CP_Rotated_B_z;
    double CP_Rotated_AB_x,CP_Rotated_AB_y,CP_Rotated_AB_z;

	if (m_MotionParams.TCP_Active)
	{
		x -= m_MotionParams.TCP_X;
		y -= m_MotionParams.TCP_Y;
		z -= m_MotionParams.TCP_Z;

		// Determine where the commanded XYZ point will be after B rotation
		Rotate3(CTableAZeroXCenterpoint, CTableAZeroYCenterpoint, CTableAZeroZZero, x, y, z, 0, -b, 0, &CP_Rotated_B_x, &CP_Rotated_B_y, &CP_Rotated_B_z);
		// Determine where the commanded XYZ point will be after A rotation
		Rotate3(CTableAZeroXCenterpoint, ASaddleYCenterpoint, ASaddleZCenterpoint, CP_Rotated_B_x, CP_Rotated_B_y, CP_Rotated_B_z, -a, 0, 0, &CP_Rotated_AB_x, &CP_Rotated_AB_y, &CP_Rotated_AB_z);

		// Translate XYZ target for AB rotation
		x = CP_Rotated_AB_x + m_MotionParams.TCP_X;
		y = CP_Rotated_AB_y + m_MotionParams.TCP_Y;
		z = CP_Rotated_AB_z + m_MotionParams.TCP_Z;
	}
(maybe also change constant names from CTable to BTable)

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

User avatar
daredevil
Posts: 39
Joined: Sun May 17, 2020 7:39 am

Re: RTCP setup for 5axis A/B table/table horizontal mill

Post by daredevil » Mon Aug 17, 2020 5:08 pm

Thank you very much Tom,
I will try and let you know,

in the meantime I have tested the rebuilt TableAC kinematics, and it seems to work except for the A & C directions RTCP movements wich are in the opposite way vs the rotation table.
Should I change:
// Determine where the commanded XYZ point will be after C rotation
Rotate3(CTableAZeroXCenterpoint, CTableAZeroYCenterpoint, CTableAZeroZZero, x, y, z, 0, 0, -c, &CP_Rotated_C_x, &CP_Rotated_C_y, &CP_Rotated_C_z);
// Determine where the commanded XYZ point will be after A rotation
Rotate3(CTableAZeroXCenterpoint, ASaddleYCenterpoint, ASaddleZCenterpoint, CP_Rotated_C_x, CP_Rotated_C_y, CP_Rotated_C_z, -a, 0, 0, &CP_Rotated_AC_x, &CP_Rotated_AC_y, &CP_Rotated_AC_z);

To:
// Determine where the commanded XYZ point will be after C rotation
Rotate3(CTableAZeroXCenterpoint, CTableAZeroYCenterpoint, CTableAZeroZZero, x, y, z, 0, 0, c, &CP_Rotated_C_x, &CP_Rotated_C_y, &CP_Rotated_C_z);
// Determine where the commanded XYZ point will be after A rotation
Rotate3(CTableAZeroXCenterpoint, ASaddleYCenterpoint, ASaddleZCenterpoint, CP_Rotated_C_x, CP_Rotated_C_y, CP_Rotated_C_z, a, 0, 0, &CP_Rotated_AC_x, &CP_Rotated_AC_y, &CP_Rotated_AC_z);

?
Thanks again
dd

User avatar
daredevil
Posts: 39
Joined: Sun May 17, 2020 7:39 am

Re: RTCP setup for 5axis A/B table/table horizontal mill

Post by daredevil » Mon Aug 17, 2020 6:00 pm

OK
with "a" and "c" instead of "-a" "-c" it works!

User avatar
TomKerekes
Posts: 2679
Joined: Mon Dec 04, 2017 1:49 am

Re: RTCP setup for 5axis A/B table/table horizontal mill

Post by TomKerekes » Mon Aug 17, 2020 7:07 pm

Congrats!! :)
Regards,

Tom Kerekes
Dynomotion, Inc.

User avatar
daredevil
Posts: 39
Joined: Sun May 17, 2020 7:39 am

Re: RTCP setup for 5axis A/B table/table horizontal mill

Post by daredevil » Wed Aug 26, 2020 11:08 am

Thanks Tom,
I have modified the tableAC kinematics in order to be sure that it gets parameters from the txt file:
int CKinematics5AxisTableAC::Initialize()
{
// Check if parameters exist in Kinematics.txt, if so update them and ask for confirmation value window yes/no, no abort
GetParameter("CTableAZeroZZero", &CTableAZeroZZero);
CString str1;
str1.Format("Value CTableAZeroZZero is: %g", CTableAZeroZZero);
if (AfxMessageBox(str1, MB_YESNO) == IDNO) return -1;
GetParameter("CTableAZeroXCenterpoint", &CTableAZeroXCenterpoint);
CString str2;
str2.Format("Value CTableAZeroXCenterpoint is: %g", CTableAZeroXCenterpoint);
if (AfxMessageBox(str2, MB_YESNO) == IDNO) return -1;
GetParameter("CTableAZeroYCenterpoint", &CTableAZeroYCenterpoint);
CString str3;
str3.Format("Value CTableAZeroYCenterpoint is: %g", CTableAZeroYCenterpoint);
if (AfxMessageBox(str3, MB_YESNO) == IDNO) return -1;
GetParameter("ASaddleYCenterpoint", &ASaddleYCenterpoint);
CString str4;
str4.Format("Value ASaddleYCenterpoint is: %g", ASaddleYCenterpoint);
if (AfxMessageBox(str4, MB_YESNO) == IDNO) return -1;
GetParameter("ASaddleZCenterpoint", &ASaddleZCenterpoint);
CString str5;
str5.Format("Value ASaddleZCenterpoint is: %g", ASaddleZCenterpoint);
if (AfxMessageBox(str5, MB_YESNO) == IDNO) return -1;
return 0;
}

So when you start Kmotion or KmotionCNC you get the following confirmation windows:
Cattura1.JPG
If I use mm units in KmotionCNC should I put the kinematics parameters in the txt file in inches or in mm?

Thanks
all my best
dd

User avatar
daredevil
Posts: 39
Joined: Sun May 17, 2020 7:39 am

Re: RTCP setup for 5axis A/B table/table horizontal mill

Post by daredevil » Wed Aug 26, 2020 2:53 pm

OK I made a test:
it works with inches values in the kinematics,
but mm units for tool Z offset in the tools table
is it right?
thanks
dd

User avatar
TomKerekes
Posts: 2679
Joined: Mon Dec 04, 2017 1:49 am

Re: RTCP setup for 5axis A/B table/table horizontal mill

Post by TomKerekes » Wed Aug 26, 2020 3:38 pm

Hi dd,

Internally the Coordinated Motion Libraries and Kinematics always work in inches. A Machine Operator should never be involved with any of this once the machine is configured and working.

The GCode Interpreter, GCode, and Offsets (Tool, Fixture, and Global) work in whatever mode is selected mm or inches for the current Job.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

User avatar
daredevil
Posts: 39
Joined: Sun May 17, 2020 7:39 am

Re: RTCP setup for 5axis A/B table/table horizontal mill

Post by daredevil » Wed Aug 26, 2020 4:01 pm

Thanks Tom!
now it's clear for me
my final step will be to implement and test the tableA/B kinematics according to your suggestions,
the A/C works fine, and when the A axis is -90° it's the same of A/B setup
absetup.jpeg
all my best
dd

User avatar
daredevil
Posts: 39
Joined: Sun May 17, 2020 7:39 am

Re: RTCP setup for 5axis A/B table/table horizontal mill

Post by daredevil » Sat Aug 29, 2020 6:41 am

Hi Tom
in the meanwhile I would like to jog the 5 axis (B/C) with the USB gamepad:
which is the way to setup/change the pre-defined buttons/jogs gamepad in KMCNC?
thanks
dd

User avatar
TomKerekes
Posts: 2679
Joined: Mon Dec 04, 2017 1:49 am

Re: RTCP setup for 5axis A/B table/table horizontal mill

Post by TomKerekes » Sat Aug 29, 2020 5:13 pm

Hi dd,

We don't have a means to configure the game pad functionality. You would need to change the source code and re-compile.

See:

int CKMotionCNCDlg::DoJoyStick()

in file: KMotionCNCDlg.cpp
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply