Import LinuxCNC source tree

This commit is contained in:
Wang Dequan
2026-08-20 06:17:39 +08:00
commit 2c814634c3
9429 changed files with 10556013 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#!/usr/bin/tclsh
# Restore axis limits to INI settings
set kinstype 0 ;# 0: DEFAUlT kins type
set switchkins_pin 3 ;# agree with inifile
set coords "x y z a b c" ;# agree with inifile module coordinates=
package require Linuxcnc ;# must be beore Hal
emc_init -ini $::env(INI_FILE_NAME) -quick
package require Hal
parse_ini $::env(INI_FILE_NAME)
# RESTORE INI axis limits
foreach l $coords {
set L [string toupper $l]
catch {hal setp ini.$l.min_limit [set ::AXIS_[set L](MIN_LIMIT)]}
catch {hal setp ini.$l.max_limit [set ::AXIS_[set L](MAX_LIMIT)]}
catch {hal setp ini.$l.min_velocity [set ::AXIS_[set L](MAX_VELOCITY)]}
catch {hal setp ini.$l.max_acceleration [set ::AXIS_[set L](MAX_ACCELERATION)]}
}
set script [info script]
switch -exact [emc_mode] {
mdi { emc_mdi m68 e$switchkins_pin q$kinstype ;# switch
emc_mdi m66 e0l0 ;# sync
puts "$script: MDI: Limits updated and kins switched to type$kinstype"
}
manual {puts "$script: Must be in mdi mode"}
auto {puts "$script: Limits updated in auto mode, sync required"}
default {puts "$script: Unknown mode"}
}
# gcode programs should follow this command
# with M428 to switch kinematics and sync

View File

@@ -0,0 +1,33 @@
#!/usr/bin/tclsh
# switch kinematics and change axis limits to equiv joint limits
set kinstype 1 ;# 1: IDENTITY kins
set switchkins_pin 3 ;# agree with inifile
set max_joints 6 ;# agree with inifile
set coords "x y z a b c" ;# agree with module coordinates=
package require Linuxcnc ;# must be beore Hal
emc_init -ini $::env(INI_FILE_NAME) -quick
package require Hal
parse_ini $::env(INI_FILE_NAME)
# SET axis limits for IDENTITY kins using INI joint limits
for {set j 0} {$j < $max_joints} {incr j} {
set l [lindex $coords $j]
catch {hal setp ini.$l.min_limit [set ::JOINT_[set j](MIN_LIMIT)]}
catch {hal setp ini.$l.max_limit [set ::JOINT_[set j](MAX_LIMIT)]}
catch {hal setp ini.$l.max_velocity [set ::JOINT_[set j](MAX_VELOCITY)]}
catch {hal setp ini.$l.max_acceleration [set ::JOINT_[set j](MAX_ACCELERATION)]}
}
set script [info script]
switch -exact [emc_mode] {
mdi { emc_mdi m68 e$switchkins_pin q$kinstype ;# switch
emc_mdi m66 e0l0 ;# sync
puts "$script: MDI: Limits updated and kins switched to type$kinstype"
}
manual {puts "$script: Must be in mdi mode"}
auto {puts "$script: Limits updated in auto mode, sync required"}
default {puts "$script: Unknown mode"}
}
# gcode programs should follow this command
# with M429 to switch kinematics and sync

View File

@@ -0,0 +1,33 @@
#!/usr/bin/tclsh
# switch kinematics and change axis limits
set kinstype 2 ;# 2: TYPE 2 kins
set switchkins_pin 3 ;# agree with inifile
set max_joints 6 ;# agree with inifile
set coords "x y z a b c" ;# agree with module coordinates=
package require Linuxcnc ;# must be beore Hal
emc_init -ini $::env(INI_FILE_NAME) -quick
package require Hal
parse_ini $::env(INI_FILE_NAME)
# SET axis limits for IDENTITY kins using INI joint limits
for {set j 0} {$j < $max_joints} {incr j} {
set l [lindex $coords $j]
catch {hal setp ini.$l.min_limit [set ::JOINT_[set j](MIN_LIMIT)]}
catch {hal setp ini.$l.max_limit [set ::JOINT_[set j](MAX_LIMIT)]}
catch {hal setp ini.$l.max_velocity [set ::JOINT_[set j](MAX_VELOCITY)]}
catch {hal setp ini.$l.max_acceleration [set ::JOINT_[set j](MAX_ACCELERATION)]}
}
set script [info script]
switch -exact [emc_mode] {
mdi { emc_mdi m68 e$switchkins_pin q$kinstype ;# switch
emc_mdi m66 e0l0 ;# sync
puts "$script: MDI: Limits updated and kins switched to type$kinstype"
}
manual {puts "$script: Must be in mdi mode"}
auto {puts "$script: Limits updated in auto mode, sync required"}
default {puts "$script: Unknown mode"}
}
# gcode programs should follow this command
# with M430 to switch kinematics and sync