Program Examples:fast-PLS

From SoftMC-Wiki
Revision as of 14:47, 29 January 2023 by EranKo (talk | contribs) (created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Language: English  • 中文(简体)‎

here is an example of using path PLS with PUMA robot

PLStest.PRG:

'------------------------------------------------------------------------------
' File:        PLStest.PRG
' Purpose:     generating puma motion with PLS: PLSlengh and PlsPercentage
' Version:     1.00
' Author:      Eran Korkidi
' History:     08.DEC.2015	-	created
'------------------------------------------------------------------------------

dim shared loc1 as location of xyzypr = #{500.0 , -920.0 , -50.0 , 50.0 , 180 , 0}
dim shared loc2 as location of xyzypr = #{-500.0 , -920.0 , -50.0 , 50.0 , 180 , 0}

common shared P1 as pls PUMA Sys.Dout.101
common shared P2 as pls PUMA Sys.Dout.102
common shared P3 as pls PUMA Sys.Dout.103

program

CreatePLSdata 4 P1 
'CreatePLSdata P2 2
'CreatePLSdata P3 2

P1.plsposition[1] = 10
P1.plsposition[2] = 20
P1.plsposition[3] = 80
P1.plsposition[4] = 90

Attach Puma
	Puma.PLSsource = Puma.PathLength
	Puma.en = 1
	P1.PlsEnable = TRUE
	Move Puma loc1 Vcruise=10
	while Puma.IsMoving
		Sleep 1
	end while
	Record Motion.rec 3000 Gap = 1 RecData = Sys.Dout.101 * 100, Puma.Setpoint{1}
	RecordOn
	MOVES Puma loc2 WithPLS = P1
	while Puma.IsMoving
		Sleep 1
	end while
	RecordClose

	P1.PlsEnable = FALSE
	Puma.PLSsource = Puma.PATHPERCENTAGE
	Puma.en = 1
	P1.PlsEnable = TRUE
	Move Puma loc1 Vcruise=10
	while Puma.IsMoving
		Sleep 1
	end while
	Record Motion1.rec 3000 Gap = 1 RecData = Sys.Dout.101 * 100, Puma.Setpoint{1}
	RecordOn
	MOVES Puma loc2 WithPLS = P1
	while Puma.IsMoving
		Sleep 1
	end while
	RecordClose
Detach Puma

end program ' <MyTask>.prg