Advanced Search

Search Results (Searched for: raspberry pi 3)

  • 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
  • JAMSys
  • JAMSys
17 Jun 2025 11:01

Linuxcnc 2.9.2 and 2.93 images for Raspberry Pi 4b & 5

Category: Installing LinuxCNC

Thanks a lot. This is the info I was looking for.
  • unknown
  • unknown
17 Jun 2025 10:41

Linuxcnc 2.9.2 and 2.93 images for Raspberry Pi 4b & 5

Category: Installing LinuxCNC

Hi,
The Linuxcnc 2.9.2 and 2.93 images for Raspberry Pi 4b & 5 are
special OS. The menu-config configuration does not have the option for auto login.
 

Rod's the one that has put them together, apart from the RT kernel & the addition of the Linuxcnc packages it's just Debian. Nothing special about the actual OS.
  • rodw
  • rodw's Avatar
17 Jun 2025 10:19

Linuxcnc 2.9.2 and 2.93 images for Raspberry Pi 4b & 5

Category: Installing LinuxCNC

Hi,
The Linuxcnc 2.9.2 and 2.93 images for Raspberry Pi 4b & 5 are
special OS. The menu-config configuration does not have the option for auto login.

Nothing to do with menu-config. Its all Linux
gnipsel.com/linuxcnc/debian-11-fix.html
  • JAMSys
  • JAMSys
17 Jun 2025 05:38

Linuxcnc 2.9.2 and 2.93 images for Raspberry Pi 4b & 5

Category: Installing LinuxCNC

Hi,
The Linuxcnc 2.9.2 and 2.93 images for Raspberry Pi 4b & 5 are
special OS. The menu-config configuration does not have the option for auto login.
  • rodw
  • rodw's Avatar
16 Jun 2025 12:05

Linuxcnc 2.9.2 and 2.93 images for Raspberry Pi 4b & 5

Category: Installing LinuxCNC

You should be able to set up auto login the same way it is done with an x86 machine as its the OS you are logging into
  • JAMSys
  • JAMSys
16 Jun 2025 08:50

Linuxcnc 2.9.2 and 2.93 images for Raspberry Pi 4b & 5

Category: Installing LinuxCNC

Hi,

Is it possible to create an auto-login for the raspberryPi in order to create a keyboard less system with gmoccapy?
  • billykid
  • billykid's Avatar
15 Jun 2025 14:08 - 15 Jun 2025 14:14

Linuxcnc & the Raspberry Pi (4 & 5) Official Images Only!!!

Category: Installing LinuxCNC

so it's perfect! if I think how much time I wasted with a nuc i3 to improve the latency without succeeding... I need it to tune up some drives that I recovered 2 years ago, now I also have the servos. if anyone knows these maybe they can give me some advice on how to use them in the best way.
drive Sanmotion rs2aa03a0al0 motor r2aa06040fxp
Displaying 226 - 240 out of 697 results.
Time to create page: 0.758 seconds
Powered by Kunena Forum