| | Solutions for the Welding Robot of the Computing Starter Kit
Construction : M1 with pile motor and I1 end switch, I2 impulse
switch, M4 welding lamp. In my case it was a variation of the Hanoi-Roboters
with an additional lamp mounted on the arm.
Discussed are different solutions starting with level 2 : a
simple sequential program. Ending with a complex, list controlled solution on
level 3. The next page comes with a nice TeachIn-Solution.
Schweissroboter1L2 : Welding 1
|
Looks like a LLWin program.
Every thing acts step after step :
- Drive to home position (until Pause).
- Drive to position 56 and welding (blinking the lamp)
- Drive to position 94 (56 + 38)
- Drive to position 144 (94 + 50)
All that is done in an endless loop.
A new feature (compared with LLWin) is :
- the yellow 1 : Wait for switch I1 comes true.
The LLWin comparing loop is spared.
- the yello arrows : Counting of impulses on an I-Input.
in this case all impulses are counted (0/1 and 1/0).
It is done to avoid external variables for counting.
|
The Welding
|
For special interest, the Counting Loop :
The loop runs 12 times. On start (pin '=1') the internal count
is set to 1 and is increment ('+1') with each round of the loop.
In this case too external variable are avoided.
The construct is more simple than the LLWin construct using variables. |
Schweißroboter2L3 : Welding 2
|
Is done sequential too, but :
- Doing the positioning work in a subroutine.
The appropriate position is noted as parameter.
- Drive Home is a separate subroutine too.
- The constants are new elements for notating
the position to drive to.
- Level 3 comes the a separate control flow
(black lines) and a data flow (yellow lines).
- Yellow lines means too : The introduction of
constants and variables.
- Now commands (placed in the control flow) are separated from inputs
and outputs (e.g. Interface M1 - M4 and I1 - I8). In addition there are
operators for the yello lines.
- Level 1/2 element can be mixed with level 3 elements. You can to is
as you like. Sometimes it is more convenient using level 1.
|
The Renewed Welding
|
The proceeding is the same as in level 1.
The welding lamp now is controlled using level 3 elements. The green
circle command switches the lamp to full brightness (8), waiting and off.
This commands are placed in the control flow and send via data flow
(yellow) messages to the lamp.
The loop control is the old one. It is easier to use. For variable loop
counts an if (A>0) and a count variable must be used. Look below for
it. |
The Home Position
|
Using a yellow 'J" instead of the level 1
'1' with the same effect :
Waiting for I1 = true. There are variations for false, 0/1 and 1/0 flanks.
The pile motor M1 now is controlled by separate commands (red : left
turn, fullspeed and stop).
A new command is the '=' which sends a message (0) to the (global)
variable ActPos. That means the pile now has reached position 0 counted up
from end switch I1.
ActPos is initialized with the value 0 on start of the program. The
'=0' is needed because of the Home subroutine is used several times. The
open pin does't matter.
|
DriveTo a special Position
|
This is a little bit more complicated.
The destination position is noted with the parameter ZielPos (counted
from the end switch). The actual position (from end switch too), is noted
in the globla variable ActPos. Not to be seen in MainProgram, but used in
Home too.
The central command is the if A?B to compare ZielPos and ActPos. If
equal : motor stop, end.
With ZielPos > ActPos M1 runs right, the impulses on I2 are counted
(yellow arrow command) and ActPos is incremented by 1 until '='.
On ZielPos < ActPos M1 runs left in direction of the end switch with
decrementing.
In addition a test for reaching end switch I1 and a control for max
distance can be installed for security purposes.
|
Schweißroboter3L3 : Welding 3
|
It looks like very luxury. The positions to be
severed are stored in a list (Positionen). In this case already in time
creating the program (right click list, editing the table). The list
gets via I-Input the number (Index, starting with 0) of the list element
which is than exported via R-Output and directed as parameter to DriveTo.
The I-Output exports the number of list elements if the I-Input is
changed. In the case of Index exceeds the range I-Output becomes 0.
The used subroutines are the same as in the previous sample.
The actual Index must be stored in a variable, otherwise it doesn't
work.
|
Update (dd.mm.yy) : 10.03.2005
|