Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2012, 09:41:27 AM
Home Help Login Register
News: Any Problems or Experience with Industrial Robots ?
Register and place your Question / Answer to worldwide Robotexperts right here !

+  Robotforum | Support for Robotprogrammer and Users
|-+  Industrial Robot Help and Discussion Center
| |-+  Stäubli & Bosch Robot Forum (Moderators: Werner Hampel, Jim Tyrer, Martin H, Fabian Munoz)
| | |-+  Val Programming Help
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Val Programming Help  (Read 1692 times)
crcd
Guest
« on: November 06, 2010, 02:51:59 PM »

Hi all,

I am trying to write a fairly basic program in val using the minimum amount of lines, it involves using the robot to draw two identical shapes in 2D on a piece of paper using a felt-tip pen as the end effector.

To do this, I have defined P0, and plotted all the points of the first of the shapes as follows:

SET A1 = SHIFT (P0 BY -30, 50, 0)
SET A2 = SHIFT (P0 BY -30, 120, 0)
SET A3 = SHIFT (P0 BY -130, 120, 0)
SET A4 = SHIFT (P0 BY -130, 50, 0)
SET A5 = SHIFT (P0 BY -115, 50, 0)
SET A6 = SHIFT (P0 BY -115, 105, 0)
SET A7 = SHIFT (P0 BY -45, 105, 0)
SET A8 = SHIFT (P0 BY -45, 50, 0)

And then

DEPART 100
APPRO A1, 100
MOVES A2
MOVES A3
MOVES A4... etc

The next shape is of identical form, but drawn 90 mm away in the positive y direction.

Rather than defining all of these points separately, i.e SET A9 = SHIFT (P0 BY -30, 140, 0) etc, and then repeating the MOVES commands, how do I write the program so that the robot repeats the same relative movements but with a 90mm shift in the positive y?

Many Thanks

Charles
Logged
Jim Tyrer
Administrator
*****
Offline Offline

Gender: Male
Posts: 515


Ende aller Streckenverbote


WWW
« Reply #1 on: November 06, 2010, 03:49:45 PM »

You sound like someone who thinks for himself... grinser043

Short answer is Frames:
    <frame name="drawFrame" public="true">

      <fFather alias="" name="world" fatherIndex="0" />

      <valueFrame index="0">

        <tfValue x="0" y="90" z="0" rx="0" ry="0" rz="0" />

      </valueFrame>

Have a look at Tool Frames too.
Logged
Ztek
Jr. Member
**
Offline Offline

Posts: 57

Service engineer and programmer of ABB and Adept.


« Reply #2 on: November 08, 2010, 08:47:39 AM »

I use to program V+, but I think this will work in VAL too, as they have the same background.

FOR i=0 TO 1
  SET A1 = SHIFT (P0 BY -30, 50+90*i, 0)
  SET A2 = SHIFT (P0 BY -10, 120+90*i, 0)
  !And so on...

  DEPART 100
  APPRO A1, 100
  MOVES A2
  MOVES A3
  MOVES A4... etc
END

This is how I would have solved the problem:

figure=[[-30,50],[-30,120],[-130,120],[-130,50],[-115,50],[-115,105],[-45,105],[-45,50]]

FOR i=0 TO 1
  APPRO SHIFT(P0 BY figure[1,1], figure[1,2]+i*90,0), 100
  FOR j=1 TO LAST(figure[,])
     MOVES SHIFT(P0 BY figure[j,1], figure[j,2]+i*90,0)
  END
  DEPART 100
END

As you see you can solve a problem like this in many ways. Read a bit about functions in the VAL manuals and you will see that it can save you a lot of rows in your programs.
Logged
Jim C
Guest
« Reply #3 on: November 08, 2010, 02:43:47 PM »

You are working in one of the older versions of VAL like VAL+ or VAL II

You could make an intermediate point like po2, and use a shift to reposition it like this

SET PO2 = SHIFT(PO BY 0,90,0)

SET A1 = SHIFT (P02 BY -30, 50, 0)
SET A2 = SHIFT (P02 BY -30, 120, 0)
SET A3 = SHIFT (P02 BY -130, 120, 0)
SET A4 = SHIFT (P02 BY -130, 50, 0)
SET A5 = SHIFT (P02 BY -115, 50, 0)
SET A6 = SHIFT (P02 BY -115, 105, 0)
SET A7 = SHIFT (P02 BY -45, 105, 0)
SET A8 = SHIFT (P02 BY -45, 50, 0)

I would also look in the manual and read about FRAME and ARRAYS. This will make your programming much easier.

What robot system are you using?
Logged
Slumdog
Newbie
*
Offline Offline

Posts: 2


« Reply #4 on: November 07, 2011, 03:26:02 PM »

To Ztek,

Can you please explain the 'figure' command. Im having a similar problem. Is t possible to save the routine and ask it to repeat and a different point?

Cheers
Logged
Slumdog
Newbie
*
Offline Offline

Posts: 2


« Reply #5 on: November 07, 2011, 03:32:53 PM »

How does the FRAME program work?
Logged
Jim C
Guest
« Reply #6 on: November 08, 2011, 03:25:22 PM »

In V+ FRAME returns a transformation. It takes four points, a line from the first point to the second defines the X axis, a line at a right angle to the x axis going through the third point defines the direction of the Y axis. The fourth point defines the origin of the frame and the X and Y axis shift until they go through the last point. In practice the first and fourth point were often the same location.

Frame were used for things like pallets and vision. Any time you could calculate the location in the frame of reference

Here is an example where we use three points po, px, and py to define a frame and move to a location p1 inside that frame

set f = FRAME(po, px, py, po)

move f:p1


    py
    .
    .
    .          p1
    .
    .
    po .  .   .   .    .    .   .   .   .   px
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!