Wiznet makers

scarlet

Published August 22, 2023 ©

100 UCC

12 WCC

22 VAR

0 Contests

0 Followers

0 Following

Original Link

LinuxCNC-RIO

RealtimeIO for LinuxCNC based on an FPGA

COMPONENTS Hardware components

WIZnet - W5500

x 1


PROJECT DESCRIPTION

LinuxCNC-RIO

RealtimeIO for LinuxCNC based on an FPGA

  • no Soft-Core
  • logic only
  • no jitter
  • fast and small
  • communication via SPI (with Raspberry PI 4 or Ethernet-Bridge)
  • generated verilog-code / setup via json files (free pin-selection)
  • using free FPGA-Toolchain
  • tested on ICE40UP5K, ICE40LP8K, ICE40HX8K, ECP5 and TangNano9K boards

tango

Sample-Configs:

NameDescription
TangNano9KTang Nano 9K with 5axis-BOB
Tango-BoardTango-Board with Tang Nano 9K
Olimex-ICE40HX8K-EVB_BOBOlimex ICE40HX8K-EVB with 5axis-BOB
TinyFPGA-BX_BOBTinyFPGA-BX with 5axis-BOB
ICEBreakerV1.0eICEBreakerV1.0e tests
Lattice-iCE40HX8K_BOBLattice iCE40HX8K with custom bob
Colorlight5A-75EColorlight5A-75E tests
Alhambra-IIAlhambra II FPGA board with 3 Axis SPI

Plugins:

TypeNameDescription
jointpwmdirPWM Joint Output with DIR-Pin
jointrcservoRCSERVO Joint Output
jointstepperStepper Joint Output with STEP/DIR/ENABLE(optional) pins
vinfrequencyVariable-Input for frequency measurement
vinpulsecounterVariable-Input for pulse counting with up to 3 pins (all optional)
vinpwmcounterVariable-Input for pulse width measurement
vinquadencoderVariable-Input for Quad-Encoder (int32_t)
vinquadencoderzVariable-Input for Quad-Encoder with Z-Pin (int32_t)
vinsonarVariable-Input for distance measurement via ultrasonic sonar sensor (HC-SR04)
vinsonarVariable-Input for temperature measurement via LM75 sensor
voutfrequencyVariable-Output for frequencys
voutpwmVariable-Output for PWM-Signals with optional DIR pin
voutsinepwmVariable-Output for Sine-Waves via PWM-Signal
voutspipotiVariable-Output using digital poti with SPI Interface (like MCP413X/415X/423X/425X)
voutudpotiVariable-Output using digital poti with UpDown/Incr. Interface (like X9C104)
dinbitDigital Input Pin (1bit)
doutbitDigital Output Pin (1bit)
expansionshiftregExpansion to add I/O's via shiftregister's
interfacespislavecommunication interface ( RPI(Master) <-SPI-> FPGA(Slave) )

FPGA-Toolchain:

https://github.com/YosysHQ/oss-cad-suite-build

for the TangNano9K, you can also using the Gowin-IDE or Gowin-Shell (it's faster)

interfacing with the raspberry

Interface: SPI

Chipselect: CE_1

do not reuse the chipselect pin of your SPI-Flash !!!

interfacing via Ethernet

you can also use UDP2SPI bridge to communicate via Ethernet (UDP)

test-tool

if you want to test the connection without LinuxCNC, you can use the python test-tool:

python3 Output/BOARD_NAME/Firmware/qt_spitest.py [IP]

some hints

at the moment, you need at least configure one item of each of the following sections: vin, vout, din, dout, joints

buildtool

you can select a config via make argument:

make CONFIG=configs/TinyFPGA-BX_BOB/config.json build

Structure:

buildtool.py plugins: python scripts to generates the verilog files from a configuration

configs: here are the config files for a specific setup (Target-FPGA / Pins)

Output: the generated files per config

some demo videos

LinuxCNC-RIO with TinyFPGA-BX and 5Axis BOB - ATC-Test

LinuxCNC-RIO with TinyFPGA-BX and 5Axis BOB - ATC-Test

linuxcnc with tinyfpga-bx

linuxcnc with tinyfpga-bx

Mini Closed-Loop DC-Servo on LinuxCNC-RIO

Mini Closed-Loop DC-Servo on LinuxCNC-RIO

Linuxcnc RIO with ICEBreaker FPGA

Linuxcnc RIO with ICEBreaker FPGA

LinuxCNC-RIO mixed joint types (on TangNano9K - FPGA)

LinuxCNC-RIO mixed joint types (on TangNano9K - FPGA)

LinuxCNC-RIO with TinyFPGA-BX and 5Axis BOB

LinuxCNC-RIO with TinyFPGA-BX and 5Axis BOB

LinuxCNC with ICE40 for stepgen

LinuxCNC with ICE40 for stepgen

Linuxcnc RIO with Tang Nano 20k FPGA with esp32 and w5500 Ethernet

Linuxcnc RIO with Tang Nano 20k FPGA with esp32 and w5500 Ethernet


Thanks to the https://github.com/scottalford75/Remora Project, i'm using a modified version of it's Linux-Component

Documents
Comments Write