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

More
23 Oct 2024 15:57 #312981 by meister
Hi,
very cool !!!!

for my board without oscillator, i need to run:
```
gpio mode 7 clock
gpio clock 7 5000000
```
to provide a clock signal for the FPGA


for flashing i use this script:
```
riocore/configs/IceShield/spiflash.sh
```
all as root.

LinuxCNC runs as user,
i think i use the normal LinuxCNC RPI image (bookworm)

if you use the default config with:
```
{
"type": "blink",
"pins": {
"led": {
"pin": "LED:G"
}
},
"frequency": 1.0
},
```
on of the LED's have to blink with 1Hz after flashing

to test the connection, you can also use the rio-test tool:
```
bin/rio-test riocore/configs/IceShield/config.json
```
The following user(s) said Thank You: digiex_chris

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

More
24 Oct 2024 03:36 #313024 by digiex_chris

Hi,
very cool !!!!

for my board without oscillator, i need to run:
```
gpio mode 7 clock
gpio clock 7 5000000
```
to provide a clock signal for the FPGA


for flashing i use this script:
```
riocore/configs/IceShield/spiflash.sh
```
all as root.

LinuxCNC runs as user,
i think i use the normal LinuxCNC RPI image (bookworm)

if you use the default config with:
```
{
"type": "blink",
"pins": {
"led": {
"pin": "LED:G"
}
},
"frequency": 1.0
},
```
on of the LED's have to blink with 1Hz after flashing

to test the connection, you can also use the rio-test tool:
```
bin/rio-test riocore/configs/IceShield/config.json
```
 

It works! Thank you, the GPCKL0 gpio config was just what I needed. Linuxcnc talks to it just fine now. Also, it seems I forgot to route pin 7 to 35 on the FPGA :D

I'll adjust the board to route that line, dump a production outputs file and instructions for people to order it, and push it up to github along with the config once I confirm the motors and switches do what I need them to do for a standard 3 axis mill setup.
File Attachment:

 
The following user(s) said Thank You: meister

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

More
25 Oct 2024 10:25 #313190 by meister

 

do you already have your layout on github ? then i would create a new board in rio so that you have the pins in the right place.

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

More
25 Oct 2024 11:01 - 25 Oct 2024 11:09 #313192 by gitano
Hello,

after diving a bit more deeply into LinuxCNC-RIO and having a closer look at the Tangbob and riocore, a few questions have come up:
1) almost every connector on the board makes sense to me, except J5 + J6 (Down/ Up) -> what are these connectors for?  

2) as i get it, i can use 2 BOB's simultanously with this board, correct? Do these boards still need the 12-24V input on the right side, or is the 5V input only sufficient to drive all Inputs and Outputs correctly? Except for the PWM Output (Spindle Control) on the right side, i bet.

3) do i have to use the BOB's Inputs / Outputs (left and lower Side) as such, or can i map them freely in riocore, f.e. use the - usually stepdir output - pins P2-P5 as Encoder input pins? 

4) can i power a LED strip directly via wled1 with the onboard 5V supply, or would an external supply be better?

Secondly i played around with the Tangbob configuration in riocore and as it seems i must be doing something completely wrong or there must be something messed up with the bitin/ bitout defintions for the Tangbob board somewhere:

Board: Tangbob
Toolchain: icestorm
Protocol: UDP

LinuxCNC:
3 Axis
mill
manual toolchange
axis gui

Modules:
china bob left -> split

Plugins added:
ads111514 on i2c             -> all ok
wled bar on wled             -> all ok
modbus1 on modbus             -> all ok
stepdir on RIGHT: P2 + P2         -> all ok
stepper17 on RIGHT: P3 to P6        -> all ok
quadencoder on RIGHT: P10 - P12     -> all ok
bitout on RIGHT: P8            -> compiles well 

but the latter gives a long error message when firing up LinuxCNC:

riocomp.c:185:28: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘OUT_BIT’
  185 |     hal_bit_t   *SIGOUT_P8 OUT_BIT;
      |                            ^~~~~~~

[...and TONS of similar/ follow up errors]

looking at riocomp.c:185 reveals:

"hal_bit_t   *SIGOUT_P8 OUT_BIT" <- looks like a missing underscore between P8 and OUT, with added underscore i just get:

   
linuxcnc rio.ini 
LINUXCNC - 2.10.0~pre0
Machine configuration directory is '/media/gitano/Alhambra/Software/Linux/CAD+CAM/LinuxCNC-RIO/riocore/Output/Tangbob/LinuxCNC'
Machine configuration file is 'rio.ini'
Starting LinuxCNC...
linuxcncsvr (563355) emcsvr: machine 'Rio - mill'  version '1.1'
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX non-realtime
milltask (563384) task: machine 'Rio - mill'  version '1.1'
halui (563390) halui: machine 'Rio - mill'  version '1.1'
twopass:invoked with <> options
twopass:found ./rio.hal
twopass:found ./pregui_call_list.hal
twopass:pass0: loadusr -W hal_manualtoolchange
riocomp.c: In function ‘register_signals’:
riocomp.c:541:51: error: ‘data_t’ has no member named ‘SIGOUT_P8’
  541 |     if (retval = hal_pin_bit_newf  (HAL_IN, &;(data->SIGOUT_P8 OUT_BIT), comp_id, "%s.P8 OUT.bit", prefix) != 0) error_handler(retval);
      |                                                   ^~
riocomp.c:541:62: error: expected ‘)’ before ‘OUT_BIT’
  541 |     if (retval = hal_pin_bit_newf  (HAL_IN, &;(data->SIGOUT_P8 OUT_BIT), comp_id, "%s.P8 OUT.bit", prefix) != 0) error_handler(retval);
      |                                              ~               ^~~~~~~~
      |                                                              )
riocomp.c:542:10: error: ‘data_t’ has no member named ‘SIGOUT_P8’
  542 |     *data->SIGOUT_P8 OUT_BIT = 0;
      |          ^~
riocomp.c:542:21: error: expected ‘;’ before ‘OUT_BIT’
  542 |     *data->SIGOUT_P8 OUT_BIT = 0;
      |                     ^~~~~~~~
      |                     ;
riocomp.c: In function ‘convert_varout1_bitout19_bit’:
riocomp.c:1013:23: error: ‘data_t’ has no member named ‘OUT_BIT’
 1013 |     bool value = *data->OUT_BIT;
      |                       ^~
make: *** [/usr/share/linuxcnc/Makefile.modinc:117: riocomp.o] Error 1
# compiling and loading rio component...failed

adding the same fix in line 541, 542 and adding SIGOUT_P8_ before OUT_BIT in line 1013 as well as uncommenting OUT_BIT in rio.hal and custom_postgui_hal, axis GUI fires up. The defined button for P8 shows up fine in GUI, i guess it won't work with hardware, though.

I tried adding bitins and outs for other boards (iceshield and octobot) and there they work fine.

All in virtuality, i still have no hardware around, but that will change soon

Cheers,
-lgitano

P.S.: Dont know if it is correct to post such userspace/ configurations issues here as this thread perhaps gets quite huge, or if it would be better to open new board specific threads? If You think so, i will do the latter :)
Last edit: 25 Oct 2024 11:09 by gitano.

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

More
25 Oct 2024 11:15 #313194 by meister
Hi,
1) its a jumper to set pullUP/pullDown resistors to the signal-lines
2) yes, but, if you meen the cheap China BOB's, 12/24V is needed for the Opto's
3) you can freely use the pins on the board, but on the BOB, there are Opto's and Darlington-Arrays that works only in one direction.
4) i think up to 10 LED's are ok, if you need more, then i would use en extra 5V supply
PS) as you prefer / but i need you config file with the P8 error, it looks like there is one space too many in the config ('P8 ')
The following user(s) said Thank You: gitano

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

More
25 Oct 2024 12:15 - 25 Oct 2024 12:16 #313203 by gitano
aah, stupid me -> i actually named that pin "P8 OUT" in the Name section, changing the name to "P8_OUT" -> all works well x)

regarding 1) - 4) -> that clarifies a lot, thank You very much!

Well, i am considering ordering a small batch from JLPCB, the last layout on github (edited in August) is working ok, so far?

speaking about that and looking at the prices there i am considering getting some octobot and iceshield boards as well, they look too tempting to ignore and would be fun to toy around with

I am still not sure about 2 things regarding the iceshield:

- ball soldering sounds indeed frightening... i tried that once with a CPU socket of an old mainboard (bent pins) and failed completely x) There is a version on here with pre-soldered SMD parts, maybe i should go this route?

- as i get it, the communication between RPI and shield goes via SPI, so just 4-5 pins, correct? what about the other GPIO pins, can these still be used f.e. by soldering a connector on top of the shield? Is there actually a component for using these with LinuxCNC?

Thank You very much!

Cheers,
-lgitano
Last edit: 25 Oct 2024 12:16 by gitano.

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

More
25 Oct 2024 12:41 #313205 by meister
the tangbob board is updated 2weeks ago,
because i had problems with the 1.8V pins:
github.com/multigcs/rio-tangbob
this updated version is not tested, but it should work (there is only a new diode to drop the voltage on the level-shifters)

the ICE40 on the iceshield board is not BallGrid but also hard to solder by hand,
not necessarily the FPGA, but the 2.5V diode, which is extra small and you don't really recognize the direction.
I would wait for digiex_chris's Version or ask him if he have a spare one.

Octobot: remember that the icewerx board also costs money.

RPI-Pins:
MOSI, MISO, SCLK, CS0, CS1, GPCKL0, GND, 3.3V, 5V

all other pins are not connected and freely usable, don't know if there was a ready to use lcnc component, but a little python-script will do the job
The following user(s) said Thank You: gitano

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

More
25 Oct 2024 12:59 #313209 by meister
the 'spaces in name' problem is fixed, i replace it with '_' now.
The following user(s) said Thank You: gitano

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

More
25 Oct 2024 14:44 #313215 by gitano
awesome, thank You very much!

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

More
25 Oct 2024 18:49 - 25 Oct 2024 18:50 #313226 by gitano
another small issue generating the configfiles, this time with qtdragon GUI:

[QTvcp][CRITICAL] Retry from Error Dialog Qtvcp encountered an error. The following information may be useful in troubleshooting: LinuxCNC Version : 2.10.0~pre0

[...Traceback...]

PyQt5.uic.exceptions.NoSuchWidgetError: Unknown Qt widget: Slider

Changing "Slider" to "QSlider" in rio-gui.ui fixes that issue.

Cheers,
-lgitano
Last edit: 25 Oct 2024 18:50 by gitano.

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

Time to create page: 0.138 seconds
Powered by Kunena Forum