MC-Basic:element.PROFILERTYPE

From SoftMC-Wiki
Revision as of 01:54, 30 October 2017 by Chi (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Language: English  • 中文(简体)‎

Defines the profiler-type used in the motion:

  • -1 - profile type is defined by the SmoothFactor (from version 4.7.3 only)
  • 0 – Velocity based trapezoidal velocity (TV)
  • 1 – Velocity based sine acceleration (SA)
  • 2 – Time based trapezoidal acceleration (TA) or trapezoidal velocity (TV)
  • 3 - Constant velocity profile (one sample acceleration and one sample deceleration)


IMPORTANT.svgIMPORTANT
  • If MODAL value of the PrfType equals -1 (default from 4.7.3!) the SmoothFactor is the only one who determines the profile type.

Values of the SmoothFactor between [1,100] and the value of -1 define the SINE-ACCELERATION profile and value of zero the VELOCITY-TRAPEZE profile.

  • If MODAL value of PrfType differs from -1, SmoothFactor has no influence on the type of the profile. Still the SmoothFactor defines the JERK value (as before).


The following table compare between Trapezoidal Velocity (0), Trapezoidal Acceleration (2) and Sine Acceleration (1) ProfilerTypes:

ProfilerType Trapezoidal Velocity (prftype = 0) Trapezoidal Acceleration (prftype = 2) Sine Acceleration (prftype = 1)
Position posi 0.PNG posi 2.PNG posi 1.PNG
Velocity velo 0.PNG velo 2.PNG velo 1.PNG
Acceleration acce 0.PNG acce 2.PNG
|acce 22.PNG
acce 01.PNG
|acce 11.PNG

To make this test by yourself, you can use the following MC-Basic PRG files with ControlStudio:

Config.PRG:

Sys.NumberAxes = 1

program

  Sys.DoubleFormat = 1
  Sys.NoMotion = 1
  a1.Simulated = 1   'optional
  
  Sys.Name = "single_axis"
  Print "system is running - " ; Sys.Name

end program


Prftprec.PRG:

program
with a1
	attach
	
		jerk = 11000
		VCruise = 200
		acc = 10000
		dec = 10000
		abs = 1
		en = 1	
	
		prftype = 1		'sine Acceleration session 
		record prftp_1.rec 1000000 recdata = a1.AccelCmd, a1.vcmd, a1.PCmd

		sleep 100
		move 0 
		while ismoving<>0
			sleep 10
		end while
		recordon
		move 100
		while ismoving<>0
			sleep 10
		end while
		recordclose
	
		prftype = 2		'Trapezoidal Acceleration session 
		record prftp_2.rec 1000000 recdata = a1.AccelCmd, a1.vcmd, a1.PCmd

		sleep 100
		move 0 
		while ismoving<>0
			sleep 10
		end while
		recordon
		move 100
		while ismoving<>0
			sleep 10
		end while
		recordclose

	
		prftype = 0		'Trapezoidal Velocity session 
		record prftp_0.rec 1000000 recdata = a1.AccelCmd, a1.vcmd, a1.PCmd

		sleep 100
		move 0 
		while ismoving<>0
			sleep 10
		end while
		recordon
		move 100
		while ismoving<>0
			sleep 10
		end while
		recordclose

	        prftype = 1    'Acceleration saturation case - Sine Acceleration ProfilerType
		acc = 100 
		dec = 100
		sleep 100
		move 0 
		while ismoving<>0
			sleep 10
		end while
		record acceEd_1.rec 1000000 recdata = a1.AccelCmd , a1.vcmd, a1.PCmd
		recordon
		move 100
		while ismoving<>0
			sleep 10
		end while
		recordclose

	        prftype = 2    'Acceleration saturation case - Trapezoidal Acceleration ProfilerType
		acc = 1000
		dec = 1000
		sleep 100
		move 0 
		while ismoving<>0
			sleep 10
		end while
		record acceEd_2.rec 1000000 recdata = a1.AccelCmd , a1.vcmd, a1.PCmd
		recordon
		move 100
		while ismoving<>0
			sleep 10
		end while
		recordclose
		
	detach
end with
	
		


end program

Short form

<element>.PrfType

Syntax

<element>.profilertype = <numeric expression>

Availability

Since Version 4.5.25

Type

Long

Range

-1 to 3

Default

-1 (from 4.7.3 version only)

Scope

Configuration, Task, Terminal

Limitations

Modal/Nodal

See Also