In theory there should be nothing to prevent the combination of two kinematics types
and a conditional test based upon whether a pin is set, to decide which is used.
Implementation might be a little more complicated.
The data structures would need combining so that any data storage required was available irrespective of which mode it started in.
The actual instant of changeover could reek havoc if it occurred midway through setting the joints say, so that would need to be catered for with a function
that acted upon the changeover pin changing state, clearing old data and establishing new defaults or whatever.
Regards activating, that is the simple bit.
Create a bit pin, called say combokins.state
Then just create a user M code which is a bash script which calls `setp combokins.state 1` or 0 as required
The 1 or 0 can be passed in the first arg (P) to the M code, just remember it will be passed as fp and needs conversion to an integer.
This code snippet from my lathe pulley speed setting script shows the process to convert and use case / esac to switch the input to the correct call
Like to hear how it goes.
## sets scale gain to make output speed accurate
## for each of 4 pulley settings
if [ ! $# -ge 1 ]; then
echo "Usage: M101 n - where n is speed range 1 - 4"
echo "param 2 is $2"
## emc takes the M101 P3 for example and passes
## $1 as 3.000000 and $2 as -1.000000 (because Q was not set)
## to this script!!!
## need to convert to int first
# DEBUG echo "$float converted to $int"
case $int in
1 ) halcmd setp scale.0.gain 0.595;;
# accurate at 1200 in M4 for turning
2 ) halcmd setp scale.0.gain 1.16;;
# accurate at 600 in M4 for turning
3 ) halcmd setp scale.0.gain 2.175;;
# accurate at 300 in M3 for threading
4 ) halcmd setp scale.0.gain 4.3;;
# accurate at 150 in M3 for threading
On 11/04/18 21:30, j...@allwinedesigns.com wrote:
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.
- [Machinekit] switching between ... john
- Re: [Machinekit] switching... 'schoone...@btinternet.com' via Machinekit
- Re: [Machinekit] switc... 'schoone...@btinternet.com' via Machinekit