Hi, quick background intro:
I built a polar printer and did some modifications to Klipper to make it print reliable. I’m currently trying to polish my code so it can be pushed into the main branch (hopefully :D). And to confirm, that my ideas are not completely stupid, I want to discuss some of them over the next few months here.
The Idea
Automatic scaling of velocity in the polar kinematic.
The Problem
If the printhead moves closer to the origin, the bed moves faster and faster until there is an MCU timer error, because the motor has to run too fast.
Scope
We ignore the elephant in the room: the “singularity” in the origin (0/0). I just want to print on all other points.
The Current Implementation
The speed and acceleration is currently adjusted, depending on the distance of the line to be travelled from the origin (dashed line in the picture). The scaling factor is calculated by dividing a “maximum rotational velocity”-variable from the config by the max rotational velocity component of the move. The latter is calculated by splitting the “max_cruise_v2” from the check_move(move) variable into R-velocity and rotational-velocity components.
Since this scaled every move, I clamped the value to a minimum velocity (so it will not go down to basically 0) and a maximum activation distance (green dotted line).
Current Problems
- Every move coming too close to origin will be scaled → If you go from one side to the other, it will be scaled down and takes for ages. My current solution would be to split the moves, but I have no idea how to implement this properly into the polar kinematic. Maybe the new plugin system can be used, or an “extra” will be written.
Thx for reading, I hope for a fruitful discussion