Advanced Search

Search Results (Searched for: raspberry)

Today 23:20

Trying out LinuxCNC on Raspberry PI5

Category: General LinuxCNC Questions

What's the easiest interface board for a new user to use
Parport bob is easy to use.
There are guides to set it up.
Today 20:05

Trying out LinuxCNC on Raspberry PI5

Category: General LinuxCNC Questions

I setup a Raspberry PI5 using this download: 
Today 18:03
Replied by Krister on topic LinuxCNC on Raspberry Pi 5

LinuxCNC on Raspberry Pi 5

Category: Installing LinuxCNC

Problem with indexpuls on spindle ,The reading on the imput 10 GPIO 22 for the indexpuls is 0.5 volt ac and the reading on input 11 GPIO 24 is 0.2 v ac , I dont know
the settings in HAL file for this and I need help to find the right values for correkt reading in the Hal file ,i dont know the right place to play with these numers , I can read the signal on the input at the chinese breakout bord and after that the signal disepere nothing in the Halmeter or Halscope. My set up is Raspberry pi 5 and this byte2bot.com/blogs/instructions/setting-...-the-pi-parallel-hat and this byte2bot.com/products/5-axis-cnc-interfa...tepper-motor-drivers


the HAL file

# Generated by stepconf 1.1 at Mon Mar 18 18:19:52 2024
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
#loadrt hal_parport cfg="0 out"
#setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0
loadrt encoder num_chan=4
loadrt abs count=1
loadrt scale count=1
loadrt lowpass count=1
loadrt near
loadrt pwmgen output_type=1
loadrt classicladder_rt numPhysInputs=15 numPhysOutputs=15 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10
#loadrt charge_pump

#loadrt hal_pi_gpio dir=0x13407 exclude=0x1F64BF8

loadrt hal_gpio inputs=PIN22,PIN32,PIN33,PIN24,PIN26 outputs=PIN12,PIN37,PIN21,PIN19,PIN23,PIN29,PIN31,PIN35,PIN11,PIN16,PIN13,PIN18




#addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
#loadrt sum2 count=1
#loadrt not count=1


addf encoder.update-counters base-thread
addf pwmgen.make-pulses base-thread
#addf parport.0.write base-thread
#addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf encoder.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf classicladder.0.refresh servo-thread
addf stepgen.update-freq servo-thread
addf pwmgen.update servo-thread
addf abs.0 servo-thread
addf scale.0 servo-thread
addf lowpass.0 servo-thread

addf hal_gpio.read base-thread
addf hal_gpio.write base-thread
addf near.0 servo-thread

net spindle-cmd-rpm => pwmgen.0.value
net spindle-on <= spindle.0.on => pwmgen.0.enable
net spindle-pwm <= pwmgen.0.pwm
setp pwmgen.0.pwm-freq 100.0
setp pwmgen.0.scale 1166.6666666666665
setp pwmgen.0.offset 0.11428571428571428
setp pwmgen.0.dither-pwm true
net spindle-cmd-rpm <= spindle.0.speed-out
net spindle-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-cmd-rps <= spindle.0.speed-out-rps
net spindle-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-at-speed => spindle.0.at-speed
net spindle-cw <= spindle.0.forward

################ Spindle index #########################
# Add the encoder to HAL and attach it to threads.
#loadrt encoder num_chan=4
#addf encoder.update-counters base-thread
#addf encoder.capture-position servo-thread

# Set the HAL encoder to 20 pulses per revolution.
setp encoder.3.position-scale 20

# Set the HAL encoder to non-quadrature simple counting using A only.
setp encoder.3.counter-mode true

# Connect the HAL encoder outputs to LinuxCNC.
net spindle-position encoder.3.position => spindle.0.revs
net spindle-velocity encoder.3.velocity => spindle.0.speed-in
net spindle-index-enable encoder.3.index-enable <=> spindle.0.index-enable

# Connect the HAL encoder inputs to the real encoder.
net spindle-phase-a encoder.3.phase-A # <= hal_gpio.PIN24-in
net spindle-phase-b encoder.3.phase-B
net spindle-index encoder.3.phase-Z # <= hal_gpio.PIN22-in-not
setp encoder.3.position-scale 20.000000 #
setp encoder.3.counter-mode 1 #

setp lowpass.0.gain 0.05

net spindle-position encoder.3.position => spindle.0.revs
#net spindle-velocity-feedback-rps encoder.3.velocity => spindle.0.speed-in
net spindle-index-enable encoder.3.index-enable <=> spindle.0.index-enable
net spindle-phase-a encoder.3.phase-A
net spindle-phase-b encoder.3.phase-B
net spindle-index encoder.3.phase-Z

#net estop-out => parport.0.pin-01-out
net xstep => hal_gpio.PIN21-out
#setp parport.0.pin-02-out-reset 1
net xdir => hal_gpio.PIN19-out
net ystep => hal_gpio.PIN23-out
#setp parport.0.pin-04-out-reset 1
net ydir => hal_gpio.PIN29-out
net zstep => hal_gpio.PIN31-out
#setp parport.0.pin-06-out-reset 1
net zdir => hal_gpio.PIN35-out
#net astep => hal_gpio.PIN11-out
#setp parport.0.pin-08-out-reset 1
#net adir => hal_gpio.PIN16-out
net spindle-cw => hal_gpio.PIN11-out
net spindle-pwm => hal_gpio.PIN16-out
net xenable => hal_gpio.PIN37-out
net spindle-index <= hal_gpio.PIN22-in
net spindle-phase-a <= hal_gpio.PIN24-in
net min-home-x <= hal_gpio.PIN26-in
net min-home-z <= hal_gpio.PIN33-in





#############################################################
setp stepgen.0.position-scale [JOINT_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 35000
setp stepgen.0.dirsetup 35000
setp stepgen.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL
net xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => joint.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable joint.0.amp-enable-out => stepgen.0.enable

net min-home-x => joint.0.home-sw-in
net min-home-x => joint.0.neg-lim-sw-in
net min-home-x => joint.0.pos-lim-sw-in

setp stepgen.1.position-scale [JOINT_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 35000
setp stepgen.1.dirsetup 35000
setp stepgen.1.maxaccel [JOINT_1]STEPGEN_MAXACCEL
net zpos-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
net zpos-fb stepgen.1.position-fb => joint.1.motor-pos-fb
net zstep <= stepgen.1.step
net zdir <= stepgen.1.dir
net zenable joint.1.amp-enable-out => stepgen.1.enable
net min-home-z => joint.1.home-sw-in
net min-home-z => joint.1.neg-lim-sw-in
net min-home-z => joint.1.pos-lim-sw-in

net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

# Load Classicladder without GUI (can reload LADDER GUI in AXIS GUI
loadusr classicladder --nogui custom.clp
Today 12:46

LinuxCNC on Raspberry Pi 5 CPU 3 not running

Category: Installing LinuxCNC

LinuxCNC just running a servo-thread only runs  a single Realtime thread. By definition thats gunna run on a single core as you observed. Maybe the base thread runs on a second core but i have never used a base thread.

When you run a ethernet connected device, machine latency is no longer important, its the network latency that limits performance. I think this means we should review how we evaluate PC suitability for LinuxCNC. latancy-histogram gives better results with multiple isolated cores but does that matter at all?

 
Yesterday 20:36 - Yesterday 20:42

LinuxCNC on Raspberry Pi 5 CPU 3 not running

Category: Installing LinuxCNC

@cornholio:
Thank you for the reply.
"Have you tried htop when running gcode and actually running a machine ?"
No, so far I only did "dry-tests".
I plan to retrofit a EMCO F1 CNC Woodworker. For this machine I bought a Benezan Tripple Beast ( a long time ago...). My plan is to set up LinuxCNC on a Raspberry Pi 5 to control the Tripplebeast.
My last machine was a portal router (DIY) that was (still is) controlled by DC-Servos with UHU3.0-controllers that I build (also a very long time ago)

Regarding the RP5: I hope I can find time to test the setup on the bench next week.
When I have news, I'll post them here.

Than you for your help.
25 May 2024 02:16 - 25 May 2024 02:20

LinuxCNC on Raspberry Pi 5 CPU 3 not running

Category: Installing LinuxCNC

Don't worry about it.

Everything will work fine when running a machine.

Have you tried htop when running gcode and actually running a machine ?

You can modify the isolcpu parameter, it's under the /boot folder in a subfolder, mind tho the boot folder has a different structure to the standard RPi one. It's been a while since I've used my RPi5 since helping Rod put the image together (due to the lack of a SPI driver for Mesa hardware).

Long story short latency will suffer without isolation. And depending how cache is shared between the cores there can be a performance hit by isolating the incorrect pair of CPUs (this was from a long forgotten paper). At the end of the day it's not outright performance this is vital with Linuxcnc but latency. Having a responsive interface and more importantly having latency within spec is all that matters. It's not as if you'll using the machine as a desktop whilst running a machine. Remember it's a single use computer, not a desktop.

Play around with isolating CPUs run some latency tests and see how you go. BTW what hardware are you using to control your machine.

Even on a multi core machine with no cpus isolated if the load doesn't require it you will have cores that are more or less idle.
24 May 2024 22:52 - 24 May 2024 23:07

LinuxCNC on Raspberry Pi 5 CPU 3 not running

Category: Installing LinuxCNC

The third CPU (Number "2") of the Raspberry is not running.
LinuxCNC ("realtime stuff") only uses Core Number 3 (the fourth)

Is there something that can be done to use both Cores (Number 2 and 3 = third and fourth) for LinuxCNC?
24 May 2024 22:18

LinuxCNC on Raspberry Pi 5 CPU 3 not running

Category: Installing LinuxCNC

2 cores run the day to day stuff
2 cores run the real-time stuff

Without isolating 2 cores latency takes a hit. It’s a common fix for latency on all platforms.
24 May 2024 21:06

LinuxCNC on Raspberry Pi 5 CPU 3 not running

Category: Installing LinuxCNC

Hi,
I used this image: rpi-5-debian-bookworm-6.1.61-rt15-arm64-ext4-2023-11-17-1520.img.xz
to set up a Raspberry Pi 5 with LinuxCNC.
So far it worked fine. Thanks a lot to all the people that put this image together!!

Now I discovered, that the third CPU (Number "2") of the Raspberry is not running. When LinuxCNC is started, using "htop", I can see, that the third CPU has no load, it is idleing. In the cmdline.txt there is this entry: isolcpus=2,3 and it seams, that LinuxCNC only uses the fourth (Number "3") CPU.
Is there something that can be done to use all the computing power of the Raspberry Pi 5?
24 May 2024 11:42

Help,with the EtherCAT config

Category: EtherCAT

Hi everyone,

I'm currently working on setting up an EtherCAT master on a Raspberry Pi using LinuxCNC. I've followed the steps for installation and successfully detected slaves. Specifically, I've connected an EK1100 and an EL7-EC400F driver.

However, upon proceeding with the setup, I encountered an error related to "lece_conf failed." I've made changes to the XML file as per the instructions provided.

Could someone please assist me in troubleshooting this issue? Any insights or suggestions on resolving the "lece_conf failed" error would be greatly appreciated.

Thank you for your help!
22 May 2024 15:01
Replied by Krister on topic LinuxCNC on Raspberry Pi 5

LinuxCNC on Raspberry Pi 5

Category: Installing LinuxCNC

Hi No I have not make any progress but i conekt a home switch to my Gpio pin for spindle index and when i click manualy on the switch the reading moved a bit , when I click fast i reach 60 rpm o the display so I think the problem is in the filter for the signal , i have to optical sensor and there are signal from both index and fase a, so my problem is to find the value for this part and if anybody can help me sort it out i be very happy ./krister
22 May 2024 07:51 - 22 May 2024 15:04
Replied by StoneB on topic LinuxCNC on Raspberry Pi 5

LinuxCNC on Raspberry Pi 5

Category: Installing LinuxCNC

Thanks for the pointer - updates are disabled :)

In the meantime, I managed to put a new RT kernel on: looks much better, right?
I followed the github.com/by/RT-Kernel instructions - probably not ideal as you, but I avoided a reinstall (and it's kernel 6.9.1 :D)...
20 May 2024 19:00 - 20 May 2024 19:08

PnCConf with RPI 4 and Mesa 7C81

Category: PnCConf Wizard

how to hand edit input output (GPIO) in hal and ini? 
please give me one example.
Thanks!!!!!
 



I am not sure if I undestand your question correct; but:
The *.hal and *.ini-files are plain text-files. you can edit them using any editor (notepad++ for instance).
I attached an excample for a *.hal- and *.ini-file. These excamples are for a RaspberryPi5 using only the GPIO-Port (useing the "Generic driver for any GPIO supported by gpiod" described here: linuxcnc.org/docs/stable/html/drivers/hal_gpio.html)

I hope this is helpfull.
19 May 2024 09:55

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

Category: Computers and Hardware

I have a raspberry pi5 and this is the code of how I started the SPI communication of the RPI5 - TangNano9K. (Not yet machine tested)

OS:  In /boot/broadcom/config.txt check is SPI is enabled (reboot if not)

# uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on

In /dev/
Check do you have listed spidev0.0, should be!

In RIO.h define:

#define TRANSPORT_SPI5


In RIO C add lines:

#ifdef TRANSPORT_SPI5
#include <linux/spi/spidev.h>
#include <sys/ioctl.h>
#endif


/***********************************************************************
*                STRUCTURES AND GLOBAL VARIABLES                       *
************************************************************************/

#ifdef TRANSPORT_SPI5
int spifd;
static uint8_t mode = SPI_MODE_0;
static uint8_t bits = 8;
static uint32_t speed = 1500000;
#endif




/***********************************************************************
*                       INIT AND EXIT CODE                             *
************************************************************************/

#ifdef TRANSPORT_SPI5
    rtapi_print("Info: Initialize SPI5 connection\n");
    spifd = open("/dev/spidev0.0", O_RDWR);
    if (spifd < 0) {
        rtapi_print_msg(RTAPI_MSG_ERR,"Failed to open SPI device\n");
        return -1;
    }

    // Set SPI mode
    if (ioctl(spifd, SPI_IOC_WR_MODE, &mode) == -1) {
        rtapi_print_msg(RTAPI_MSG_ERR,"Failed to set SPI mode\n");
        close(spifd);
        return -1;
    }

    // Set bits per word
    if (ioctl(spifd, SPI_IOC_WR_BITS_PER_WORD, &bits) == -1) {
        rtapi_print_msg(RTAPI_MSG_ERR,"Failed to set bits per word\n");
        close(spifd);
        return -1;
    }

    // Set max speed
    if (ioctl(spifd, SPI_IOC_WR_MAX_SPEED_HZ, &speed) == -1) {
        rtapi_print_msg(RTAPI_MSG_ERR,"Failed to set max speed\n");
        close(spifd);
        return -1;
    }
#endif

//Edit rtapi_app_exit function, add close(spifd)

void rtapi_app_exit(void)
{
    close(spifd);
    hal_exit(comp_id);
}




//In fuction void rio_transfer()  near end of it add: 

#ifdef TRANSPORT_SPI5

    struct spi_ioc_transfer tr = {
        //.tx_buf = (uint64_t)tx_buf,
        //.rx_buf = (uint64_t)rx_buf,
        .tx_buf = (uint64_t)txData.txBuffer,
        .rx_buf = (uint64_t)rxData.rxBuffer, 
        .len = SPIBUFSIZE,
        .speed_hz = speed,
        .delay_usecs = 0,
        .bits_per_word = bits,
    };

    // Perform SPI transfer
    if (ioctl(spifd, SPI_IOC_MESSAGE(1), &tr) == -1) {
rtapi_print_msg(RTAPI_MSG_ERR,"Failed to perform SPI transfer\n");
        //close(spifd);
        //return -1;
    }

#endif


//Save and do hallcompile...
 
Displaying 1 - 15 out of 964 results.
Time to create page: 1.318 seconds
Powered by Kunena Forum