July 11, 2018 at 5:08 am #25677
Just got my axidraw v3 and love it!
Really love the speed and openness.
I have some computervision setup where I want the axidraw to follow my hand.
Not sure what would be the best way to do this.
Having be doing some test with sending SM command over serial.
If I want my curves to be smooth I need to send really a lot of SM commands.
When this is hapening it’s difficult to stop it and take a different direction.
Any pointers on what could be the best solution for this?
Thx in advance
KrisJuly 11, 2018 at 10:39 am #25678Windell OskayKeymaster
It sounds like you need to pick between how real-time versus smooth you would like the behavior to be.
Genuinely real-time movement does not let you plan any motion, since you don’t know what the future will bring. That leads to several potential issues:
(1) Potentially moving too fast to stop or turn quickly
(2) Potential “gaps” in movement. If there is a time gap between subsequent motion commands, or not a smooth transition between subsequent motion commands, the motion will be jerky.
(3) Jerky movement for other reasons, for example sending movements in too short increments, such that the USB has trouble keeping up.
A few things to consider: Adding an intentional delay of (say) 100 ms between real time and intended movement can help a lot. You could make it such that motion commands are sent every 20 ms on a schedule (so that there are no gaps), such that each movement is aware of the present position and speed, and forms a bridge between where you are now (in position and speed) and where you want to be in 100 ms.July 11, 2018 at 3:44 pm #25680
Hey Windell, thx for the fast and detailed reply!
I did try sending these really short messages resulting in jerky and noisy behaviour thats why I thought to post it here before breaking my precious new machine :)
Will try to schedule it in 20ms segments, will there be stuttering when a package is send with 1ms to late? (can’t test it now, few days without my machine) I will prepare some code in a separate thread to be sure it runs correctly timed.
Additional question 1:
Would I benefit from using the LM command because it needs less processing time or is it only interesting when you want to have more control on the acceleration?
Additional question 2:
When the Inkscape extension draws these really smooth curves does it send a sequence of really small SM lines to the the axidraw or does it work differently?
thx for your time.
Will post the result when the project is finishedJuly 11, 2018 at 4:12 pm #25681Windell OskayKeymaster
The AxiDraw’s EBB control board has a (very short) command queue, the one-level deep FIFO. So long as each command arrives before the last move finishes, you’ll be in good shape. (You can query if a move is done, or if the FIFO is full if you need to, but generally it works well enough to calculate your moves on a rough schedule, and let your computer+USB do the heavy lifting of the scheduling.)
On the two questions:
(1) The processing time is negligible compared to the typical motion time, so no worries there.
(2) The AxiDraw software does use the SM command to execute its moves.July 11, 2018 at 4:27 pm #25682
Good to know SM will be good for the job.
And thanks again for your time really appreciate it.
- You must be logged in to reply to this topic.