Spray Robot

Moderators: TomKerekes, dynomotion

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

Re: Spray Robot

Post by TomKerekes » Wed Apr 15, 2020 12:56 am

Hi Scott,

I think your Homing routine has the motors swapped. Motor1 (Axis 0) should be at 0 degrees. Motor2 (Axis 1) should be 90 degrees. So try changing the Home Program to result in that. Having the opposite probably results in an impossible pose.
SwapMotors.png
Normally +X is to the right and +Y up. Your convention for X is backwards.

Also defining the XY origin to be at Motor 1 is not very logical. For the algorithm to solve for the XY position it needs some reasonable starting guess. It uses 0,0 as an initial guess. In your convention this would be at an impossible orientation. So I added an adjustment to have the XY origin be at the payload home position with:

Code: Select all

	// adjust xy to be zero at neutral home position
	x = -x + L1 - S;
	y += R3;
I also added code to define Actuators 2-5 so the variables wouldn't be undefined

Code: Select all

	Acts[2] = z*m_MotionParams.CountsPerInchZ;
	Acts[3] = a*m_MotionParams.CountsPerInchA;
	Acts[4] = b*m_MotionParams.CountsPerInchB;
	Acts[5] = c*m_MotionParams.CountsPerInchC;
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Spray Robot

Post by TomKerekes » Wed Apr 15, 2020 12:58 am

Here is the modified Kinematics file.
Attachments
Kinematics2AxisRobot.cpp
(3 KiB) Downloaded 312 times
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Spray Robot

Post by TomKerekes » Wed Apr 15, 2020 5:01 pm

Oops: should have been L not L1

x = -x + L - S;
Attachments
Kinematics2AxisRobot.cpp
(3 KiB) Downloaded 295 times
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Spray Robot

Post by TomKerekes » Wed Apr 15, 2020 8:28 pm

TeachMotion example was modified to read motor angles from KFLOP and simulate the linkages linkages

Regards,

Tom Kerekes
Dynomotion, Inc.

CNC_Machines
Posts: 60
Joined: Fri Apr 27, 2018 10:43 pm

Re: Spray Robot

Post by CNC_Machines » Thu Apr 16, 2020 11:10 pm

Tom,

This looks great, I am getting very close. I am trying to understand your code a bit better.

// adjust xy to be zero at neutral home position
x = -x + L - S;
y += R3;

I can see why we would need this the first time through, but doesnt forcing the X/Y variables every cycle mess up the actual position?

// find angles for each motor
GeoCorrect(x,y,z,&x,&y,&z);

This line is right underneath. What is this line of code doing?

Thanks,

Scott

CNC_Machines
Posts: 60
Joined: Fri Apr 27, 2018 10:43 pm

Re: Spray Robot

Post by CNC_Machines » Tue May 19, 2020 8:48 pm

Tom,

Spray booth is built, looking at making several more of these robots. As far as installing this software on multiple computers, I do the normal install with drivers, and then just replace folder with my library instead of the one that installs with KMotionCNC?

Thanks,

Scott

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

Re: Spray Robot

Post by TomKerekes » Tue May 19, 2020 10:57 pm

Oops sorry I though I alread replied to this...
I am trying to understand your code a bit better.

// adjust xy to be zero at neutral home position
x = -x + L - S;
y += R3;

I can see why we would need this the first time through, but doesnt forcing the X/Y variables every cycle mess up the actual position?
I'm not sure I understand the question, but when parameters are passed into a function, they are a copy of the caller's values, so they can be changed and not have any effect on the values outside the function. In C if you want to change a variable outside of a function then the address of that variable must be passed to the function. Then the function can modify the variable indirectly.

// find angles for each motor
GeoCorrect(x,y,z,&x,&y,&z);

This line is right underneath. What is this line of code doing?
This would perform any Geometric Correction as described here. You might find that useful. If the motor positions, link arm lengths, joint angles, etc etc are not mechanically perfect there may be some distortion/imperfection in the XY positions. A calibration using a table of measured positions could be used to correct this. Unfortunately this would need to be implemented in the reverse kinematics also which is somewhat complicated and not currently handled by your code. The normal method of doing the reverse kinematics numerically handles this automatically. I'm guessing the required accuracy of a paint sprayer is not extremely high so probably wont be needed. If a Geometric Correction table file is not specified the function does nothing.


As far as installing this software on multiple computers, I do the normal install with drivers, and then just replace folder with my library instead of the one that installs with KMotionCNC?
You should only need to copy the \KMotion\Release\GCodeInterpreter.dll file to the other computer as it contains the kinematics changes. You might also copy the \KMotion\Data directory to get all the same settings and the Kinematics.txt file that turns on your Kinematics

Waiting for Video :)
Regards,

Tom Kerekes
Dynomotion, Inc.

CNC_Machines
Posts: 60
Joined: Fri Apr 27, 2018 10:43 pm

Re: Spray Robot

Post by CNC_Machines » Fri Jul 10, 2020 9:04 pm

Machine is up and running! I modified the Kinematics program to keep the spray head parallel no as the robot moves in X/Y space. G Code is used to adjust spray angles.

Tom, I am trying attach an MP4 video and am not having any success.

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

Re: Spray Robot

Post by TomKerekes » Fri Jul 10, 2020 9:47 pm

Hi Scott,

We don't allow mp4 videos directly. How big is it? If you add/change the extension to .txt it should be possible to attach the file.

If you upload to YouTube you can use the youtube button to embed in the post.

Or if you email to support we can put it on YouTube.

Or upload it somewhere and include a link.

Can't wait :)
Regards,

Tom Kerekes
Dynomotion, Inc.

CNC_Machines
Posts: 60
Joined: Fri Apr 27, 2018 10:43 pm

Re: Spray Robot

Post by CNC_Machines » Wed Aug 19, 2020 5:21 pm

Tom,

Thanks again for your help on this project! Here is the link for the video, sprayer has been working very well.

https://www.youtube.com/watch?v=eon96CIPQkY

Post Reply