USB Com Port Hickup?

Discussion of tinyG control platform
mristau
Posts: 27
Joined: Thu Nov 20, 2014 4:50 pm
Location: Northern Colorado
Contact:

USB Com Port Hickup?

Post by mristau » Sun Mar 08, 2015 7:31 pm

What do I need to adjust?
When sending a .txt setup file to TinyG via CoolTerm, I often get an "unrecognized" error for one or two of the commands. Re-sending the same file a time or two, no errors are reported. Or, no errors are reported and a query of all settings shows that a setting remains the default value (change was not made). Or, sending a short text file like:
(1)
$ja=2000000
()
$xjm=5000
$xjd=0.01
$xvm=16000
$xfr=16000
()
$yjm=5000
$yjd=0.01
$yvm=16000
$yfr=16000

reports on only two of the commands sent:
(1)
tinyg [mm] ok>
tinyg [mm] ok>
$ja=2000000
[ja] junction acceleration 2000000 mm <<<<<<<<<
tinyg [mm] ok>
tinyg [mm] ok>
()
tinyg [mm] ok>
tinyg [mm] ok>
$xjm=5000 <<<<<<<<<<
[xjm] x jerk maximum 5000 mm/min^3 * 1 million
tinyg [mm] ok>
Build in progress: 1100x1100mm workarea using salvaged 45x45mm extrusions with Openrail, tinyG/435.10/v.0.97, NEMA 23s, belt drive XY, Acme Z, 400W PWM Spindle, lasercut 1/2" acrylic motor/wheel mount plates.

cmcgrath5035
Posts: 61
Joined: Thu Oct 31, 2013 6:56 pm
Location: Florida, USA

Re: USB Com Port Hickup?

Post by cmcgrath5035 » Mon Mar 09, 2015 11:47 am

The answer to your issue is likely forund in this paragraph in the wiki: https://github.com/synthetos/TinyG/wiki ... n-commands
Writes to the tinyG persistent memory (EEPROM) require a finite period of time during which the input I/O is ignored.
If you send a long string of sequential writes such as this, many of the commands will be lost or corrupted.
To be successful, you need to code up an application that will read your file of commands and send them one at a time, waiting for a response from tinyG before sending the next command.
If you are curious how this is done, you can fork the configuretinyg widget in Chilipeppr for a javascript example.
Other folks have created solutions, perhaps they will share.
It is not a trivial task for a non-programmer.

PS
If your footer is correct and you are still running fe 435.10, I suggest a fw update. FW 440.14 is available
ShapeOko (V1) SN 1462
Dual 820mm Y, Double X, ACMEZ. V2 Motor Plates
TinyG V7 Controller; DUE and tinyGV9 test bed for tinyG2

jlauer
Posts: 115
Joined: Thu Jun 26, 2014 9:29 pm

Re: USB Com Port Hickup?

Post by jlauer » Mon Mar 09, 2015 5:31 pm

I think this is an easy one. Just wait 40ms after each command that would write to EEPROM. If you send quicker than that you get the error you're talking about.

When you see it work after sending it a few times, what you're seeing is that it doesn't have to write to EEPROM so it skips it thus it doesn't need the 40ms wait.

mristau
Posts: 27
Joined: Thu Nov 20, 2014 4:50 pm
Location: Northern Colorado
Contact:

Re: USB Com Port Hickup?

Post by mristau » Tue Mar 10, 2015 12:04 am

Thanks for pointers guys.
Use to do some coding but it's all beyond me now.
So, there are no communication settings or commands to add that will slow the sending. I guess "status interval" is just TinyG reporting back to control computer? Where to change to 40ms? I can cut and paste them... I've not used chillipeppr. Is there some Windows utility that will allow such control?
Build in progress: 1100x1100mm workarea using salvaged 45x45mm extrusions with Openrail, tinyG/435.10/v.0.97, NEMA 23s, belt drive XY, Acme Z, 400W PWM Spindle, lasercut 1/2" acrylic motor/wheel mount plates.

cmcgrath5035
Posts: 61
Joined: Thu Oct 31, 2013 6:56 pm
Location: Florida, USA

Re: USB Com Port Hickup?

Post by cmcgrath5035 » Tue Mar 10, 2015 10:52 am

Settings that would help? None that I am aware of in Coolterm.

I think what John is suggesting is a Script that would

Code: Select all

Provision the Serial Interface
Read in a line (while not EOF)  //Top of loop
Send line to serial interface
Wait X ms  //Give EEPROM write time to complete
Loop // back to read line in
You might be able to have the script interact with CoolTerm, I have never tried.

Since Speed should not be of huge importance, I would suggest a Wait of 100ms is safer.
I have seen command write response times vairy between 15ms and 80ms when running a list of parameter writes

Status interval?
I assume you mean the tinyG parameter $si ?
When a job (Gcode) is running, tinyG will stream back to the sender (e.g. CoolTerm) machine status reports every $si ms, position+velocity information.
ShapeOko (V1) SN 1462
Dual 820mm Y, Double X, ACMEZ. V2 Motor Plates
TinyG V7 Controller; DUE and tinyGV9 test bed for tinyG2

mristau
Posts: 27
Joined: Thu Nov 20, 2014 4:50 pm
Location: Northern Colorado
Contact:

Re: USB Com Port Hickup?

Post by mristau » Fri Mar 13, 2015 4:17 am

This page on Flow Control and Footers was informative.
https://github.com/synthetos/TinyG/wiki ... nd-Footers
Last edited by mristau on Fri Mar 13, 2015 5:38 am, edited 1 time in total.
Build in progress: 1100x1100mm workarea using salvaged 45x45mm extrusions with Openrail, tinyG/435.10/v.0.97, NEMA 23s, belt drive XY, Acme Z, 400W PWM Spindle, lasercut 1/2" acrylic motor/wheel mount plates.

mristau
Posts: 27
Joined: Thu Nov 20, 2014 4:50 pm
Location: Northern Colorado
Contact:

Re: USB Com Port Hickup?

Post by mristau » Fri Mar 13, 2015 5:37 am

The solution to this problem is right in front of me face!
CoolTerm already has the control needed:
Connection> Options...> Transmit> Use transmit line delay
Attachments
image.jpg
image.jpg (46.45 KiB) Viewed 1350 times
Build in progress: 1100x1100mm workarea using salvaged 45x45mm extrusions with Openrail, tinyG/435.10/v.0.97, NEMA 23s, belt drive XY, Acme Z, 400W PWM Spindle, lasercut 1/2" acrylic motor/wheel mount plates.

jlauer
Posts: 115
Joined: Thu Jun 26, 2014 9:29 pm

Re: USB Com Port Hickup?

Post by jlauer » Fri Mar 13, 2015 10:17 am

Or send from chilipeppr via a macro with coding a delay using settimeout().

cmcgrath5035
Posts: 61
Joined: Thu Oct 31, 2013 6:56 pm
Location: Florida, USA

Re: USB Com Port Hickup?

Post by cmcgrath5035 » Sat Mar 14, 2015 3:10 am

Interesting find in CoolTerm, let us know if it works for you.
ShapeOko (V1) SN 1462
Dual 820mm Y, Double X, ACMEZ. V2 Motor Plates
TinyG V7 Controller; DUE and tinyGV9 test bed for tinyG2

mristau
Posts: 27
Joined: Thu Nov 20, 2014 4:50 pm
Location: Northern Colorado
Contact:

Re: USB Com Port Hickup?

Post by mristau » Sat Mar 14, 2015 3:12 am

Works great!
Build in progress: 1100x1100mm workarea using salvaged 45x45mm extrusions with Openrail, tinyG/435.10/v.0.97, NEMA 23s, belt drive XY, Acme Z, 400W PWM Spindle, lasercut 1/2" acrylic motor/wheel mount plates.

Post Reply