running EMCApplication basic steps

421 views
Skip to first unread message

Claudio Lorini

unread,
Oct 3, 2020, 1:49:44 PM10/3/20
to Machinekit
Hello, 
i'm trying running EMCApplication on a MYIR Ultrascale board, with kernel: 
Linux zus-cl 5.4.0-rt1+ #7 SMP PREEMPT_RT Wed Sep 30 13:21:36 CEST 2020 aarch64 GNU/Linux
with Debian strech

I think i managed to install nachinekit-hal, all tests are passing and i can get some very 
nice result on latency tests:
5.4RT.png
i built EMCA from sources and configured to use hachinekit-hal (i think)
./configure --with-hal=machinekit-hal

but launching any configuration for linuxcnc i get some sort of this error:
....
4:rtapi_app:5413:user pid=5413 flavor=rt-preempt gcc=6.3.0 20170516 git=unknown
Traceback (most recent call last):
  File "/home/zus/EMCApplication/bin/hal_manualtoolchange", line 11, in <module>
    import linuxcnc, hal
  File "/home/zus/EMCApplication/lib/python/hal.py", line 30, in <module>
    import _hal
ImportError: No module named _hal

 I think i miss some very basic step, i tried to look for some basic how-to but could not find anything useful... 
can someone point me in the right direction?



Michael Brown

unread,
Oct 21, 2020, 4:40:48 PM10/21/20
to Machinekit
I would like to hear some more about you new soc board porting.
Can you input the name of the MyirTech board you are using ?

-->   ImportError: No module named _hal

This seems to be related to python2/3 compatibility problems

Are you interested in adding your board to the Mksocfpga repo ?

Best wishes
Michael

Claudio Lorini

unread,
Oct 22, 2020, 7:32:10 AM10/22/20
to Machinekit
I'm currently working on this: myd-czu3eg-4e4d-1200-c 
http://www.myirtech.com/list.asp?id=613

my main interest is motor in control applications using field busses (CAN and Ethercat)
i'm currently developing some can bus hal driver (for a can motor controller) for machinekit-hal,   
so not closely related to mesanet stuff, but yes, if i can help someway, why not?

the machinekit-hal stuff is working fine, i have had no luck in running cnc stuff yet, but i'm following 
current developments on EMCapplication really close...


  

Michael Brown

unread,
Oct 22, 2020, 4:15:24 PM10/22/20
to Machinekit
Interesting I purchased the exact same board a long while ago but held back on it as I was unable to get the mali gpu support to function on any of my screens.

Instead I'm just finalizing a fully fledged mksocfpga port of the Myirtech FZ3 .

This will make adding a mksocfpga port of the ultramyir (myd-czu3eg-4e4d-1200-c) like a walk in the park ... :-)

BTW any help in ironing out the importError: No module named _hal  python2/3 issue is surly appreciated.

Michael Brown

unread,
Oct 22, 2020, 4:25:01 PM10/22/20
to Machinekit

Michael Brown

unread,
Oct 23, 2020, 7:59:00 PM10/23/20
to Machinekit
Now the Ultramyir board is also added however:
As things are now you have to build manually @home 
There are guidelines for easy docker building in the VivadoProjects folder readme.
Best wishes
Michael B.

John Dammeyer

unread,
Oct 24, 2020, 12:54:11 PM10/24/20
to Claudio Lorini, Machinekit

Hi Caludio,

I'm currently also working with CANopen (and CAN in general).  Busy trying to get socketCAN to work with Lazarus (Free Pascal). 

 

At the moment the program compiles/runs on a PC, Raspberry Pi and a BeagleBone.  With the PC I'm using the Lawicel CANUSB dongle and have it also working on the Pi and the BBB without issues as a USB serial device. 

 

With socketCAN the standard candump.c program also works with the Lawicel CANUSB and either an MCP2515 HAT for the Pi or the internal CAN device on the BBB.  So I know the hardware can function with the socketCAN driver.  Just making it work with Lazarus is still the challenge.

 

The full source code will be released when I have it working.   Here are a couple of screen shots.

 

This is just a terminal program for dealing with the CANUSB or any other serial port based CAN dongle.

 

cid:image001.png@01D6A7A9.546057C0

 

 

Now we're more into CANopen with the ability to send a number of SDO messages to find the node ID etc.

cid:image002.png@01D6A7A9.546057C0

 

And finally the ability to send specific CANopen SDO messages to a CANopen device.

cid:image003.png@01D6A7A9.546057C0

 

Ultimately I'll add a logging/playback function so I can receive and timestamp messages.  Then be able to parse that file and play back specific nodes messages to simulate a larger system without all the hardware in place.

 

And of course instead of the serial port CANUSB be able to use the socketCAN interface on the Pi and BBB. 

 

This will run on MachineKit (I do have a microSD card with MachineKit for the BBB) and once I add Lazarus to my LinuxCNC (on Pi or a PC) can also run it on the milling machine system.

 

I'm almost at the point where I can start building a power draw bar and would like to make it and an automatic tool changer be CANopen based.

 

John Dammeyer

 

 

Image removed by sender. 5.4RT.png

i built EMCA from sources and configured to use hachinekit-hal (i think)

./configure --with-hal=machinekit-hal

 

but launching any configuration for linuxcnc i get some sort of this error:

....

4:rtapi_app:5413:user pid=5413 flavor=rt-preempt gcc=6.3.0 20170516 git=unknown

Traceback (most recent call last):

  File "/home/zus/EMCApplication/bin/hal_manualtoolchange", line 11, in <module>

    import linuxcnc, hal

  File "/home/zus/EMCApplication/lib/python/hal.py", line 30, in <module>

    import _hal

ImportError: No module named _hal

 

 I think i miss some very basic step, i tried to look for some basic how-to but could not find anything useful... 

can someone point me in the right direction?

 

 

 

--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/machinekit/56395dda-e594-4d81-9a68-3a411c4ac6f4n%40googlegroups.com.

~WRD000.jpg
image001.png
image002.png
image003.png

Michael Brown

unread,
Oct 24, 2020, 2:47:29 PM10/24/20
to Machinekit
Just got a working Python3 Emcapplication running on the FZ3 arm64 mksocfpga: based on this thread:

    cd emcapplication
    sudo apt install build-essential fakeroot devscripts equivs python lsb-release apt-cudf
    sudo apt-get install python3-tk
    debian/configure machinekit-hal=0.4.21003-1.git39389db84~$(lsb_release -cs) no-docs
    mk-build-deps -irs sudo -t 'apt-cudf-get --solver aspcud -o Debug::pkgProblemResolver=0 -o APT::Install-Recommends=0'
    cd src
    ./autogen.sh
    ./configure --with-hal=machinekit-hal --with-python=python3 --with-boost-python=boost_python-py35
    make -j$(nproc)
    sudo make install
    source ../scripts/rip-environment
    linuxcnc

On Saturday, October 3, 2020 at 7:49:44 PM UTC+2 Claudio Lorini wrote:

Michael Brown

unread,
Oct 24, 2020, 3:01:54 PM10/24/20
to Machinekit
Claudio
How did you produce your latency histogram ?
Best wishes
Michael B.

Claudio Lorini

unread,
Oct 25, 2020, 5:14:16 AM10/25/20
to Machinekit
I used the hal component from Anders Wallin blog post:

the istogram is drown from the data captured by the comp on a PC since i wasn't able to install the mathplotlib stuff on the us.

Claudio Lorini

unread,
Oct 25, 2020, 6:18:20 AM10/25/20
to Machinekit
...getting closer but no luck for me with that:

...
Found file(lib): /usr/share/linuxcnc/hallib/axis_manualtoolchange.hal
4:rtapi_app:965:user pid=965 flavor=rt-preempt gcc=6.3.0 20170516 git=unknown
Traceback (most recent call last):
  File "/usr/bin/hal_manualtoolchange", line 11, in <module>
    import linuxcnc, hal
ImportError: /home/zus/EMCApplication/lib/python/linuxcnc.so: undefined symbol: PyUnicode_FromString
/usr/share/linuxcnc/hallib/axis_manualtoolchange.hal:1: hal_manualtoolchange exited without becoming ready
Shutting down and cleaning up LinuxCNC...
...

i'm trying to start axis, but also with other configurations i had no luck.
which configuration are you running?

Michael Brown

unread,
Oct 25, 2020, 6:37:41 AM10/25/20
to Machinekit
On the first run I had luck with the very first axis sim config.
I the modified a config for my Oxdroid router and also got that to run.
Attatched my linuxcnc folder with the working configs:

linuxcnc.tar.gz

Claudio Lorini

unread,
Oct 25, 2020, 7:17:03 AM10/25/20
to Machinekit
Thanks, 
i'll give it a try to see if i can replicate you results!
C.

Claudio Lorini

unread,
Oct 31, 2020, 1:23:25 PM10/31/20
to Machinekit
...some small steps ahead but not quite inside yet:
- installed debian buster 
- configured like this: 
  ./configure --with-hal=machinekit-hal --with-python=python3 --with-boost-python=boost_python-py35
- done the modifications to .ini and .hal files needed to upgrade linuxcnc from 2.8 -> 2.9

...
./singleaxis.hal:2: Realtime module 'trivkins' loaded
./singleaxis.hal:5: Realtime module 'motmod' loaded
./singleaxis.hal:8: Function 'motion-command-handler' added to thread 'servo-thread', rmb=0 wmb=0
./singleaxis.hal:9: Function 'motion-controller' added to thread 'servo-thread', rmb=0 wmb=0
<commandline>:0: Realtime threads started
milltask: symbol lookup error: milltask: undefined symbol: initinterpreter
<commandline>:0: milltask exited without becoming ready
Traceback (most recent call last):
  File "/usr/bin/axis", line 61, in <module>
    from minigl import *
ImportError: /home/zus/EMCApplication/lib/python/minigl.so: undefined symbol: PyModule_Create2
Shutting down and cleaning up LinuxCNC...
...


Michael Brown

unread,
Nov 5, 2020, 11:17:44 AM11/5/20
to Machinekit
I can't see the steps you are doing to run your hal file.
Have you tried running linuxcnc and selecting the first sim axix config ?

Claudio Lorini

unread,
Nov 5, 2020, 12:56:13 PM11/5/20
to Machinekit
I'm running a bare to the bone configuration with 1 axis/joint, trivkins, simulated hw (attached)
the steps i do:

>  export DEBUG=5
> source /home/zus/EMCApplication/scripts/rip-environment
> linuxcnc

and select the 'singleaxis' configuration.

running the first configuration (Sample configurations -> sim -> axis -> axis) i get:
...
/usr/share/linuxcnc/hallib/sim_spindle_encoder.hal:43: Function 'near_speed' added to thread 'servo-thread', rmb=0 wmb=0
/usr/share/linuxcnc/hallib/sim_spindle_encoder.hal:44: Function 'sim_spindle' added to thread 'servo-thread', rmb=0 wmb=0
Found file(lib): /usr/share/linuxcnc/hallib/axis_manualtoolchange.hal
4:rtapi_app:2721:user pid=2721 flavor=rt-preempt gcc=8.3.0 git=unknown
Traceback (most recent call last):
  File "/usr/bin/hal_manualtoolchange", line 11, in <module>
    import linuxcnc, hal
ImportError: /home/zus/EMCApplication/lib/python/linuxcnc.so: undefined symbol: PyUnicode_FromString
/usr/share/linuxcnc/hallib/axis_manualtoolchange.hal:1: hal_manualtoolchange exited without becoming ready
Shutting down and cleaning up LinuxCNC...
....

singleaxis.zip

Michael Brown

unread,
Nov 5, 2020, 4:02:29 PM11/5/20
to Machinekit
I can now replicate that error message reason:
I just ran the python3 compiled version of EMCapplication with an/the older python2 version of machinekit hal.

Michael Brown

unread,
Nov 5, 2020, 4:14:58 PM11/5/20
to Machinekit
Here is a recipe that should get you through:

# check installed machinekit debs(from cloudsmith):
apt search machinekit

    machinekit-hal/buster,now 0.4.21003-1.git39389db84~buster arm64 [installed]
#if not do:
    
sudo apt purge emcapplication machinekit-hal machinekit-hal-dev
sudo apt autoremove

sudo apt update
sudo apt install machinekit-hal

#double check:
apt search machinekit
    machinekit-hal/buster,now 0.4.21003-1.git39389db84~buster arm64 [installed]

compile by copy pasting the instructions from the first post here(just ignore the rest of the thread):


#notice this line:
    debian/configure machinekit-hal=0.4.21003-1.git39389db84~$(lsb_release -cs) no-docs
#the machinekit-hal version that works with python3 

Best wishes
Michael B.

Claudio Lorini

unread,
Nov 6, 2020, 1:06:35 PM11/6/20
to Machinekit
Yes! thank you a lot Michael! 
with your precise steps i managed to have emcapplication rinning!
Screenshot at 2020-11-06 18-58-02.png
Reply all
Reply to author
Forward
0 new messages