本文主要是介绍linux系统学习笔记10——LinuxCNC配置单轴运动hal、xml、ini文件,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
关于LinuxCNC的hal、xml、ini文件的配置
LinuxCNC镜像系统安装步骤 linux系统学习笔记8——LiuxCNC镜像系统安装步骤
分享一下配置一个轴的配置文件 |
之前的文章提过,除了系统安装好,驱动装好,linuxcnc要想控制伺服,还需要对linuxcnc进行配置,分别配置xml hal ini 三个文件 |
机器人控制LinuxCNC与EtherCAT介绍&&PDO&SDO,搭建环境步骤
下面的三个文件配置是笔者使用的是合信的伺服 H1A.... |
xml
<masters><master idx="0" appTimePeriod="1000000" refClockSyncCycles="5"><slave idx="0" type="generic" vid="00000099" pid="00001000" configPdos="true"><sdoConfig idx="6060" subIdx="0"><sdoDataRaw data="08"/></sdoConfig><syncManager idx="0" dir="out"></syncManager><syncManager idx="1" dir="in"></syncManager><syncManager idx="2" dir="out"><pdo idx="1601"><pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="drivecontrol" halType="bit"/><pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="poscommand" halType="float" scale="1000"/></pdo></syncManager><syncManager idx="3" dir="in"><pdo idx="1A01"><pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="drivestatus" halType="bit"/><pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="pos" halType="float" scale="1000"/></pdo></syncManager><dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="250000"/></slave></master>
</masters>
文件中的pid 和 vid 根据自身的伺服修改. |
hal文件内容如下 |
HAL
loadusr -W lcec_conf deltaPos.xml
loadrt lcec
addf lcec.read-all servo-thread
addf lcec.write-all servo-threadsetp lcec.0.0.drivecontrol-1 1
setp lcec.0.0.drivecontrol-2 1net Xpos => lcec.0.0.poscommand
net Xachse_AF joint.0.amp-enable-out => lcec.0.0.drivecontrol-0
net Xachse_AF => lcec.0.0.drivecontrol-3
net Xachse_AF => lcec.0.0.drivecontrol-5
INI
[EMC]
VERSION = 1.1
MACHINE = LinuxCNC-HAL-SIM
DEBUG = 0[DISPLAY]
DISPLAY = axisCYCLE_TIME = 0.100
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
MAX_SPINDLE_OVERRIDE = 1.0
PROGRAM_PREFIX = ../../nc_files/
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 1
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
PROGRAM_EXTENSION = .py Python Scriptpng = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python[RS274NGC]
PARAMETER_FILE = sim.var[EMCMOT]EMCMOT = motmod
COMM_TIMEOUT = 1.0
BASE_PERIOD = 50000
SERVO_PERIOD = 1000000[TASK]
TASK = milltask
CYCLE_TIME = 0.001[HAL]HALUI = halui
HALFILE = core_sim.hal
HALFILE = sim_spindle_encoder.hal
HALFILE = axis_manualtoolchange.hal
HALFILE = simulated_home.hal
HALFILE = check_xyz_constraints.hal
HALFILE = deltaPos.hal[TRAJ]COORDINATES = X
HOME = 0
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 10
DEFAULT_LINEAR_ACCELERATION = 100
MAX_LINEAR_VELOCITY = 200
MAX_LINEAR_ACCELERATION = 800
POSITION_FILE = position.txt[EMCIO]EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = sim.tbl
TOOL_CHANGE_POSITION = 0
TOOL_CHANGE_QUILL_UP = 1[KINS]
KINEMATICS = trivkins coordinates=X
JOINTS = 1[AXIS_X]
MIN_LIMIT = -1000.0
MAX_LIMIT = 1000.0
MAX_VELOCITY = 200
MAX_ACCELERATION = 800.0[JOINT_0]TYPE = LINEAR
FERROR = 1.0
MIN_FERROR = 0.9
MAX_VELOCITY = 200.0
MAX_ACCELERATION = 800.0
MIN_LIMIT = -1000.0
MAX_LIMIT = 1000.0HOME_OFFSET = 1.0
HOME_SEARCH_VEL = 20.0
HOME_LATCH_VEL = 20.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 0
HOME_IS_SHARED = 1
后续分享6轴机械臂配置,以及配置文件详细解释 |
【关注微信公众号一起来交流】 |
这篇关于linux系统学习笔记10——LinuxCNC配置单轴运动hal、xml、ini文件的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!