I took a closer look at the thread I linked earlier and it looks like they 
weren't as successful as I previously thought. I'm only able to switch 
between modes when the rotary axes are at 0, which is the same issue they 
were having in the other thread. Their solution in that thread was to write 
a post processor that ensured the rotary axes were zeroed before switching 
modes. I'd prefer a solution that didn't involve a post processor, so I 
dove a little deeper into MachineKit's source code.

This is my first foray into MachineKit's source code, so I'd appreciate any 
feedback and/or tips! I am attempting to set up a mechanism to interface 
the motion module and the kinematics module using hal pins to get the 
desired kinematics switching behavior. I've created two pins on the motion 
module and the kinematics module:

1) carte_space_change_ok - output on the motion module, input on the 
kinematics module. When this pin is true, the kinematics module is safe to 
change kinematics modes.
2) carte_space_changed - input on the motion module, output on the 
kinematics module. This pin is set to true in the kinematicsForward 
function when a change to the hal pin that controls the mode has been 
detected.

The idea is the motion module will detect when carte_space_changed is set 
to true and then follow up by setting carte_space_change_ok to true once 
the machine can change modes. I'm unsure exactly what conditions should be 
considered safe to change modes (i.e. is checking GET_MOTION_INPOS_FLAG 
enough?). I'm also unsure what internals need to be changed to successfully 
change carte_pos_cmd. I've tried setting carte_pos_cmd directly, clearing 
the trajectory planner (tpClear(emcmotQueue)), setting the current position 
(tpSetPos(emcmotQueue, carte_pos_cmd)), and draining the joint's cubic 
interpolators. It successfully transitions from five axis kinematics to 
trivial kinematics, but as soon as I issue a move with gcode from MDI mode 
I get a follow error. I must be missing something else that needs to 
change. Any thoughts? Does this seem like a reasonable way to do it?

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

Reply via email to