Home › Forums › TinyG › TinyG Support › Python 3 – USB Write Strange feedback
- This topic has 1 reply, 2 voices, and was last updated 2 years, 7 months ago by cmcgrath5035.
-
AuthorPosts
-
April 26, 2022 at 4:56 am #12135Milner99Participant
Hi All,
I’m writing a python 3 script that integrates with our CMS on a project to automate carving. We have a TinyG connected to a Raspberry Pi 4b. Using Python 3 I’m opening the serial port and sending GCode.
Using ChilliPepper the carve seems to go ahead mostly fine.
Using the Python3 script sending GCode and reading the serial output I’m seeing some strange characters that I can’t decode – they come through on the shell output of Thonny as small squares?
Also when sending the GCode I read the ‘qr’ JSON value when available to ensure we don’t overflow the input buffer, we leave 10 slots free all the time. The serial writing seems to send OK however the carve seems to miss tool path steps. Changing the python 3 script to send and time.sleep(0.5) – rather than waiting on input buffer slots – the carve still misses steps.
Anyone come across this before? or can anyone offer any thoughts as to what’s going on?
Last questions – more of confirmation than anything – I can’t seem to set the Text or JSON config – am I right to assume that the tinyG will output the same format as the request?
Thanks in advance,
C
April 26, 2022 at 9:33 am #12136cmcgrath5035ModeratorWhat you are engaged in is beyond my level of expertise, here are some hints and ideas to pursue.
You report that your Gcode runs mostly fine using Chilipeppr. Buffer management in a Chilipeppr implementation is the role of SPJS, among other tasks. My gut impression is that “..leaving 10 slots free all the time..” does not match the SPJS methodology. I am making the assumption, by the way, that your Python3 session is communicating directly with TinyG, not via SPJS.
If you buffer management is not achieving the same fill rate dynamics, you may be forcing the motion planner to compute different motion paths.This sort of topic is much lower level than typically found in this forum. You should give a look at the issues area here https://github.com/synthetos/TinyG/issues here most developers are their thoughts and ideas. The G2 issues at https://github.com/synthetos/g2/issues might also provide some hints, although G2 code is now well beyond tinyG Master
Good luck with your project
-
AuthorPosts
- You must be logged in to reply to this topic.