How to setup Position Error Delay

From SoftMC-Wiki
Revision as of 16:46, 31 May 2015 by EranKo (talk | contribs) (added referance for simulated axes pedel)
Jump to: navigation, search

How to SetUp Position Error Delay

First Step

  • set PEDEL to 1 (minimum value)
  • set high value in PeMax
  • Run the axis back and forth and record PE and VCMD as :

PE VCMD.PNG
Command Velocity recordings


PE PEDEL1.PNG
Position Error recordings


Compute PEDEL as PE/VCMD, in this case it will be:

PE/VCMD = 0.94/57.74*1000 = 16.2 ms

Taking into account the used value of PEDEL (1) and the sampling time of 4ms we get the new PEDEL value of 5, e.i. PEDEL = 1 + 4 = 5

NOTE-Info.svgNOTE
in case of a simulated axis the same procedure will work, typically results will show round cycle of 1. eg,
PE/VCMD = 0.4 / 100.0 * 1000.0 = 4 ms = 1 bus cycle


Second Step

Change the PEDEL(5) to the integer value estimated before and run the test again:

PE PEDEL5.PNG

again estimate the error:

PE/VCMD = 0.18/57.74*1000 = 0.317 ms
IMPORTANT.svgIMPORTANT
This means the non-integer communication delay of the drive is 317 micro-seconds.




which is in units of one sample equal:

317/4000 = 0.078


So setting PEDEL to 5.078 we get:
PE PEDEL5078.PNG


Example File

PDLtune.prg

'
common shared Ax as generic Axis

program
	
	dim i as long

	Ax = A1
	with Ax
		Attach	
			Pedel = 1 ' first run
			Pedel = 1 + round(1.68 / 100.0 * 1000.0 / (bus[0].cycleTime/1000)) ' 2nd run. extracted from recordings
			Pedel = Pedel + 0.075 / 100.0 * 1000.0 / (bus[0].cycleTime/1000) ' 3rd run. extracted from recordings
			PeMax = 10
			En=1
			Sleep 100
			Move 0 Vcruise=100 Abs=TRUE
			call waitMotion
			Record ax_PE.rec 100000 Gap=1 RecData = Ax.Pe, Ax.Vcmd
			RecordOn
				Sleep 100
				for i = 1 to 3
					Move 100 Vcruise=100 Abs=TRUE
					call waitMotion
					Sleep 100
					Move 0 Vcruise=100 Abs=TRUE
					call waitMotion
					Sleep 100
				next
			RecordClose		
			En=FALSE
			Sleep 100
			PeMax = 0.1
		Detach
	end with
	
terminate program


sub waitMotion
	while Ax.IsMoving
		Sleep 1
	end while
end sub