I’m trying to acheive a low response time equivalent of LinuxCNC’s Python Interface jog command, which has this signature: jog(command, jjogmode, joint_num_or_axis_index, velocity[, distance]])
I don’t know how to get oid, and I don’t know how to go about sending this message. I was hoping to get a minimal example of how to do that from a Python script.
Also, I understand that there is step compression - is that something I could feed this list to, and get something more optimized?
Or, is my question naive or lazy in some way? Is there another approach entirely I should be taking?
I’ve done responsive keyboard/joystick control of multiple steppers from scratch, multiple times, on Arduino. I feel like, if I could get under the complexity of klipper, to send individual steps to each motor, I could get done what I need to. However, I don’t understand klipper well enough to know if that’s so.
Do you want to add this behavior to klippy, or to make a complete host replacement for jogging?
In klippy the queue_step commands are generated by an iterative solver that follows the motion of a trapezoidal queue. The (velocity) trapezes are generated by the move planner in toolhead.py. It ensures that the toolhead can be stopped after the “event horizon” of the gcode it already had access to.
I wouldn’t recommend bypassing all of it, it is likely easier to reuse the reusing the solver, kinematics and trapq. But you’ll have to figure out how to fill the trapq (and possibly how to update it), while ensuring that the toolhead can reach standstill from all steps in the way.
I think that most of Klipper does not apply to how I want to use it, and may even get in the way. I would really like to avoid writing kinematics, g-code parser, etc., if possible.
The machine I’m controlling is a photography rig, with a stage that has 3 rotational axes, and a camera that has 3 positional axes. I have other weird machines that I want to control next. I’m mostly setting up waypoints by manually driving to them them with joystick, then having the machine smoothly go through the waypoints.
Klipper may be the wrong tool for the job. I’m really looking for a programmable motion platform for developing robotics projects, where the motors/joints are sometimes manually controlled with joysticks.
If anyone has a better solution, please let me know. Right now, LinuxCNC seems to do what I want, but it requires so much hardware that it’s prohibitively large and expensive, for my plans. The way klipper can use 1 computer to control many MCU’s, most of them 3d printer control boards, is what I want.
Hi @ipsod
I’m wondering how you solved your question? I’d like also controlling a camera rig and found that those printer boards actually would fit quite nicely. In my case I’m using a BTT ocopus pro, currently with Marlin and attached joysticks but often it’s not smooth at higher speeds. the concept of Klipper sounds right to and therefore I’m looking also for a solution with commands.
How did you do it. Was it possible with Klipper in your case or what did you do?