AXIS UI lags

More
11 Aug 2016 17:54 - 11 Aug 2016 17:54 #78636 by Jerre122
AXIS UI lags was created by Jerre122
Hello,

As you might know, linuxCNC slows AXIS down when it needs to: the display is less important than the actual NC.

However, I have made changes to AXISUI (more specificly to the Update() function of LivePlotter in axis.py).
One of those changes is when I press a button (which is a halpin), the machine moves in X+ while it is pressed.
Another change looks at a potentiometer (which is also a halpin), performs a non-linear conversion and outputs it to another hal pin.

With this, I can press a button and let the axis move with a feedrate override determined by the potentiometer.
But because AXIS sometimes slows down, the changes to the button and potentiometer can be delayed.
These delays can easily exceed 1 second.

When moving the axes, this is unacceptable as it might cause a crash.

Does anyone know how I can prevent the delay?
Or maybe how I can execute code parallel to axis?


I'm already planning on writing my own hal component to do the conversion for the potentiometer.
But I still have to figure out the details of the other changes I've made.
Last edit: 11 Aug 2016 17:54 by Jerre122.

Please Log in or Create an account to join the conversation.

More
11 Aug 2016 18:39 #78637 by PCW
Replied by PCW on topic AXIS UI lags
IMHO for serious machines, no time critical controls should be implemented in the GUI
Jog controls will have only 1 ms lags if implemented entirely in real time hal functions
with real time hardware
The following user(s) said Thank You: Jerre122

Please Log in or Create an account to join the conversation.

More
11 Aug 2016 19:23 #78640 by Todd Zuercher
Replied by Todd Zuercher on topic AXIS UI lags
In other words. Instead of using a soft button on a UI screen. Use a real physical button on a control panel.

But I am not sure how much that may help, because I am not sure that the Halui interface pins you are likely using are real time.
The following user(s) said Thank You: Jerre122

Please Log in or Create an account to join the conversation.

More
11 Aug 2016 19:29 #78641 by PCW
Replied by PCW on topic AXIS UI lags
Yes, I am assuming that the button and potentiometer signals go directly (or via real time hal comps) to motion (which is real time)
The following user(s) said Thank You: Jerre122

Please Log in or Create an account to join the conversation.

More
24 Aug 2016 22:07 #79381 by Jerre122
Replied by Jerre122 on topic AXIS UI lags
I have accepted it indeed isn't a good plan to implement these things in the GUI.
I have managed to make my first own hal component (hurrah!) for the potentiometer conversion.
For the jog controls I think I have gotten it down only using hal components and hal pins.
By the way, all the buttons were physical.
The slow performance/reaction time of the buttons only became apparent after I had to switch computers (because the first one had broken down).
I used the GUI because at first because at first I didn't know how to make hal components and also because I didn't know about the existence of some of hal pins.

The only thing I'm figuring out now has to do with twopass processing of the hal configuration files.
I have split my hal code up in different segments/files and each one uses loadrt functions for loading the hal components required in its file.

Like:
jog_buttons.hal: loadrt and2 names=hmi.jog.jog-criteria-accepted
on_off_buttons.hal: loadrt and2 names=hmi.on_off.and-off

There are some more. However, I get an error when starting linuxcnc:
Error: could not insert module /usr/realtime-3.4-9-rtai-686-pae/modules/linuxcnc/and2.ko: Invalid parameters
exit value: 1
insmod for and2 failed, returned -1
See the output of 'dmesg' for more information.
    while executing
"hal loadrt and2 names=and2.0,and2.1,and2.2,and2.3,and2.4,and2.5,and2.6,and2.7,and2.8,and2.9,and2.10,and2.11,and2.12,and2.13,hmi.jog.jog-criteria-accep..."
    ("eval" body line 1)
    invoked from within
"eval hal loadrt $args"
    (procedure "orig_loadrt" line 1)
    invoked from within
"orig_loadrt and2 names=and2.0,and2.1,and2 .2,and2.3,and2.4,and2.5,and2.6,and2.7,and2.8,and2.9,and2.10,and2.11,and2.12,and2.13,hmi.jog.jog-criteria-acce..."
    ("eval" body line 1)
    invoked from within
"eval $cmd"
    (procedure "load_the_modules" line 22)
    invoked from within
"load_the_modules"
    (procedure "::tp::pass0" line 11)
    invoked from within
"::tp::pass0"
    (file "/usr/lib/tcltk/linuxcnc/twopass.tcl" line 542)
    invoked from within
"source $filename"
    invoked from within
"set result [source $filename]"
    (file "/usr/bin/haltcl" line 55)

It seems there is something wrong with one of my "loadrt and2" statements.
I have looked and at first there doesn't seem to be anything wrong.

I have tested it in a VM and it seems to be legit to use names such as "and2.0".

Please Log in or Create an account to join the conversation.

More
24 Aug 2016 23:34 #79387 by dgarrett
Replied by dgarrett on topic AXIS UI lags
"orig_loadrt and2 names=and2.0,and2.1,and2 .2,and2.3,and2.4,and2.5,and2.6,and2.7,and2.8,and2.9,and2.10,and2.11,and2.12,and2.13,hmi.jog.jog-criteria-acce..."
The
",and2 .2,"
looks suspicious -- as if there was an inadvertent blank
character in the name intended to be and2.2
The following user(s) said Thank You: Jerre122

Please Log in or Create an account to join the conversation.

More
25 Aug 2016 18:43 - 25 Aug 2016 18:49 #79440 by Jerre122
Replied by Jerre122 on topic AXIS UI lags
Wow. Thanks for spotting that.
I can't imagine I glossed over that.

However, the "hal loadrt" line a couple of lines above the "orig_loadrt" line doesn't show the space.
And in my hal code the space isn't present either:
loadrt and2 names=and2.0,and2.1,and2.2,and2.3,and2.4,and2.5,and2.6,and2.7,and2.8,and2.9,and2.10,and2.11,and2.12,and2.13
Last edit: 25 Aug 2016 18:49 by Jerre122.

Please Log in or Create an account to join the conversation.

More
25 Aug 2016 21:47 - 25 Aug 2016 21:58 #79450 by Jerre122
Replied by Jerre122 on topic AXIS UI lags
Is it possible the maximum number of and2 components with twopass is 17?
In my VM, when I use 17 components, everything loads fine.
But when I add an 18th component, it gives the error.

EDIT: I might have miscounted as a dmesg revealed: "names: can only take 16 arguments".
So it seems "and2 names=" is limited.
Any idea how I get around this while still using names?

SECOND EDIT:
I think I might've found something: forum.linuxcnc.org/forum/24-hal-componen...omponents-with-names
Last edit: 25 Aug 2016 21:58 by Jerre122.

Please Log in or Create an account to join the conversation.

More
27 Aug 2016 13:06 #79548 by emcPT
Replied by emcPT on topic AXIS UI lags
I had a similar issue. Although the latency test was ok, problem was solved with new PC hardware.
Having a real button or a soft button did not made any change.

My original post was here:
forum.linuxcnc.org/forum/38-general-linu...sh-large-delays-axis

My last post there says that with a new graphics card the problem was solved, but it is incorrect. The issue was only solved with a complete new pc.

Please Log in or Create an account to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum