Rotating a trunnion
I have a trunnion in my workcell that is NOT controlled by the robot; I created it using the kinematic modeler. I am trying to determine how to rotate the trunnion during certain points while running my program (i.e. Run through a couple paths, rotate the trunnion 90 degrees, run through a couple paths, rotate another 90 degrees, etc.)
Does anyone have an idea how to do this? Or perhaps I could pause the program and rotate the trunnion manually but this is not optimal. Any suggestions? Thanks.
Stacey
SBalamucki38685,9500578704Comments
-
Hi Stacey,
You can control your trunnion with a VBA Macro, that you trigg with a event int he EventTable (See the Online Help how to use the EventTable). Here is an example of a VBA macro that rotates the attached TurnTable 90 degrees each time. Paste the code in the VBA-editor that you find in the menu: Tools - Macro - Visual basic Editor. VBA code:
Sub RotateTable()
Anders S38686,4680092593
Dim Value As Variant
Dim TurnTable As Mechanism
Dim dblDeg As Double
Dim TurnValue As Variant
Dim Pi As Double
Pi = 4 * Atn(1)
dblDeg = Pi / 180
Set TurnTable = ActiveStation.Mechanisms("TurnTable")
TurnValue = TurnTable.JointValues
If RotateValue > 360 Then
RotateValue = 0
End If
TurnValue(0) = RotateValue * dblDeg
TurnTable.JointValues = TurnValue
ActiveStation.Refresh
RotateValue = RotateValue + 90
End SubBest regards,
Anders Spaak
ABB Robotics0 -
Hi Anders,
Thanks for the help, I figured I might have to use VBA. I'm somewhat familiar with it so I think I will be okay it that area. I'm having some trouble setting up the event table the way it should be.
My program doesn't have a set number of procedures it runs through before it needs to turn the trunnion. Sometimes it runs through 3, sometimes 4, etc. I also have multiple pounce positions to where the robot returns to before the trunnion turns. What do you suggest to do to trigger the event at exact locations in the code(i.e. after procedure a308, turn the trunnion, then continue, etc.)? Is this possible? Thanks.
Stacey
0 -
Hi Stacey,
I suggest that you use a I/O-signal to trigg the event.
So if you use the rapid instruction SetDO to set the I/O (SetDO doRotate,1;), can you reset the same I/O from the VBA macro:Sub RotateTable()
Dim Value As Variant
Dim TurnTable As Mechanism
Dim dblDeg As Double
Dim TurnValue As Variant
Dim Pi As Double
Dim VC As ControllerSet VC = ActiveStation.ActiveMechanism.Controller
Pi = 4 * Atn(1)
dblDeg = Pi / 180
Set TurnTable = ActiveStation.Mechanisms("TurnTable")
TurnValue = TurnTable.JointValues
If RotateValue > 360 Then
RotateValue = 0
End If
TurnValue(0) = RotateValue * dblDeg
TurnTable.JointValues = TurnValue
ActiveStation.Refresh
RotateValue = RotateValue + 90
VC.IOs.Item("doRotate").Value = 0
End SubBest regards,
Anders Spaak
ABB Robotics0 -
Anders,
Thanks for all the help. I got everything running as planned. In case anyone wanted to see my final code I added it at the bottom; I tweaked it a bit from yours. Thanks again.
Stacey
Sub RotateTable()
Dim Value As Variant
Dim Trunnion As Mechanism
Dim dblDeg As Double
Dim TurnValue As Variant
Dim Pi As Double
Dim VC As ControllerSet VC = ActiveStation.ActiveMechanism.Controller
Pi = 4 * Atn(1)
dblDeg = Pi / 180
Set Trunnion = ActiveStation.Mechanisms("trunnion")
TurnValue = Trunnion.JointValues
RotateValue = 90
TurnValue(0) = TurnValue(0) + (RotateValue * dblDeg)
If TurnValue(0) > 7 Then
TurnValue(0) = 0
End If
Trunnion.JointValues = TurnValue
ActiveStation.Refresh
VC.IOs.Item("doRotate").Value = 0
End Sub0 -
Hi Again,
I have one more question, more for curiosity sake than anything. If the device (i.e. Trunnion) was controlled by the ABB controller, how would that work? I know that only RS5.0 with the IRC5 Controller can control multiple robots, but can RS3.2 with the S4 controller control both a robot and, for example, a trunnion at the same time? Thanks.
Stacey
0 -
Hi Stacey,
Yes the Trunnion can be controlled by the robot. A S4 controller can control up to six external axes (coordinated or uncoordinated).
But you have to configure your system for the external axis.
Together with RobotStudio is the program ConfigEdit installed. This program can you use to create configuration files for external axes. But be aware of that you have to know what type of drive units and so on you should use for the external axes.
If you control a external axis by the robot, you have to add the external axis value to your robtarget data.
Best regards,
Anders Spaak
ABB Robotics0 -
Thanks!0
Categories
- All Categories
- 5.5K RobotStudio
- 395 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings