Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Index External Axis

#1
Is there a way to address indexing of a 7th and 8th axis of an external turntable using movJ, joints or similar command?

I am trying to conduct an operation and then rotate the turntable by a set amount and repeat the same operation.
#2
Hi DNikolov,

I think this would help.
I'm using this macro to index a conveyor, but it's the same exact concept.

Jeremy


Attached Files
.py NextBox.py(Size: 636 bytes / Downloads: 341)
Find useful information about RoboDK and its features by visiting our2022世界杯32强赛程表时间 and by watching tutorials on ourYoutube Channel.


#3
Jeremy,

Can you expand a little on the implementation with the turntable. While my turntable is set and valid, how would I modify the move joints command to encapsulate the two axis of the turn table. Cobbling some code together I came up with the following 'clunky' code:

from robolink import * # RoboDK API
from robodk import * # Robot toolbox
angle = 180
layers = 10

RDK = Robolink()

# Retrieve the robot, reference frame and create a program
robot = RDK.Item('', ITEM_TYPE_ROBOT)
reference = robot.Parent()

# Create a new program
program = RDK.AddProgram('Test')

# Define a reference pose
#pos = transl(100,200,300)*rotx(pi)

# Turn Off automatic rendering (faster)
RDK.Render(False)

# Don't show instructions (faster)
program.ShowInstructions(False)

# Specify the reference frame you want to use
program.setPoseFrame(reference)

xx = (layers*360.0)/angle
x = int(xx)

newvalues = {'Speed': 200}


for i in range(x):
targetname='Target %i' % i
target=RDK.AddTarget(targetname,reference,robot)
#target.setPose(transl(0, 0, 0) * pos)

# Set the external axes
axes = [0, i*angle]

# For cartesian targets RoboDK will ignore robot joints but not external axes
all_axes = [90,0,0,0,0,-90] + axes
# Quick way to create an array:
# [0,0,0,0,0,0, ext_axis_1, ext_axis_2]

# Set the target and create a move instruction
target.setJoints(all_axes)
target.setAsJointTarget()
program.MoveJ(target)

#如果你正在创建一个长期计划, this helps keeping the tree small (faster)
if i % 20 == 0:
program.ShowTargets(True)

program.ShowTargets(True)
#4
If you could join the .rdk station that would help me understand your code.

I feel like it could be way simpler.

Jeremy
Find useful information about RoboDK and its features by visiting our2022世界杯32强赛程表时间 and by watching tutorials on ourYoutube Channel.


#5
Jeremy,

Yes I believe that I can be much simpler as this method creates a host of targets for each index.


Attached Files
.rdk Test Station 3.rdk(Size: 5.44 MB / Downloads: 266)
#6
Here's a station that should work and here the python code.

Code:
#------ CONSTANT ------
ROBOT_NAME = 'Motoman MH50'
INCREMENT_EXT_1_DEG = 5
INCREMENT_EXT_2_DEG = 20

joints = []

robot = RDK.Item(ROBOT_NAME,itemtype=ITEM_TYPE_ROBOT)

if robot.Valid():
joints = robot.Joints()
joints[6] += INCREMENT_EXT_1_DEG
joints[7] += INCREMENT_EXT_2_DEG
robot.MoveJ(joints)


Jeremy


Attached Files
.rdk Indexing.rdk(Size: 5.44 MB / Downloads: 265)
Find useful information about RoboDK and its features by visiting our2022世界杯32强赛程表时间 and by watching tutorials on ourYoutube Channel.


#7
Jeremy,

Thanks a lot. This is exactly the code prototype I was looking for.

Regards,
Dan




Users browsing this thread:
1 Guest(s)