Advanced Search

Search Results (Searched for: raspberry pi 3)

  • PCW
  • PCW's Avatar
Yesterday 21:09
Replied by PCW on topic Raspberry Pi 4 with Mesa 7c81

Raspberry Pi 4 with Mesa 7c81

Category: Driver Boards

Honestly, I would just add a  leaded 620 Ohm pulldown
resistor on the back of the breakout card and not make
any further modifications.
 
  • whyme
  • whyme
Yesterday 18:59 - Yesterday 20:19
Replied by whyme on topic Raspberry Pi 4 with Mesa 7c81

Raspberry Pi 4 with Mesa 7c81

Category: Driver Boards

so a stiff pulldown to fight the pullup of the mesa card for the inputs?

I am using 7c81_5abobx2d firmware with BOB boards on P1 and P2.

Edit:
I did a little bit of digging.
- The relay pin P17 is IO7 of the Mesa ports, which is on the edge of the pull resistor array. I could desolder the array and put it back on shifted by one to remove the resistor of the pin.
- On the BOB there is a 10k pullup array on the relay pin. but the signal comes through a via in the middle of the pullup resistor and the 74HC... I could cut the trace between the via and the resistor to remove the pull up on the BOB
- solder in a pulldown resistor on the BOB (if for whatever reason the flat cable between the Mesa and BOB gets bad).
  • PCW
  • PCW's Avatar
Yesterday 15:59
Replied by PCW on topic Raspberry Pi 4 with Mesa 7c81

Raspberry Pi 4 with Mesa 7c81

Category: Driver Boards

The 7C81 only has the option of all pullups and all pulldowns
on its I/O ports.

Simplest solution would probably be to add a stiff pulldown (say 620 ohms)
on the relay I/O pin. There is a firmware option for fixed parallel port type I/O
but currently its global (not per port), This firmware makes the parallel port
output pins default to outputs instead of inputs at startup or watchdog bite
What firmware are you using?
  • whyme
  • whyme
Yesterday 14:57
Replied by whyme on topic Raspberry Pi 4 with Mesa 7c81

Raspberry Pi 4 with Mesa 7c81

Category: Driver Boards

Maybe a stupid question, but how do you use the relay on those cheap MACH3 BOBs with the 7c81?

For the inputs to work I need to enable the pullups on the 7C81.
But enabling the pullups makes the relay close as soon as the BOB is powered.

Ideally I would want the relay to be open until linuxcnc is started and I tell linuxcnc to close the relay.

But the relay closing by default due to the pullups makes it unusable, or did I miss something?
  • Will_cnc
  • Will_cnc
03 Jul 2025 19:13

Step By Step Help Needed . EL8 Leadshine to PI 5

Category: EtherCAT

Hi all,For context: I'm currently building the control system for a Samurai 120 CNC machine (please see the attached photo).Machine electronic hardware configuration:
  • 3 × Leadshine EL8 EtherCAT servo drives
  • 2 × 400W Leadshine motors with optical encoders and battery backup
  • 1 × 400W Leadshine motor with motor brake, also with optical encoder and battery backup
  • 1 × Beckhoff EK1100 EtherCAT coupler
  • 1 × Raspberry Pi 5 for control
Current progress:
  1. Successfully installed LinuxCNC on the Raspberry Pi 5
  2. Updated to the latest version
  3. Installed CIA402 using Rodw’s guide
  4. Configured the Pi as an EtherCAT master
Where I need help: I'm struggling to understand how to configure LinuxCNC to communicate with the servo drives in a basic setup.From what I understand, LinuxCNC relies on three main configuration files:
  1. .ini
    – Loads the user interface and references the
    .hal
    file
  2. .hal
    – The Hardware Abstraction Layer, which defines machine characteristics and connects components
  3. .xml
    – Extracts and defines information from the servo drives
I found Marco Reps’ GitHub repository, which uses a similar configuration. I downloaded all the files and attempted to launch LinuxCNC using the "el8" configuration, but it failed to load.
 Could someone please provide a step-by-step  on how to configure Linux CNC for my current setup? Any help would be greatly appreciated! 

I intend on eventually using the probe basic user interface as I an touchscreen this would work well with. https://samuraimachinetools.com/cdn/shop/files/IMG_9964.jpg?v=1722652171&width=1445
 
  • nejiman10
  • nejiman10's Avatar
02 Jul 2025 14:03 - 02 Jul 2025 14:13

LinuxCNC with RIO (FPGA) SPI Issue: Unexpected 'HXHP' Response

Category: General LinuxCNC Questions

Current Situation and Probrem
I am trying to establish stable SPI communication between a Raspberry Pi 4 and an ICE40UP5K FPGA (IceShield) using LinuxCNC and the RIO framework.
While basic SPI communication seems functional outside of LinuxCNC, I am currently encountering unexpected behavior during runtime: the system consistently logs "WRONG DATA" with "HXHP" as the received header.
My goal is to understand what SPI response LinuxCNC expects from the FPGA, and how to configure both ends to ensure correct communication.

Environment
  •     Raspberry Pi 4
  •     LinuxCNC version: 2.9.4 (same behavior also observed in 2.9.3 and 2.8.4)
  •     OS: Official LinuxCNC 2.9.4 Raspberry Pi 4 Bookworm image
  •     FPGA: ICE40UP5K-SG48I (IceShield)
  •     Clock source: Since gpio is not available on Bookworm, I use pigpiod to generate a 5 MHz clock on GPIO 4:
         
    #!/bin/bash sudo pigpiod pigs hc 4 5000000
      I also modified spiflash.sh to work with pigpiod under Bookworm

FPGA Status
  • The Verilog design (rio.v) is written to return the SPI response header "data" (0x64617461)
  • The FPGA’s LED is blinking and SPI data is returned via external tools. This suggests the FPGA is operating correctly with the supplied clock.

SPI Test Using Python
To confirm basic SPI functionality outside of LinuxCNC, I used this script:
import spidev
import time

SPI_BUS = 0
SPI_DEVICE = 0
SPI_SPEED_HZ = 25000  # 25 kHz

spi = spidev.SpiDev()
spi.open(SPI_BUS, SPI_DEVICE)
spi.max_speed_hz = SPI_SPEED_HZ
spi.mode = 0b00

try:
    print("Sending dummy byte 0x00 to read response...")
    result = spi.xfer2([0x00] * 8)
    print("Received:", " ".join(f"0x{b:02X}" for b in result))
finally:
    spi.close()
This consistently returns "data" from the FPGA, suggesting that low-level SPI transport is functioning properly.

Behavior in LinuxCNC
  • In the rio_readwrite() function, logging shows the SPI response always begins with "0:02" (0x30 0x3A 0x30 0x32)
  • However, the LinuxCNC log reports "WRONG DATA" with the string "HXHP" (0x48 0x58 0x48 0x50)
  • I did not find any logic in the Verilog code that would return "HXHP"
  • I suspect that "HXHP" is generated internally by LinuxCNC when an unrecognized or malformed header is received

Observations
  • SPI communication appears to be working, and the FPGA is returning a response
  • However, there may be a mismatch between the header format LinuxCNC expects and what the FPGA sends
  • LinuxCNC may be replacing the unrecognized header with "HXHP" as a default or fallback

Questions
  • Where in the LinuxCNC source is "HXHP" generated or substituted? Is this a fallback response?
  • Is the "0:02" sequence a standard header sent by LinuxCNC under the RIO configuration?
  • What header or message structure (e.g. MSGID) is LinuxCNC expecting from the FPGA?
  • Are there documented or example SPI response formats compatible with riocomp?

I would appreciate any advice or clarification.
I can provide Verilog and riocomp.c sources if helpful. Thank you.















 
  • Ac1dburn
  • Ac1dburn
30 Jun 2025 10:10

Remora - Rpi Software Stepping Using External Microcontroller via SPI

Category: Computers and Hardware

Hey, sorry if this isn't the spot to ask for help with this issue. 

So I've decided to try to build a new controller for my CNC converted lathe. Did some searching around and found remora. I already had an SKR 1.4 Turbo sitting in a closet from an old Voron machine. As far as I remember, I was running Klipper on it, but didn't mess with the bootloader or anything. 
So far I have:
grabbed the firmware.bin from the "github.com/scottalford75/Remora/tree/mai.../FirmwareBin/LPC1769"
placed it on a freshly flashed FAT32 4GB SD card.
placed my extremely minimal config.txt on the SD  card as well
inserted into my SKR 1.4 Turbo and powered it for 10-20 seconds, cut power.
removed the SD card and inserted it into my card read on my windows machine and confirmed the firmware.bin did in fact change to firmware.cur
ejected the SD card, re-inserted it into the SKR 1.4 Turbo.
Powered on my raspberry pi 4 running the: LinuxCNC 2.9.4 Raspberry Pi 4 OS based on Debian Bookworm Raspberry Pi 4 Uspace compatible with Mesa Ethernet and SPI interface boards. Img. from the linuxcnc downloads page.
SPI enabled in the /boot/firmware/config.txt on the raspberry pi 4
SPI and Serial Debugging wired and configured in the SKR 1.4 Turbo config.txt
Hal file for my config is setup minimally to only include two axis's and the rest of the standard Remora hal related stuff. (I may have missed something but I followed the remora documentation as best I could)
Everything "seemed" okay at first, with the SKR not powered, I could launch my probe basic lathe config, but couldn't take it out of e-stop (expected as the hal file has a remora e-stop function that prevents this without an active SPI link)
Boot the SKR up, and launch my probe basic lathe config and I am able to take the machine out of e-stop. 
However, this is where I hit a dead end. I went to add my limit switches, I configured my hal file to reflect what was in my SKR's config.txt for those data bits and I was hit with "remora.input.00" does not exist and the obviously probe basic lathe doesn't launch. 
I double checked my config.txt to make sure I didn't having any duplicated data bits etc. etc. etc. 
That's when I "tried" to watch the serial debug in terminal by adding the serial debug section into my SKR's config.txt. 
booted the pi 4, ran: screen /dev/serial0 115200 in terminal, started watching the window, powered the SKR up and it showed some things, however, not what I was expecting. It sets up some pins for the limits, but they aren't what I had in my config.txt... not based on the data bits I had selected. I also tried a variation of different data bits etc. and still couldn't get it to load the correct ones. I ended up just updating the hal file to reflect what it DID assign those pins to and probe basic lathe did launch at that point. So I triggered the input pins for both limits on the SKR while monitoring halshow and it's not showing a trigger. I also don't even think my serial debug screen is displaying correctly. I've tried re-flashing the SD card, double checked I was using the correct firmware.bin for my board. triple check my SPI wiring, replaced with shorter wiring, etc. I'm really stumped. I was going to try flashing the default SKR 1.4 turbo firmware and try re-flashing after that, but I was having trouble finding a pre-built firmware.bin to flash and I'm terrible at building from source. Any help with getting this running correctly would be really appreciated. I've spent the last 4 days or so struggling to figure it out on my own. I've attached a copy of my current hal file (it's rough/ not complete yet but it launches)
a copy of my config.txt that is in the root directory of the SKR SD card, and a screenshot of what my serial debug monitoring is showing in screen. 
(note: I left the pins for the x and z limit in my hal setup to whatever it created for them based on the serial debug screen because that's what allowed me to launch)

thanks again in advance.


 
  • LucDav
  • LucDav
25 Jun 2025 22:10 - 25 Jun 2025 22:13

Solving Reversed Spindle Speed: HAL Inversion for PWM-to-Analog (Pi5, hal_gpio)

Category: Basic Configuration

Hello everyone,

I'm setting up a PWM-controlled spindle for my LinuxCNC machine. My analog DC motor controller requires a 0-10V input, which I'm generating with this specific PWM-to-analog converter: www.amazon.co.uk/Digital-Analog-Module-C...&smid=A2BXCFIGGD7VDT.

The PWM signal is sourced directly from a Raspberry Pi 5's GPIO, routed through our custom-designed isolator board HAT, V1.1, which you can find details about here: github.com/data124001/Isolation/wiki. We're running LinuxCNC version 2.9.1 and using the hal_gpio library.

The core issue is that this specific PWM-to-analog converter appears to invert the control signal: a 100% PWM duty cycle from the Pi (and hal_gpio) results in zero motor speed, while a 0% PWM duty cycle results in full motor speed. This means my spindle speed control is completely reversed from what's expected (higher LinuxCNC speed command = lower motor RPM).

We have confirmed that the PWM signal generated by the Raspberry Pi 5's GPIO (whether directly or via our custom isolator board) is behaving correctly in terms of duty cycle interpretation (e.g., 50% duty cycle is "half on"). However, without this specific PWM-to-analog converter in the loop, we have no meaningful 0-10V speed control for the motor controller, only basic on/off, as the raw PWM is unsuitable.

Therefore, the problem lies squarely with the inversion introduced by the Amazon PWM-to-analog converter itself when converting the standard Pi PWM.

My question is: What are the most effective and robust methods within LinuxCNC's HAL configuration to invert the hal_gpio PWM signal before it reaches this converter? I'm looking for a HAL-based software solution to achieve the correct 0-10V spindle speed control (where a higher LinuxCNC spindle.0.speed-out value corresponds to a higher analog voltage to the motor controller and thus higher motor RPM).

I will be attaching my HAL and INI files to this post to provide full context of my current setup.

Any specific HAL configurations or example code would be incredibly helpful!

Thanks in advance.

 
  • atrex77
  • atrex77's Avatar
25 Jun 2025 13:15

W5100S-EVB-PICO stepgenerator and encoder driver

Category: Driver Boards

Raspberry PI4 test version of the project is now online in the test branch (with docs how to connect), if you are interested try it, more info on the discord channel.

github.com/atrex66/stepper-ninja/tree/test

discord.gg/tKBEQGqw
  • unknown
  • unknown
25 Jun 2025 03:00
Replied by unknown on topic LC 2.9.4 Configuration - Unsupported Locale

LC 2.9.4 Configuration - Unsupported Locale

Category: PnCConf Wizard

forum.linuxcnc.org/9-installing-linuxcnc...only?start=10#320959

Just about ecevrything to do with the Rpi images can be found in this thread, there is also an index to that thread here
forum.linuxcnc.org/38-general-linuxcnc-q...official-images-only
  • electrosteam
  • electrosteam
24 Jun 2025 10:31
Replied by electrosteam on topic WiFi Problem on Raspberry Pi

WiFi Problem on Raspberry Pi

Category: General LinuxCNC Questions

Borrowed a dongle, TP-Link TP-WN722N, from a Forum Member.

Got an external antenna from another Form Member.

Much swapping and shifting around between bench, cubicle and cabled as far from cubicle as lengths would allow.
Dongle, antenna, 4GB and 8GB, power supplies, LC2.9.2 and LC2.9.4, etc etc
The Dongle works fine, Ebay says $15.

Eventually replaced the monitor on the mill with the one from the bench.
SUCCESS.
Even works in the cubicle with door open without the dongle.

Who would have thought !

Suggestions welcomed on what to do with the faulty monitor.
I am in Kingswood if you want to drop by and take it off my hands.

Thanks to all for the help,
John.
  • unknown
  • unknown
23 Jun 2025 23:12

Info regarding Index to the Main RPi Thread

Category: Computers and Hardware

The original thread was getting way long, with a lot of info spread out.
Pleas pay particular attention to the hal_gpio stuff, there is a basic 3 axis mill config that works. If you get any errors when thrying to use hal_gpio, unless the error log states "no permission" the issue is a permission error (which should not happen), otherwise it is related to the GPIO pins selected or somethng else. Mostly this occurs when a user attempts to use the SPI allocated pins without disabling the SPI interface.
What I suggest to the RPi users is to bookmark the Index thread forum.linuxcnc.org/38-general-linuxcnc-q...l-images-only#325007 for later reference . 
  • meister
  • meister
23 Jun 2025 12:50
Replied by meister on topic How to design new driver for my own board

How to design new driver for my own board

Category: Driver Boards

sweet :)

and for the host interface USB?
this will not really work :(
LinuxCNC is a little bit different to other controller like GRBL,
you need a realtime loop between board and host and this will only work with Ethernet/Ethercat/SPI(raspberry) or LPT., not with USB or UART.

If you need almost ready to use Gateware/Drivers for your board, you can look at:

github.com/multigcs/riocore/
(github.com/multigcs/riocore/blob/dev/doc/BOARDS.md)

this is a gateware generator and all the FPGA stuff is written in verilog,
but it use W5500 UDP interface or SPI.
There is also an UART/USB plugin, but only for testing, not for realtime use.

you can take a look on my youtube channel, there are many videos with different FPGA's running RIO:
www.youtube.com/@unixconf/

but i can understand if you prefer to write your own software, it's also fun :)
  • unknown
  • unknown
20 Jun 2025 14:47

(SOLVED) hal_gpio: Operation not permitted fault cannot be solved

Category: HAL

The images are setup and no adding users to groups or messing around is needed.
Read the following thread and you'll find a link to GPIO info and a working example.
forum.linuxcnc.org/38-general-linuxcnc-q...official-images-only
  • bladekel
  • bladekel
20 Jun 2025 14:15 - 20 Jun 2025 14:19

(SOLVED) hal_gpio: Operation not permitted fault cannot be solved

Category: HAL

Hello to all.
I'm using Linuxcnc 2.9.4 on rpi5 debian bookworm that is installed from linuxcnc rpi5 image.
I have a problem on running my setup.
I tried many things like adding gpio to my user, creating a file 90-gpio-access that is mentioned on hal_gpio manual (linuxcnc.org/docs/devel/html/drivers/hal_gpio.html)

but I failed.

Here is my fault information;
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.9.4
Machine configuration directory is '/home/cnc/linuxcnc/configs/my-mill'
Machine configuration file is 'my-mill.ini'
INIFILE=/home/cnc/linuxcnc/configs/my-mill/my-mill.ini
VERSION=1.1
PARAMETER_FILE=linuxcnc.var
TPMOD=
HOMEMOD=
TASK=milltask
HALUI=
DISPLAY=axis
COORDINATES=X Y Z A
KINEMATICS=trivkins coordinates=XYZA
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Found file(REL): ./my-mill.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
Failed to register output pin collection
hal_gpio: rtapi_app_main: Operation not permitted (-1)
./my-mill.hal:4: waitpid failed /usr/bin/rtapi_app hal_gpio
./my-mill.hal:4: /usr/bin/rtapi_app exited without becoming ready
./my-mill.hal:4: insmod for hal_gpio failed, returned -1
2307
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime

my groups are;
cnc@raspberrypi:~$ groups
cnc tty disk dialout sudo audio video plugdev users input render netdev i2c bluetooth gpio spi
Displaying 1 - 15 out of 894 results.
Time to create page: 0.445 seconds
Powered by Kunena Forum