Speed over TCP

258 views
Skip to first unread message

eSlavko

unread,
May 8, 2020, 4:25:07 AM5/8/20
to OpenPnP
Hello....

I do connect my PnP over ethernet cable from the start without problem.
Well I think that there are no problem. Today I installed some new toys on my ethernet but the router lack ports. So I disconnect PnP.. But After that I wan't to do some more tests on PnP so I just connect it via USB. On my surprise the PnP run way faster over USB. So I did simple test board run. I do two same tests with same feeders (reseted before test) and results are:

USB run 68 seconds (1200 CPH)
TCP run 121 seconds (684 CPH)

So why is USB near 2 times faster? I have gigabit ethernet so this shouldn't be problem.

p.s.
The machine moves are with same speed. The difference came from pause betwen two moves.


Jarosław Karwik

unread,
May 8, 2020, 4:27:33 AM5/8/20
to OpenPnP
If it is Smoothie - then it is known issue with latency of processing request from Ethernet. Nothing can be done about it - there was some discussion about it on the forum.

Arthur Wolf

unread,
May 8, 2020, 4:33:56 AM5/8/20
to ope...@googlegroups.com
Smoothie's USB is simply faster than it's Ethernet. This is mostly due to the hardware itself. Smoothie v2 will have much faster Ethernet ( but also faster USB we expect ).
You can try improving things by sending more compact Gcodes, more at a time in a single packet, but I would expect that would require editing the code in OpenPNP that does this.
Also, the protocol used to stream the Gcode is important, and can change latency/speed quite a bit. A good example of the best way to stream Gcodes to Smoothie over Ethernet can be found in the Smoopi project's code.

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/c9d7d9fa-58d7-4304-b905-38c977b67005%40googlegroups.com.


--
勇気とユーモア

Slavko Kocjancic

unread,
May 8, 2020, 4:40:12 AM5/8/20
to ope...@googlegroups.com
Yes it's Smoothie.

"Nothing can be done"
Take slowest ethernet as possible that latency is not hardware releated.
I assume that this is 100% software releated...

Sadly I seems to be forced to use unreliable USB instead reliable
ethernet to gain 2X speed. That's sad news.
> --
> You received this message because you are subscribed to the Google
> Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openpnp+u...@googlegroups.com
> <mailto:openpnp+u...@googlegroups.com>.
> <https://groups.google.com/d/msgid/openpnp/c9d7d9fa-58d7-4304-b905-38c977b67005%40googlegroups.com?utm_medium=email&utm_source=footer>.

Slavko Kocjancic

unread,
May 8, 2020, 4:42:20 AM5/8/20
to ope...@googlegroups.com
Can't find Smoopi project's

Arthur Wolf

unread,
May 8, 2020, 4:43:08 AM5/8/20
to ope...@googlegroups.com
On Fri, May 8, 2020 at 10:40 AM Slavko Kocjancic <esl...@gmail.com> wrote:
Yes it's Smoothie.

"Nothing can be done"
Take slowest ethernet as possible that latency is not hardware releated.
I assume that this is 100% software releated...
 
It's not.
This is the fastest we can go with the current hardware ( we are maxing out the chip in terms of clock cycles and RAM pretty hard ).

Sadly I seems to be forced to use unreliable USB instead reliable
ethernet to gain 2X speed. That's sad news.
 
As I said, there are gains to be had by changing the streaming method/protocol, see Smoopi source code.

To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/372ce477-e317-550f-4cce-71bb414e0998%40gmail.com.


--
勇気とユーモア

Arthur Wolf

unread,
May 8, 2020, 4:43:38 AM5/8/20
to ope...@googlegroups.com

On Fri, May 8, 2020 at 10:42 AM Slavko Kocjancic <esl...@gmail.com> wrote:
Can't find Smoopi project's

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.


--
勇気とユーモア

Florian Chende

unread,
May 8, 2020, 4:46:42 AM5/8/20
to OpenPnP
The ethernet is simply not designed for fast pacing small size packets.
I don't know how TCP comm is handled by openpnp, meaning I don't know if for each G code command a TCP socket is opened, command sent, then socket closed, or socket is kept open permanently. Opening a socket for each command means many more packets.
Ethernet speed is not an issue, I think it does not matter if you have 100 or 1g for this type of app. Latency is the problem, sending few tens of bytes of data takes much longer on eth versus usb. And that for direct eth connection. Each router on the way can add additional delays.

Jarosław Karwik

unread,
May 8, 2020, 5:47:17 AM5/8/20
to OpenPnP
it is not that.

I know, because I made several proffesional CNC controller designs comparable to Smoothie ( on LPC1769 - like V1, LPC4430 - like in V2, I have also newest one on STM32H7 family - 480Mhz dual core beasts).

Simply (as @Artur Wolf wrote ) - LPC1769 barely has  enough resources to what runs inside. If you add there TCP/IP stack and RTOS - it is crazy.
My design did not have RTOS and run simple uiP stack with UDP only.  If you have simple echo for requests in your UDP packet processing - then you do not need TCP sockets - which are power and resource hungry.
My latency in worst case was around 3ms - from request to response ( wireshark measured)

And in case of CNC and PNP - 99.9% of cases you should have your controller on separate network with nothing there. Disable in Windows everything except TCPV4 protcol and you will have no problems whatsoever with UDP communication.

Slavko Kocjancic

unread,
May 8, 2020, 6:54:51 AM5/8/20
to ope...@googlegroups.com
On 8. 05. 20 11:47, Jarosław Karwik wrote:
> it is not that.
>
> I know, because I made several proffesional CNC controller designs
> comparable to Smoothie ( on LPC1769 - like V1, LPC4430 - like in V2, I
> have also newest one on STM32H7 family - 480Mhz dual core beasts).
>
> Simply (as @Artur Wolf wrote ) - LPC1769 barely has  enough resources to
> what runs inside. If you add there TCP/IP stack and RTOS - it is crazy.
> My design did not have RTOS and run simple uiP stack with UDP only.  If
> you have simple echo for requests in your UDP packet processing - then
> you do not need TCP sockets - which are power and resource hungry.
> My latency in worst case was around 3ms - from request to response (
> wireshark measured)
>
> And in case of CNC and PNP - 99.9% of cases you should have your
> controller on separate network with nothing there. Disable in Windows
> everything except TCPV4 protcol and you will have no problems whatsoever
> with UDP communication.
>

As I said. Not hardware but software. I know that running all that
smothie already do is hard job for LPC. In our case the TCP/IP is real
overkill. As you already pointed the UDP should be used. Thus here we
need some protocol as packet may be lost. But in our case all thing is
simple as we send one line command and expect response. If there are no
response we just need to retransmitt command. (that must be numbered to
avoid double command).
...but it's hard work and must be done in both sides (smothie/openpnp).

Jarosław Karwik

unread,
May 8, 2020, 7:13:15 AM5/8/20
to OpenPnP
Well,

You can see here - I have been building new controller - specialized for OpenPNP


So there will be alternative - it does have its disadvantages ( as you would need two - one to be placed directly on the head), but it is designed from the scratch to OpenPnp in mind.

Slavko Kocjancic

unread,
May 8, 2020, 7:22:31 AM5/8/20
to ope...@googlegroups.com
On 8. 05. 20 13:13, Jarosław Karwik wrote:
> Well,
>
> You can see here - I have been building new controller - specialized for
> OpenPNP
>
> https://groups.google.com/forum/#!topic/openpnp/W7FLuodpUNA
>
> So there will be alternative - it does have its disadvantages ( as you
> would need two - one to be placed directly on the head), but it is
> designed from the scratch to OpenPnp in mind.
>
>

Even Smothie is not so bad. But it's bloated with some stuf that we
don't need and mising some that we need. For example:
I do use web browser to acess smothie and do config. But having complete
HTTP protocol for just comfort is not aceptable if functionality is
sacrified. For example instead TCP/IP / HTTP just reliable UDP
implementation.

Arthur Wolf

unread,
May 8, 2020, 7:24:50 AM5/8/20
to ope...@googlegroups.com
Adding a UDP interface to Smoothie would be trivial, it's just nobody has bothered/needed to do so up to this point...
And having the web interface isn't in any way preventing from having that ...

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.


--
勇気とユーモア

Slavko Kocjancic

unread,
May 8, 2020, 7:33:27 AM5/8/20
to ope...@googlegroups.com
On 8. 05. 20 13:24, Arthur Wolf wrote:
>
>
> Adding a UDP interface to Smoothie would be trivial, it's just nobody
> has bothered/needed to do so up to this point...
> And having the web interface isn't in any way preventing from having
> that ...
>
>
Wel I'm think that there are no room for implementation. I't seems
strange for me that nobody run over ethernet and have same problem.
At least one big + for ethernet is that by definition do groung loop
isolation. And Ground loop isolatihg USB is nightmare. Of course there
are cameras on USB but at least they can be isolated from rest of machine.

Arthur Wolf

unread,
May 8, 2020, 7:45:41 AM5/8/20
to ope...@googlegroups.com
On Fri, May 8, 2020 at 1:33 PM Slavko Kocjancic <esl...@gmail.com> wrote:
On 8. 05. 20 13:24, Arthur Wolf wrote:
>
>
> Adding a UDP interface to Smoothie would be trivial, it's just nobody
> has bothered/needed to do so up to this point...
> And having the web interface isn't in any way preventing from having
> that ...
>
>
Wel I'm think that there are no room for implementation.

I don't know what you mean, there definitely is.

I't seems
strange for me that nobody run over ethernet and have same problem.
 
People just use USB, if you are even a tiny bit careful anyone can get it to work just fine. Ethernet is more of a convenience thing for most users, having the interface to do config etc.

At least one big + for ethernet is that by definition do groung loop
isolation. And Ground loop isolatihg USB is nightmare.

Smoothie has tens of thousands of users using USB, all happily using their machine. I from time to time have to help a user figuring out a USB issue, I am yet to find one for whom we don't find a solution ...

Of course there
are cameras on USB but at least they can be isolated from rest of machine.

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.


--
勇気とユーモア

Jarosław Karwik

unread,
May 8, 2020, 7:55:58 AM5/8/20
to OpenPnP
I have several hundredths of professional machines which use both USB ( older generation) and ethernet .
While USB is OK for hobby environment, it is almost no-go for professional machines.
Most is related to grounding issues when you have longer cables ( most hobby machines do not have the issue) as well as USB weakness when it comes to EMC immunity -  try to use it in plasma or in environment where other heavy machinery operates ( again - not typical hobby environment).

So - it will work on your table in office ( as it was design for it), but not always in industrial environment.

And in case of ethernet - once network is configured - it will work. Even if you mess connection with EMC pulse - it will recover. And USB - not always ( I have tested it personally in lab - in different setups).




W dniu piątek, 8 maja 2020 13:45:41 UTC+2 użytkownik Arthur Wolf napisał:
On Fri, May 8, 2020 at 1:33 PM Slavko Kocjancic <esl...@gmail.com> wrote:
On 8. 05. 20 13:24, Arthur Wolf wrote:
>
>
> Adding a UDP interface to Smoothie would be trivial, it's just nobody
> has bothered/needed to do so up to this point...
> And having the web interface isn't in any way preventing from having
> that ...
>
>
Wel I'm think that there are no room for implementation.

I don't know what you mean, there definitely is.

I't seems
strange for me that nobody run over ethernet and have same problem.
 
People just use USB, if you are even a tiny bit careful anyone can get it to work just fine. Ethernet is more of a convenience thing for most users, having the interface to do config etc.

At least one big + for ethernet is that by definition do groung loop
isolation. And Ground loop isolatihg USB is nightmare.

Smoothie has tens of thousands of users using USB, all happily using their machine. I from time to time have to help a user figuring out a USB issue, I am yet to find one for whom we don't find a solution ...

Of course there
are cameras on USB but at least they can be isolated from rest of machine.

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ope...@googlegroups.com.


--
勇気とユーモア

Marek T.

unread,
May 8, 2020, 7:58:22 AM5/8/20
to OpenPnP
Yes Arthur, but 99% of them are 3D printers or CNC users. And theyhave in their computer only one USB for Smoothie, maybe another for some mouse.
For Openpnp we need have connected Smoothie, few other USB sub-drivers and two cameras - and it's really hard to compare to your typical customer's setup (if we speak about the computer/cpu load) plus Java doesn't help.
That's why using ethernet for Smoothie would be nice if working same good (fast) as USB. 3ms mentioned by Jaroslaw could be quite good.

Arthur Wolf

unread,
May 8, 2020, 7:59:40 AM5/8/20
to ope...@googlegroups.com
On Fri, May 8, 2020 at 1:56 PM Jarosław Karwik <jarosla...@gmail.com> wrote:
I have several hundredths of professional machines which use both USB ( older generation) and ethernet .
While USB is OK for hobby environment, it is almost no-go for professional machines.

I retrofit several large industrial machines with Smootiheboard every year. I am in contact with over a dozen people all over the world who do something similar. I am yet to have a single issue with USB in that context. If I do my job right, there's no reason to have any problem.

Most is related to grounding issues when you have longer cables

Well, that's just bad design, that's not really Smoothieboard's fault. Just don't have them ....

To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/e572fd26-510d-4f40-9cc0-90d115f8edf8%40googlegroups.com.


--
勇気とユーモア

Arthur Wolf

unread,
May 8, 2020, 8:02:04 AM5/8/20
to ope...@googlegroups.com
On Fri, May 8, 2020 at 1:58 PM Marek T. <marek.tw...@gmail.com> wrote:
Yes Arthur, but 99% of them are 3D printers or CNC users. And theyhave in their computer only one USB for Smoothie, maybe another for some mouse.

That's not true. Smoothie is used in an extremely wide variety of machines, including plenty that have the same sorts of setup as openpnp machines.
I start helping a new person with a build nearly every day, and there is a lot of variety.

For Openpnp we need have connected Smoothie, few other USB sub-drivers and two cameras - and it's really hard to compare to your typical customer's setup (if we speak about the computer/cpu load) plus Java doesn't help.
That's why using ethernet for Smoothie would be nice if working same good (fast) as USB. 3ms mentioned by Jaroslaw could be quite good.

You can always just use a UART, that won't have the issues of USB, and will have the same speeds and latency. Fully supported by Smoothie out of the box. Make it differential if you are going over a meter. Pretty cheap too. Really no need for Ethernet.

Smoothie has tens of thousands of users using USB, all happily using their machine. I from time to time have to help a user figuring out a USB issue, I am yet to find one for whom we don't find a solution ...

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.


--
勇気とユーモア

Marek T.

unread,
May 8, 2020, 9:06:41 AM5/8/20
to OpenPnP
I have completely forgotten about this option. Really worth to remember.

Slavko Kocjancic

unread,
May 8, 2020, 9:38:27 AM5/8/20
to ope...@googlegroups.com
On 8. 05. 20 15:06, Marek T. wrote:
> I have completely forgotten about this option. Really worth to remember.
>
> /You can always just use a UART, that won't have the issues of USB,
> and will have the same speeds and latency. Fully supported by
> Smoothie out of the box. Make it differential if you are going over
> a meter. Pretty cheap too. Really no need for Ethernet./
>

I wasn't avared too on that.

Btw I have USB issue some time ago and it was not possible to solve that
without isolation. The industrial fan (80kW power) line was on other
side of drywal to office. And in same wall in office was chanel with usb
cable 3m long to some device. Whatever I do (grounding, shielding,
toroids, ....) the USB drop communication when fan starts. (the power
for device and computer are not from same fuse box). Changing that to
isolated RS485 solve all problems.

If controller (smothie) and computer is powered from same fuse (usually
same extension cord) there should be no problem. But if you have general
UPS for all computers in building for example then you WILL have ground
loop troubles.

Arthur Wolf

unread,
May 8, 2020, 9:41:22 AM5/8/20
to ope...@googlegroups.com
On Fri, May 8, 2020 at 3:38 PM Slavko Kocjancic <esl...@gmail.com> wrote:
On 8. 05. 20 15:06, Marek T. wrote:
> I have completely forgotten about this option. Really worth to remember.
>
>     /You can always just use a UART, that won't have the issues of USB,
>     and will have the same speeds and latency. Fully supported by
>     Smoothie out of the box. Make it differential if you are going over
>     a meter. Pretty cheap too. Really no need for Ethernet./
>

I wasn't avared too on that.

Btw I have USB issue some time ago and it was not possible to solve that
without isolation. The industrial fan (80kW power) line was on other
side of drywal to office. And in same wall in office was chanel with usb
cable 3m long to some device.

That's a design issue then. Nobody should design industrial systems with USB cables 3 meters long. Most of the USB cables I use in customer's machines are about 10cm long ...

Whatever I do (grounding, shielding,
toroids, ....) the USB drop communication when fan starts. (the power
for device and computer are not from same fuse box). Changing that to
isolated RS485 solve all problems.

If controller (smothie) and computer is powered from same fuse (usually
same extension cord) there should be no problem. But if you have general
UPS for all computers in building for example then you WILL have ground
loop troubles.

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.


--
勇気とユーモア

Jarosław Karwik

unread,
May 8, 2020, 10:39:41 AM5/8/20
to OpenPnP
How do you connect main machine controller - which is placed in separate machine compartment  - to main control computer when machine itself is 2x3 m??
Most of my machines look like this  - and here ethernet between machine and computer is the only viable solution.

lynx.jpg






W dniu piątek, 8 maja 2020 15:41:22 UTC+2 użytkownik Arthur Wolf napisał:
On Fri, May 8, 2020 at 3:38 PM Slavko Kocjancic <esl...@gmail.com> wrote:
On 8. 05. 20 15:06, Marek T. wrote:
> I have completely forgotten about this option. Really worth to remember.
>
>     /You can always just use a UART, that won't have the issues of USB,
>     and will have the same speeds and latency. Fully supported by
>     Smoothie out of the box. Make it differential if you are going over
>     a meter. Pretty cheap too. Really no need for Ethernet./
>

I wasn't avared too on that.

Btw I have USB issue some time ago and it was not possible to solve that
without isolation. The industrial fan (80kW power) line was on other
side of drywal to office. And in same wall in office was chanel with usb
cable 3m long to some device.

That's a design issue then. Nobody should design industrial systems with USB cables 3 meters long. Most of the USB cables I use in customer's machines are about 10cm long ...

Whatever I do (grounding, shielding,
toroids, ....) the USB drop communication when fan starts. (the power
for device and computer are not from same fuse box). Changing that to
isolated RS485 solve all problems.

If controller (smothie) and computer is powered from same fuse (usually
same extension cord) there should be no problem. But if you have general
UPS for all computers in building for example then you WILL have ground
loop troubles.

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ope...@googlegroups.com.


--
勇気とユーモア

eSlavko

unread,
May 8, 2020, 10:52:03 AM5/8/20
to OpenPnP
Thumbs up.
That I talking about.

Arthur Wolf

unread,
May 8, 2020, 10:55:06 AM5/8/20
to ope...@googlegroups.com
On Fri, May 8, 2020 at 4:39 PM Jarosław Karwik <jarosla...@gmail.com> wrote:
How do you connect main machine controller - which is placed in separate machine compartment  - to main control computer when machine itself is 2x3 m??
Most of my machines look like this  - and here ethernet between machine and computer is the only viable solution.
 
That's bad design then, it's another issue.
Most CNC routers I've had to work with had the cnc controller and the controlling computer in the same stand a few centimeters appart.
Even if they aren't, if you have to have a long cable, you don't stream the gcode over it, you run whatever software inside the machine, and control it remotely.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/c3f819d3-b0a2-49fb-b4d5-386d59de66b0%40googlegroups.com.


--
勇気とユーモア

Bernd Walter

unread,
May 8, 2020, 11:22:17 AM5/8/20
to ope...@googlegroups.com
On Fri, May 08, 2020 at 07:39:41AM -0700, Jaros??aw Karwik wrote:
> How do you connect main machine controller - which is placed in separate
> machine compartment - to main control computer when machine itself is 2x3
> m??
> Most of my machines look like this - and here ethernet between machine and
> computer is the only viable solution.

My OpenPnP computer is about 5m away from the machine and runs on another
electrical phase.
However, my machine has a local raspberry, which hooks up all the USB
controllers locally.
OpenPnP itself connects via TCP and a few ethernet switches to the Pi, which
then converts it into USB using socat.
Since I have a couple of USB controllers, I also have a range of TCP
connections.

--
B.Walter <be...@bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.

Slavko Kocjancic

unread,
May 8, 2020, 11:36:59 AM5/8/20
to ope...@googlegroups.com
On 8. 05. 20 17:22, Bernd Walter wrote:
> On Fri, May 08, 2020 at 07:39:41AM -0700, Jaros??aw Karwik wrote:
>> How do you connect main machine controller - which is placed in separate
>> machine compartment - to main control computer when machine itself is 2x3
>> m??
>> Most of my machines look like this - and here ethernet between machine and
>> computer is the only viable solution.
>
> My OpenPnP computer is about 5m away from the machine and runs on another
> electrical phase.
> However, my machine has a local raspberry, which hooks up all the USB
> controllers locally.
> OpenPnP itself connects via TCP and a few ethernet switches to the Pi, which
> then converts it into USB using socat.
> Since I have a couple of USB controllers, I also have a range of TCP
> connections.
>

That's another computer...


ma...@makr.zone

unread,
May 8, 2020, 11:45:42 AM5/8/20
to ope...@googlegroups.com

> That's bad design then... 

Come on Arthur, you're not serious now.

Your UART hint was the right answer. More is not needed or asked.

Smoothie's Ethernet implementation is flawed. You should simply admit it and move on and improve it for Smoothie 2.0.

Personally I use an USB isolator (already on the Azteeg X5 GT 32 board) and make sure the cameras are not grounded to the machine. And everything is good even with my 5m cable. Others can add an external isolator like this one.

> Most of the USB cables I use in customer's machines are about 10cm long ...

Now if Smoothieboard requires that, then that is real bad design.

There is a USB specification that tells us we can add 5m cables if we like. And for the USB 1.1 bandwidth we use, that's really not asked too much.

https://en.wikipedia.org/wiki/USB#Cabling

So the good design decision would be to finally add the Isolator to Smoothie 2.0.  At least for the prime and the pro.

_Mark

Slavko Kocjancic

unread,
May 8, 2020, 11:49:58 AM5/8/20
to ope...@googlegroups.com
... bottomline

Speed over Ethernet can be improved with UDP instead TCP.
To implement that both side must talk same language.

Just for example

each UDP frame is command or response and start with serial sequence
(1,2,3,4...9, rollover 1,2)

Transmiter send command...
If doesn't get response on timeout retransmit same frame...

When receiver get frame and serial sequence is different of last
received then execute frame and acknolwedge.

If receiver receive same serial sequence as last then just resend ack.



But someone need to do that. My experience to limited to do that.


ma...@makr.zone

unread,
May 8, 2020, 12:22:17 PM5/8/20
to ope...@googlegroups.com

Slavko , all that you are describing that's exactly what TCP is doing and with many optimizations. I doubt you (or anyone) can do it better/faster with reasonable effort. 

"TCP provides reliable, ordered, and error-checked delivery of a stream of octets (bytes) between applications running on hosts communicating via an IP network."

https://en.wikipedia.org/wiki/Transmission_Control_Protocol

TCP is old enough (1974) to make sure it runs efficiently on MCUs, certainly as a single connection. There are highly optimized implementations available.

One-to-one connection UDP only makes sense if you can afford to drop information in exchange for very low latency like on an audio transmission etc. and that is certainly not the case here.

_Mark

Marek T.

unread,
May 8, 2020, 12:41:24 PM5/8/20
to OpenPnP
Hi Mark,

I've had a good fun reading your answer :-).

But seruous question, how do you connect camera to the PC with relation to the isolator you show?

Slavko Kocjancic

unread,
May 8, 2020, 12:51:22 PM5/8/20
to ope...@googlegroups.com
Mark I know that.

TCP make a lot of other thing too. I'm just curious where that massive
lattency or whatewer is produced. I mean over 2 second delay per part!?!?

...but for now I drive PnP with laptop. Just 2 USB ports/one controller.
Both camera works. But with hub seems that (at least) one camera froze
over time. So with that hardware I can go just over TCP.

For future will probably use ordinary computer with serial port or at
least USB port with isolation.


Slavko.

On 8. 05. 20 18:22, ma...@makr.zone wrote:
> Slavko , all that you are describing that's exactly what TCP is doing
> and with many optimizations. I doubt you (or anyone) can do it
> better/faster with reasonable effort.
>
> /"//TCP provides //reliable
> <https://en.wikipedia.org/wiki/Reliability_(computer_networking)>//,
> ordered, and //error-checked
> <https://en.wikipedia.org/wiki/Error_detection_and_correction>//delivery
> of a stream of //octets
> <https://en.wikipedia.org/wiki/Octet_(computing)>//(bytes) between
> applications running on hosts communicating via an IP network."/
>
> https://en.wikipedia.org/wiki/Transmission_Control_Protocol
>
> TCP is old enough (1974) to make sure it runs efficiently on MCUs,
> certainly as a single connection. There are highly optimized
> implementations available. <https://en.wikipedia.org/wiki/UIP_(micro_IP)>

Slavko Kocjancic

unread,
May 8, 2020, 12:52:50 PM5/8/20
to ope...@googlegroups.com
On 8. 05. 20 18:41, Marek T. wrote:
> Hi Mark,
>
> I've had a good fun reading your answer :-).
>
> But seruous question, how do you connect camera to the PC with relation
> to the isolator you show?
>

They allready write that!
"and make sure the cameras are not grounded to the machine"


> W dniu piątek, 8 maja 2020 17:45:42 UTC+2 użytkownik ma...@makr.zone
> napisał:
>
> /> That's bad design then...
> /
>
> //
>
> /Come on Arthur, you're not serious now.
> /
>
> //
>
> /Your UART hint was the right answer. More is not needed or asked.
> /
>
> //
>
> /Smoothie's Ethernet implementation is flawed. You should simply
> admit it and move on and improve it for Smoothie 2.0. /
>
> //
>
> /Personally I use an USB isolator (already on the Azteeg X5 GT 32
> board
> <https://www.panucatt.com/azteeg_X5_GT_reprap_3d_printer_controller_p/ax5gt.htm>)
> and make sure the cameras are *not *grounded to the machine. And
> everything is good even with my 5m cable. Others can add an external
> isolator like this one <https://www.adafruit.com/product/2107>. /
>
> --
> You received this message because you are subscribed to the Google
> Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openpnp+u...@googlegroups.com
> <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/openpnp/b5f447ae-a65a-43a9-ad27-08962ccde2a2%40googlegroups.com
> <https://groups.google.com/d/msgid/openpnp/b5f447ae-a65a-43a9-ad27-08962ccde2a2%40googlegroups.com?utm_medium=email&utm_source=footer>.

Marek T.

unread,
May 8, 2020, 1:03:19 PM5/8/20
to OpenPnP
It's not an answer for my question.
Not grounded to the machine but where? And how Vcc supplied If there is an isolator connected by the way.

ma...@makr.zone

unread,
May 8, 2020, 1:05:17 PM5/8/20
to ope...@googlegroups.com

Hi Marek,

Remember, I still need two connections because I have the 1080p30fps / 720p60fps ELP cameras and those use higher bandwidth than the OpenPnP-recommended "standard" ELP cameras with just 720p30fps i.e. only one of my cameras is supported per USB root hub.

So I have two USB cables running to the machine. On the machine there is a tiny passive hub for the bottom camera and the controller, which has the isolator. 

The second USB cable goes to the down-looking camera. 

So the cameras and the hub and the isolator run on the computer's ground. Everything else is on machine ground.

https://makr.zone/grounding-the-machine/283/

_Mark

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.

Jarosław Karwik

unread,
May 8, 2020, 1:11:14 PM5/8/20
to OpenPnP
Well, you would need dc/dc converter.

My last USB based CNC controller were using ADUM4160.
It helps really much ( solves like 95% of issues), but there were still two problems:
- Large EMC could still block USB .  I think there were some issues either with Windows drivers  as the USB sometimes could not recover and whole computer needed reset. Rarely seen, but with enough cases to be sure that there is a problem.
- Really large EMC could burn the isolators - even protected according to their datasheet applications.

Marek T.

unread,
May 8, 2020, 1:18:40 PM5/8/20
to OpenPnP
Clear now,thx!

Arthur Wolf

unread,
May 8, 2020, 1:26:06 PM5/8/20
to ope...@googlegroups.com
On Fri, May 8, 2020 at 5:45 PM ma...@makr.zone <ma...@makr.zone> wrote:

> That's bad design then... 

Come on Arthur, you're not serious now.


This is my job. I do a lot of retrofits.
All of them have the computer right near the controller. If you want to deport the screen and keyb/mouse to a wheeled platform, there are ways to do that pretty easily.
Zero reason to stream Gcode over long USB cables.

Everyone I know who does retrofits would agree, and we never get asked for what you are asking for.
And everybody gets things to work, without what you say we need. Like, "used in an actual factory 24/7"-work.

Your UART hint was the right answer. More is not needed or asked.

Smoothie's Ethernet implementation is flawed. You should simply admit it and move on and improve it for Smoothie 2.0.

I'm sorry it's not, it's the best we could do with the hardware we have, and the jobs the board has to do.
UDP would be a bit better for this specific case, but it's not *required*, plenty of users have working setups, even though UDP isn't implemented, and even though many of them have to go over long cables.

Personally I use an USB isolator (already on the Azteeg X5 GT 32 board) and make sure the cameras are not grounded to the machine. And everything is good even with my 5m cable. Others can add an external isolator like this one.

I mean, those exist, but I've never had to use one. Just have to design things right.

> Most of the USB cables I use in customer's machines are about 10cm long ...

Now if Smoothieboard requires that, then that is real bad design.

It doesn't and it isn't. And it's getting pretty annoying how you go around calling things flawed, and misrepresenting what is being said.
But if I can have a 10cm cable, which I pretty much always can, why not do it that way...

There is a USB specification that tells us we can add 5m cables if we like. And for the USB 1.1 bandwidth we use, that's really not asked too much.

https://en.wikipedia.org/wiki/USB#Cabling

So the good design decision would be to finally add the Isolator to Smoothie 2.0.  At least for the prime and the pro.

There's a lot we could do. Doesn't mean we should, will, or have the ability to make it while maintaining board cost low.
There has been boards before with USB isolation in the OS cnc market, guess which is still around, and which have gone away?
If proper design/wiring makes the isolator un-necessary, there's no reason to make all customers pay for it.
Also users who really want to run USB over long cables ( they shouldn't ) can just get a separate isolator...

We don't have circuitry to save the board if somebody plugs straight 240V AC into it, and that hapeens *much* more often than people having serious USB issues.

_Mark


Am 08.05.2020 um 16:54 schrieb Arthur Wolf:


On Fri, May 8, 2020 at 4:39 PM Jarosław Karwik <jarosla...@gmail.com> wrote:
How do you connect main machine controller - which is placed in separate machine compartment  - to main control computer when machine itself is 2x3 m??
Most of my machines look like this  - and here ethernet between machine and computer is the only viable solution.
 
That's bad design then, it's another issue.
Most CNC routers I've had to work with had the cnc controller and the controlling computer in the same stand a few centimeters appart.
Even if they aren't, if you have to have a long cable, you don't stream the gcode over it, you run whatever software inside the machine, and control it remotely.

lynx.jpg








--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.


--
勇気とユーモア

Marek T.

unread,
May 8, 2020, 1:29:07 PM5/8/20
to OpenPnP
First I must finally check if I have camera grounded to the beast or not...
My good decision was to 'close the windows' and set Debian for the machine...

Slavko Kocjancic

unread,
May 8, 2020, 1:49:45 PM5/8/20
to ope...@googlegroups.com
Hello...

I do PnP for two reasons.

1. it's fun
2. My vision is not compatible with SMT so some help will be nice.

So as this is not production machine it's made cheap. And to have
separate computer just for PnP embeded into machine is just out of
price. But I have good computer at workshop so why do not use that when
PnP will run. Maybe even once per week. Maybe every other week once. And
as I have all computers in house connected to central UPS. Whatewer I do
I create ground loop thru USB. I never repaired PnP machine so I don't
know how is built. But I do a lot of conversion and industrial power
electronics. Belive me I know how to properly ground thing.

...and We go Way out of the topic. I sipmly ask why that big difference
in time. I got the reason and some solutions but not the perfect one.

ma...@makr.zone

unread,
May 8, 2020, 2:14:15 PM5/8/20
to ope...@googlegroups.com

> TCP make a lot of other thing too. I'm just curious where that massive lattency or whatewer is produced. I mean over 2 second delay per part!?!?

That's not TCP per se, its Smoothie. I believe MCUs can be very fast for TCP.


_Mark

Arthur Wolf

unread,
May 8, 2020, 2:18:53 PM5/8/20
to ope...@googlegroups.com
On Fri, May 8, 2020 at 8:14 PM ma...@makr.zone <ma...@makr.zone> wrote:

> TCP make a lot of other thing too. I'm just curious where that massive lattency or whatewer is produced. I mean over 2 second delay per part!?!?

That's not TCP per se, its Smoothie. I believe MCUs can be very fast for TCP.


Smoothie has a lot to do other than TCP. We have optimized things a lot over the years, but there are limits to how much you can do that.
v2 will have a lot more RAM and cycles, and the network code there is already much faster/reactive than the v1 code.


_Mark

Am 08.05.2020 um 18:51 schrieb Slavko Kocjancic:
Mark I know that.

TCP make a lot of other thing too. I'm just curious where that massive lattency or whatewer is produced. I mean over 2 second delay per part!?!?

...but for now I drive PnP with laptop. Just 2 USB ports/one controller.
Both camera works. But with hub seems that (at least) one camera froze over time. So with that hardware I can go just over TCP.

For future will probably use ordinary computer with serial port or at least USB port with isolation.


Slavko.

On 8. 05. 20 18:22, ma...@makr.zone wrote:
Slavko , all that you are describing that's exactly what TCP is doing and with many optimizations. I doubt you (or anyone) can do it better/faster with reasonable effort.

/"//TCP provides //reliable <https://en.wikipedia.org/wiki/Reliability_(computer_networking)>//, ordered, and //error-checked <https://en.wikipedia.org/wiki/Error_detection_and_correction>//delivery of a stream of //octets <https://en.wikipedia.org/wiki/Octet_(computing)>//(bytes) between applications running on hosts communicating via an IP network."/

https://en.wikipedia.org/wiki/Transmission_Control_Protocol

TCP is old enough (1974) to make sure it runs efficiently on MCUs, certainly as a single connection. There are highly optimized implementations available. <https://en.wikipedia.org/wiki/UIP_(micro_IP)>

One-to-one connection UDP only makes sense if you can afford to drop information in exchange for very low latency like on an audio transmission etc. and that is certainly not the case here.

_Mark

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/368aaaa2-aa42-4a6a-231d-5d0fffff6d5a%40makr.zone.


--
勇気とユーモア

ma...@makr.zone

unread,
May 8, 2020, 2:19:15 PM5/8/20
to ope...@googlegroups.com

> Well, you would need dc/dc converter.

Yes, the Azteeg is powered from the machine PSU with a proper DC/DC. As  it always should be, IMHO.

It has both a 12V and a 5V DC/DC right on the board so you're set for the commonly used Voltages for LED rings and logic.

The MCU will not be powered, if you connect USB but the machine PSU is off.

The MCU will not lose control if you unplug USB. The machine stays homed and you can reconnect. You can run any connection you like (like the mentioned UART, best isolated as well, of course).

http://www.panucatt.com/azteeg_X5_GT_reprap_3d_printer_controller_p/ax5gt.htm

http://panucattdevices.freshdesk.com/support/solutions/folders/1000226597


Smoothieboard leaves this to the user. It has a +5V connector or you can buy a strange module:

http://smoothieware.org/voltageregulator

http://smoothieware.org/cnc-mill-guide#logic-power

USB issues because of missing isolator are at least openly documented:

Make sure your USB cable is as short as possible ( less than 50 centimeters or two feet is ideal ), is shielded, and ideally has ferrite beads.
Make sure your machine and the computer controlling it are plugged into the same power strip.
Make sure your local electrical installation is not subject to variations and interference.
Make sure there are no large motors, fridges, neon bulbs or other strong sources of electrical interference in the same room.

That last sentence is really almost funny in a machine context. :-D

http://smoothieware.org/usb#take-care

Summary:

On-board DC/DC and USB isolator are a must, IMHO.

_Mark

To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/52e7206e-d076-434e-823e-25b91aa3106e%40googlegroups.com.

ma...@makr.zone

unread,
May 8, 2020, 2:24:45 PM5/8/20
to ope...@googlegroups.com
Am 08.05.2020 um 20:18 schrieb Arthur Wolf:


On Fri, May 8, 2020 at 8:14 PM ma...@makr.zone <ma...@makr.zone> wrote:

> TCP make a lot of other thing too. I'm just curious where that massive lattency or whatewer is produced. I mean over 2 second delay per part!?!?

That's not TCP per se, its Smoothie. I believe MCUs can be very fast for TCP.


Smoothie has a lot to do other than TCP. We have optimized things a lot over the years, but there are limits to how much you can do that.
v2 will have a lot more RAM and cycles, and the network code there is already much faster/reactive than the v1 code.

I agree and that's why I don't blame Smoothie at all. The Azteeg doesn't even have the Ethernet port.

But if you don't have (usable) Ethernet, then you have to do USB right. For a Machine environment.

> Make sure there are no large motors, fridges, neon bulbs or other strong sources of electrical interference in the same room.

http://smoothieware.org/usb#take-care

That's just not good enough.

_Mark


Reply all
Reply to author
Forward
0 new messages