MC-Basic:element.PROFILERTYPE/zh-hans

From SoftMC-Wiki
Jump to: navigation, search
语言: English  • 中文(简体)‎

缩写

<element>.PrfType

格式

<element>.profilertype = <numeric expression>

适用版本

从版本4.5.25起

描述

定义运动中的轨迹生成类型:

  • -1 - 轨迹类型由SmoothFactor定义 (仅从4.7.3起)
  • 0 – 速度基于梯形速度规划 (TV)
  • 1 – 速度基于正弦加速度规划 (SA)
  • 2 – 时间梯形加速度(TA)或梯形速度(TV)
  • 3 - 匀速曲线(一个加速度采样和一个减速度采样)


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).


以下表格比较了梯形速度(0),梯形加速度(2)和正弦加速度(1)轨迹生成器:

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

您可以使用ControlStudio使用以下MC-BasicPRG文件自己进行此测试:

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

类型

Long

取值范围

-1 to 3

单位

默认

-1 (from 4.7.3 version only)

使用范围

Configuration, Task, Terminal

限制

Modal/Nodal

例子

参考