Coordinating Motion with an External Axis

Started by MkMrA2, February 05, 2025, 09:21:05 PM

Previous topic - Next topic

MkMrA2

Hi, 

I'm starting to do some clay printing on a rotary axis setup using a KR-6 robot, and an external axis (E1), driven by a stepper motor. 

Here's an image of the simulation, which works nicely:



Here's a short video of the robot doing the same toolpath. 


The motion of the robot (A1-A6) is exactly as expected. It is the rotating axis E1 that is out of sync. It seems to lag behind the A1-A6 positions when arriving at new points. 

I'm specifying an E1 position on every LIN move. Here's a typical line of KRL: 
LIN {X 594, Y 210.275, Z 375.91, A -90, B 83.884, C -90, E1 97.954, E2 0, E3 0, E4 0} C_DIS

If the E1 motor is working correctly, can I expect the robot end effector position, and the rotary axis, will always be in sync? That is, the robot will not move to the next position until A1-A6 and E1 have reached their specified positions? 

If that's the case then I know I have an issue with the stepper motor setup perhaps accelerating or decelerating improperly. It's actually fairly close to correct, it's just not perfectly synced. 

Thanks very much for any guidance, 
Mark

MkMrA2

As an additional piece of data about this, the points are specified quite close together. Here are a few successive lines of KRL:
...
LIN {X 594, Y 221.615, Z 374.695, A -90, B 83.884, C -90, E1 91.297, E2 0, E3 0, E4 0} C_DIS
LIN {X 594, Y 220.415, Z 374.823, A -90, B 83.884, C -90, E1 91.623, E2 0, E3 0, E4 0} C_DIS
LIN {X 594, Y 219.3, Z 374.943, A -90, B 83.884, C -90, E1 91.949, E2 0, E3 0, E4 0} C_DIS
LIN {X 594, Y 218.266, Z 375.054, A -90, B 83.884, C -90, E1 92.277, E2 0, E3 0, E4 0} C_DIS
LIN {X 594, Y 217.307, Z 375.156, A -90, B 83.884, C -90, E1 92.605, E2 0, E3 0, E4 0} C_DIS
LIN {X 594, Y 216.421, Z 375.251, A -90, B 83.884, C -90, E1 92.934, E2 0, E3 0, E4 0} C_DIS
LIN {X 594, Y 215.606, Z 375.339, A -90, B 83.884, C -90, E1 93.264, E2 0, E3 0, E4 0} C_DIS
LIN {X 594, Y 214.857, Z 375.419, A -90, B 83.884, C -90, E1 93.594, E2 0, E3 0, E4 0} C_DIS
...

So, in those lines the robot only moved 7mm and E1 only rotated 2.3 degrees. That's typical of the entire path, the locations are really close together.

Thanks!
Mark


Johannes @ Robots in Architecture

Hello Mark,

That's a nice setup! A good way to check the synchronization would be in your case that you move the TCP onto your object in a Cartesian movement mode with the external base active and then rotate E1.
The robot should perfectly follow the rotation.

If it doesn't: If it's a KUKA motor then it would be good to check if the gearbox is properly configured. If it's a custom setup - because you mention a stepper motor - then in addition you would need to look into its controller, whether you can customize the acceleration/deceleration ramps etc.

Best,
Johannes

MkMrA2

Thanks very much. Some motor speed updates fixed it. Helpful to have access to Wes McGee :) Lots to improve but it's a good start.


Mark

Johannes @ Robots in Architecture

Great! Wes McGees should be provided with every robot!
Best,
Johannes

MkMrA2

Hi,

I'm getting closer and closer to this working really nicely. A remaining issue occurs when the robot doesn't move but E1 does. In the attached image, which is a trivial tester I made, it prints two lines along the surface. Then at the end it prints two rings, one at the base of the form, the other at the top. They are show as brown circles, marked with the red arrows.

In those cases, A1-A6 don't need to move, just E1. Even when I have the speed set very low (0.00001 m/s) it spins quite fast. In a way this is understandable because A1-A6 aren't going anywhere.

Any thoughts on how I can move this at a controllable rate? One hack I know I can do is just move the robot a little bit, like a tiny amount up in Z or something so A1-A6 will move. But I'd prefer not to do this if possible.

Thanks for any insights!
Mark

Johannes @ Robots in Architecture

Hmmm... I would try a PTP movement (with the same Cartesian position but the new E1 value) instead, then you should be able to control the speed via the normal PTP speed value.

Best,
Johannes

MkMrA2

I think I can do that without too much trouble. I'll give it a try tomorrow.

Thanks, Johannes!
Mark

MkMrA2

Hi Johannes,

I gave this a try. It looked promising when I ran in T1. The rotary motion was nice and slow. I specify a velocity of 2% on those E1 rotation only moves. That's the value wired into the PTP component.

When I switch to Auto mode, the rotations go back to super fast.

I don't see on the lines of KRL for the PTP moves where the speed is specified. Here are a few sample lines where it switches from LIN to PTP when it detects a rotation only move:
...
LIN: X 594, Y 56.7, Z 390.4, A -90, B 83.9, C -90, E1 90, E2 0, E3 0, E4 0
 DO71=TRUE
KRL: WAIT 0.4 SEC
PTP: X 594, Y 56.7, Z 389.4, A -90, B 83.9, C -90, E1 84.8, E2 0, E3 0, E4 0 | @010
PTP: X 594, Y 56.7, Z 389.4, A -90, B 83.9, C -90, E1 79.5, E2 0, E3 0, E4 0 | @010
PTP: X 594, Y 56.7, Z 389.4, A -90, B 83.9, C -90, E1 74, E2 0, E3 0, E4 0 | @010
...

Anything you can suggest for this? Do the interpolation settings effect the speed? I have C_PTP set to 1% in the Settings dialog in the Interpolation section.

Thanks for any help!
Mark

Johannes @ Robots in Architecture

Hello Mark,

Hmm... That's weird because 2% should still be very slow in AUT.
I think what you pasted below is the pseudo-code from plugging the movement components into a text box. Could you take a look into the SRC file?
Generally you would set the PTP speed in the component or in the settings. Just note that if you start with 2% speed and then set it to 10% anywhere in the program, it will stay at 10% until you change it again.

Best,
Johannes

MkMrA2

Hi Johannes,

Thanks, I appreciate your help. Right that was just from a Panel. Here's from the KRL file itself:

...
LIN {X 594, Y 56.77, Z 391.431, A -90, B 83.884, C -90, E1 90, E2 0, E3 0, E4 0} C_DIS
$VEL.CP=0.00936
LIN {X 594, Y 56.656, Z 390.369, A -90, B 83.884, C -90, E1 90, E2 0, E3 0, E4 0} C_DIS
$OUT_C[71]=TRUE
WAIT SEC 0.4
PTP {X 594, Y 56.656, Z 389.369, A -90, B 83.884, C -90, E1 84.845, E2 0, E3 0, E4 0, S 'B010'}
PTP {X 594, Y 56.656, Z 389.369, A -90, B 83.884, C -90, E1 79.516, E2 0, E3 0, E4 0, S 'B010'}
PTP {X 594, Y 56.656, Z 389.369, A -90, B 83.884, C -90, E1 74.029, E2 0, E3 0, E4 0, S 'B010'}
...

What would a line of KRL which sets the PTP speed look like?

Here's some code at the top of the KRL file - it looks like this:
...
$VEL.CP=0.01
$APO.CDIS=1
$APO.CPTP=1
$ADVANCE=3
;ENDFOLD


Thanks!
Mark

Johannes @ Robots in Architecture

I guess your PTP speed is only initially set via BAS (#PTP_PARAMS,5).
Please try setting the speed for the PTP component before the rotation. Note that speed changes will only be written into KRL if the value changes, so if you set it for all components it will only add a line at the first occassion.
Best,
Johannes

MkMrA2

Hi Johannes,

I'm sorry but I don't know how to set the speed, other than to wire it into the PTP Movement component. Is there another way I can set the speed?

I wasn't sure if this is what you meant: I did remove the rotation values being wired into E1. And generated the code. I still don't see any velocity values generated. But perhaps I don't know what to look for. Here's an example of the generated code after doing that:
...
LIN {X 594, Y 56.77, Z 391.431, A -90, B 83.884, C -90, E1 90, E2 0, E3 0, E4 0} C_DIS
$VEL.CP=0.00936
LIN {X 594, Y 56.656, Z 390.369, A -90, B 83.884, C -90, E1 90, E2 0, E3 0, E4 0} C_DIS
$OUT_C[71]=TRUE
WAIT SEC 0.4
PTP {X 594, Y 56.656, Z 389.369, A -90, B 83.884, C -90, E1 0, E2 0, E3 0, E4 0, S 'B010'}
PTP {X 594, Y 56.656, Z 389.369, A -90, B 83.884, C -90, E1 0, E2 0, E3 0, E4 0, S 'B010'}
PTP {X 594, Y 56.656, Z 389.369, A -90, B 83.884, C -90, E1 0, E2 0, E3 0, E4 0, S 'B010'}
PTP {X 594, Y 56.656, Z 389.369, A -90, B 83.884, C -90, E1 0, E2 0, E3 0, E4 0, S 'B010'}
...

What should a line of code that sets the speed look like?

Thanks!
Mark

Johannes @ Robots in Architecture

Hello,

Speed changes are only applied if the speed changes. So if a PTP movement has got the same speed as the last one, it won't generate a line of code for the speed.
It should look like that: BAS(#VEL_PTP,5)
For a LIN movement in your example it would be the $VEL.CP=0.00936 setting the speed to 9mm/sec. Just to cover both speed settings.

You could also manually put that into your test file, in that case 5 signifying 5% of speed.

Best,
Johannes