Hi guys,
thanks again for your ideas and tips. It's been a while now, but I implemented and tested many ideas. In the meantime, I finished my toolchanger conversion and can finally perform proper tests.
I have tested the following:
1) An accelerometer mounted on the Tool-Carrier
@rjenkinsgb said in Direction/Velocity Vector of Printhead movement:
Could you use an accelerometer on the tool?
That would give instantaneous direction & acceleration ( so indirectly, velocity).
The idea is great, but after a few tests I unfortunately noticed that any vibration (door slam) affects my LED control. I know I could further process the sensor data through the Raspberry Pi and could solve the problem. But I don't like the fact that unplanned environmental influences can affect my control.
@t3p3tony said in Direction/Velocity Vector of Printhead movement:
@rjenkinsgb as it stands the accelerometer data is saved to a file during capture, not directly accessible through the object model.
I solved this problem by connecting the accelorometer directly to the Raspberry Pi.
2) Stay ahead of the movement with a code logger
@o_lampe said in Direction/Velocity Vector of Printhead movement:
IMHO to get ahead of the queue, you need to simulate gcode in real time on the Pi and send data to Duet simultaneously
@o_lampe has brought me to the idea, to analyze the queue with a code logger, make my calculations and keep them in a kind of buffer until I reach the current position. For this I wrote a script using the dsf-pyhthon API, which stores the commands that are sent to the RRF (State: Executed) and compares them with the current position.
The problems I have with this concept ist that I lose my reference when changing between absolute and relative positioning. Here I would have to program a parser that reads G90/G91 commands in addition to the G0/G1 and store the future absolute Position, as it probably is implemented in the RRF. This makes the script sluggish and not real-time capable. Or maybe my programming skills are just too bad to implement something like that.
3) My current concept
@resam said in Direction/Velocity Vector of Printhead movement:
Concrete printer and knife follower have definitely been a topic here. Usually they get controlled with an extra axis which gets positional movement instructions from the slicer / gcode directly (instead of trying to calculate it on the fly). See https://forum.duet3d.com/topic/6993/requests-for-help-gcode-cam-follower-tangential-knife-control
Thanks to @resam for the forum post by @Russ-Gries. Following the discussions in this forum, I would like to proceed as follows:
- instead of trying to calculate the Position of the LED ring on the fly, i want the LED ring to be seen as an additional axis
- a post processing script should extend the positional arguments with another corrdinate (e.g. U) => alredy done
- Position U shall be recognized by a plugin (DSF Command Subscription around the OM) and control the LED Ring
My current problems are:
- if I don't configure U as an addition axis, G1 U10 commands are not parsed and not passed to the OM
- if I configure U as a kind of "virtual axis" the LED ring acts like a motor. This gives me delays caused by the path calculation, especially if I have multiple circular movements when the position changes from 360 to 0.
I am surprised that such a simple task (turn on LED in feed direction) becomes such a complicated project. Does anyone have an idea how I can configure a virtual axis but not "move" it as a real one? I have read about a second DDA ring, but haven't dived into it yet. Would that also be a possible solution?