LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

More
3 years 1 month ago #280255 by meister
it would be great if we had open source hardware, but it's not that simple.

The FPGAs that are suitable are difficult to route and solder. Someone should be familiar with BGAs.

Ready-made plug-in boards usually don't meet the requirements,
I would have the flash be flashable via the SPI port.
However, on almost all boards this is not wired to the pins but to a USB chip.

I have tried a board with modular plug-in cards, based on an ICE40HX4K, which is enough for a start, but I would prefer an ECP5.
The following user(s) said Thank You: Cant do this anymore bye all

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

More
3 years 1 month ago #281447 by Zayoo
Hello to all.
Excellent project and I need help.
How to use python script plugin.py in Plugins folder?
I'm using TangNano9K board and would like to drive just 2 steppers over UART so how to create my own config.json. I see that there are some difficulties with the UART but there is a will to troubleshoot it.
The following user(s) said Thank You: meister

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

More
3 years 1 month ago #281458 by meister
Hi Zayoo,
you can use this file as template:configs/TangNano9K/config.json

strip it down like this:
Code:
{     "name": "TangNano9K",     "description": "TangNano9K over serial",     "board": "TangNano9K",     "type": "GW1NR-LV9QN88PC6/I5",     "family": "GW1N-9C",     "toolchain": "icestorm",     "package": "",     "clock": {         "speed": "27000000",         "pin": "52"     },     "transport": "SERIAL",     "axis": 2,     "interface": [         {             "type": "uart",             "pins": {                 "RX": "48",                 "TX": "49"             }         }     ],     "blink": {         "pin": "10"     },     "error": {         "invert": true,         "pin": "11"     },     "enable": {         "pin": "69"     },     "plugins": [         {             "pullup": true,             "pin": "33",             "name": "DIN0",             "type": "din_bit"         },         {             "pullup": true,             "pin": "30",             "name": "DIN1",             "type": "din_bit"         },         {             "invert": true,             "pin": "13",             "name": "DOUT0",             "type": "dout_bit"         },         {             "invert": true,             "pin": "14",             "name": "DOUT1",             "type": "dout_bit"         },         {             "invert": true,             "pin": "15",             "name": "DOUT2",             "type": "dout_bit"         },         {             "type": "vin_counter",             "pullup": true,             "pins": {                 "up": "3",                 "down": "4"             },             "name": "VIN0"         },         {             "type": "vout_pwm",             "pins": {                 "pwm": "55"             },             "name": "VOUT0"         },         {             "type": "joint_stepper",             "cl": false,             "scale": 800,             "pins": {                 "step": "54",                 "dir": "53"             },             "name": "JOINT0"         },         {             "type": "joint_stepper",             "cl": false,             "scale": 800,             "pins": {                 "step": "51",                 "dir": "42"             },             "name": "JOINT1"         }     ] }

and run:
python3 buildtool.py configs/TangNano9K/config.json

BUT: the interface_uart plugin is not usable with linuxcnc at the moment,
only with the python test-tools:
Code:
python3 Output/TangNano9K/Firmware/qt_spitest.py /dev/ttyUSB1

AND the onboard USB-Chip of the TangNano9K is totally bad,
on linux the serial communication is really buggy,
it's better to use a real FTDI-Adapter and normal pins for the communication.
 
The following user(s) said Thank You: Zayoo

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

More
3 years 1 month ago #281488 by meister
BTW, you can only send velocity commands to the fpga, not position commands, i don't know if this is the right platform for your project

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

More
2 years 10 months ago #287221 by Zayoo
Hi,
thanks for advice and instruction. I'm running my board with qt_spitest. I'm too into it now to give up. :)

What I need to do with rio.c and rio.h files in output folder.
I copy ConfigSamples to LinuxCNC configs folder and when i start linuxcnc i get configuration selector with possibility to chose rio but error appears:        Plese brief instruction how to  proceed in to LinuxCNC! Thank you. 

Error report created by /usr/lib/tcltk/linuxcnc/show_errors.tcl:

Print file information:
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
LINUXCNC - 2.8.4-1-gb7824717b
Machine configuration directory is '/home/userxxx/linuxcnc/configs/rio'
Machine configuration file is 'rio.ini'
INIFILE=/home/userxxx/linuxcnc/configs/rio/rio.ini
VERSION=1.1
PARAMETER_FILE=linuxcnc.var
TASK=milltask
HALUI=halui
DISPLAY=axis
COORDINATES=X Y
KINEMATICS=trivkins coordinates=XY
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
Found file(REL): ./rio.hal
Shutting down and cleaning up LinuxCNC...
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

Debug file information:
Note: Using POSIX realtime
rio: dlopen: /usr/lib/linuxcnc/modules/rio.so: cannot open shared object file: No such file or directory
./rio.hal:7: waitpid failed /usr/bin/rtapi_app rio
./rio.hal:7: /usr/bin/rtapi_app exited without becoming ready
./rio.hal:7: insmod for rio failed, returned -1
5942
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime



Info report created by linuxcnc_info:
The file:    /tmp/linuxcnc_info.txt
can be posted to a forum or a web site like:
      pastebin.com
in order to provide information about the linuxcnc
system and configuration.

                Date: Mon 4 Dec 22:49:33 CET 2023
            UTC Date: Mon 4 Dec 21:49:33 UTC 2023
        this program: /usr/bin/linuxcnc_info
              uptime: 22:49:33 up 11:07, 1 user, load average: 0.02, 0.09, 0.15
     lsb_release -sa: Debian Debian GNU/Linux 10 (buster) 10 buster
      which linuxcnc: /usr/bin/linuxcnc
                 pwd: /home/userxxx/linuxcnc/configs/rio
                USER: userxxx
             LOGNAME: userxxx
                HOME: /home/userxxx
              EDITOR: 
              VISUAL: 
            LANGUAGE: en_GB:en
                TERM: dumb
           COLORTERM: 
             DISPLAY: :0.0
             DESKTOP: lightdm-xsession
        display size: 1280x1024 pixels (339x271 millimeters)
                PATH: /usr/bin:/home/userxxx/linuxcnc/configs/rio/bin:/usr/bin:/home/userxxx/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

uname items:
         nodename -n: linuxcnc
      kernel-name -s: Linux
      kernel-vers -v: #1 SMP PREEMPT RT Debian 4.19.249-2 (2022-06-30)
          machine -m: x86_64
        processor -p: unknown
         platform -i: unknown
      oper system -o: GNU/Linux

/proc items:
             cmdline: BOOT_IMAGE=/boot/vmlinuz-4.19.0-21-rt-amd64 root=UUID=371818aa-d1a4-445f-b321-44fe69ec2ea0 ro initrd=/install/gtk/initrd.gz quiet
          model name: AMD A8-9600 RADEON R7, 10 COMPUTE CORES 4C+6G
               cores: 1
             cpu MHz: 3094.198
             parport: 
              serial: 

Versions:
                 gcc: gcc (Debian 8.3.0-6) 8.3.0
              python: Python 2.7.16
                 git: git version 2.20.1
          git commit: NA
                 tcl: 8.6
                  tk: 8.6
               glade: not_in_PATH
          glade-gtk2: not_in_PATH

linuxcnc_var all:

     LINUXCNCVERSION: 2.8.4-1-gb7824717b
LINUXCNC_AUX_GLADEVCP: /usr/share/linuxcnc/aux_gladevcp
LINUXCNC_AUX_EXAMPLES: /usr/share/linuxcnc/aux_examples
            REALTIME: /etc/init.d/realtime
                 RTS: uspace
          HALLIB_DIR: /usr/share/linuxcnc/hallib

dpkg -l '*linuxcnc*':
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                Version              Architecture Description
+++-===================-====================-============-=====================================================================
un  linuxcnc            <none>               <none>       (no description available)
un  linuxcnc-dev        <none>               <none>       (no description available)
un  linuxcnc-doc        <none>               <none>       (no description available)
ii  linuxcnc-doc-en     1:2.8.4.1.gb7824717b all          motion controller for CNC machines and robots (English documentation)
ii  linuxcnc-doc-es     1:2.8.4.1.gb7824717b all          controlador de movimiento para máquinas CNC y robots (Español).
ii  linuxcnc-doc-fr     1:2.8.4.1.gb7824717b all          motion controller for CNC machines and robots (French documentation)
un  linuxcnc-sim        <none>               <none>       (no description available)
un  linuxcnc-sim-dev    <none>               <none>       (no description available)
ii  linuxcnc-uspace     1:2.8.4.1.gb7824717b amd64        motion controller for CNC machines and robots
ii  linuxcnc-uspace-dev 1:2.8.4.1.gb7824717b amd64        PC based motion controller for real-time Linux
 

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

More
2 years 10 months ago #287228 by Cant do this anymore bye all
rio: dlopen: /usr/lib/linuxcnc/modules/rio.so: cannot open shared object file: No such file or directory

You've missed a step:
Code:
sudo halcompile --install Output/TangNano9K/LinuxCNC/Components/rio.c

github.com/multigcs/LinuxCNC-RIO/blob/ma...angNano9K/INSTALL.md
The following user(s) said Thank You: meister, Zayoo

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

Time to create page: 0.459 seconds
Powered by Kunena Forum