You are currently viewing LinuxCNC Raspberry PI-4B double step implementation

LinuxCNC Raspberry PI-4B double step implementation

LinuxCNC Raspberry PI-4B Double Step Implementation

First, a big thanks to the LinuxCNC developers and community members for their continued efforts. Previously, the Raspberry Pi 3B/4B was limited to 10 kHz software step generation. With the new double-step feature, we can now achieve 20 kHz software step generation, effectively doubling the speed of stepper motors.

This guide will walk you through the steps to implement the double-step feature on your Raspberry Pi 4B.


Prerequisites:

  • Raspberry Pi 4B (or 3B)
  • 16/32 GB SD card
  • LinuxCNC Debian Buster (64-bit) with the 5.10 RT kernel

Step 1: Download and Install LinuxCNC

To start, you’ll need to install a 64-bit Debian Buster-based image with the real-time (RT) kernel. Special thanks to ELOVALVO, a LinuxCNC Forum member, for providing the image.

  1. Download the image: linuxcnc-2.8.2-pi4-arm64.zip
  2. Install on SD card: Use an SD card of at least 16 GB for optimal performance.

Step 2: Double Step Feature by tjtr33

Next, we have to thank tjtr33, another member of the LinuxCNC Forum, for his contribution. He provided the hal_pi_gpio.c file that allows for double-step implementation in LinuxCNC.


Step 3: Install the Compiled .so File

For your convenience, I’ve compiled the hal_pi_gpio_new.so file needed for the double-step feature. Follow these steps:

  1. Download the .so file and place it in the /home/yourusername/hal directory.

  2. Copy the file to the LinuxCNC modules directory by running the following command in your terminal:

    bash
    sudo cp /home/yourusername/hal/hal_pi_gpio_new.so /usr/lib/linuxcnc/modules/hal_pi_gpio.so

Step 4: Run LinuxCNC with Double-Step

After copying the file, you’re ready to run LinuxCNC on your Raspberry Pi with the double-step feature enabled, doubling the speed of your stepper motors.


By following these steps, you’ll be able to achieve 20 kHz software step generation, greatly improving the speed and performance of your stepper motors on the Raspberry Pi platform.



This Post Has One Comment

Leave a Reply