Raspberry PI4, Ubuntu 64 bit & LinuxCNC
03 Jan 2022 22:21 #230690
by elovalvo
Raspberry PI4, Ubuntu 64 bit & LinuxCNC was created by elovalvo
This post describes how to install a 64-bit kernel based on Ubuntu and build LinuxCNC to suit on the Raspberry Pi 4.
Taking advantage of the end-of-year holidays and the forced lockdown due to COVID, taking into account the availability of a new version of PREEMPT_RT, I updated the 64-bit image for Raspberry 4B ( downloads.raspberrypi.org/raspios_arm64/...os_arm64-2021-11-08/ ) with patch PREEMP_RT 5.15.10-rt24 ( github.com/kdoren/linux/releases ).
However, probably because the version of PREEMPT_RT is a pre-release, the latency results have not been satisfactory, despite the fact that both WiFi and Bluetooth have been disabled, modifying the /boot/config file.txt
So I tried to use the 64-bit version of Ubuntu for Raspberry with the patch PREEMP_RT 5.15.10-rt24, installing a recent version of LinuxCNC 2.9.0~pre0.0 for ARM64.
Early latency tests give results that look better than RaspiOS, on both the Raspberry Pi 4 at 2Gb and 4Gb. However, I believe that this version should also work on 8GB models than on the Raspberry Pi 400.
In summary, at this link ( drive.google.com/file/d/19APzS3-s_BPFC1S...d9r/view?usp=sharing ) you can download an image to upload to the SD card (for example with Raspberry Pi Imager), configured as follows:
Board: Raspberry Pi4 tested on 2GB and 4Gb
OS: Ubuntu 21.10 64 bit ARM4 ( ubuntu.com/download/raspberry-pi )
Preempt RT: 5.15.10-rt24 ( github.com/kdoren/linux/releases ).
User: ubuntu
Pwd: ubuntu64
LinuxCNC: 2.9.0~pre0_arm64 deb files -> ( drive.google.com/file/d/1-RWQ3Apy71xg9nQ...Irg/view?usp=sharing )
I also added the 'rpi-gpio' command to facilitate configuration when using the standard version of the hal_pi_gpio.
( forum.linuxcnc.org/18-computer/43353-rpi...tion?start=10#226664 )
In this regard, following the invitation of virencq
( forum.linuxcnc.org/9-installing-linuxcnc...lem?start=120#229102 )
I prepared the new version of hal_pi_gpio of tjtr33
forum.linuxcnc.org/18-computer/36879-ras...map?start=480#203601
I checked the operation of both versions, driving two servomotors via PyVCP, as reported here
( forum.linuxcnc.org/38-general-linuxcnc-q...aspberry-pi-4#222291 )
The attached files are already present in the linuxcnc folder of the aforementioned image.
This test uses two PWM output signals on the Raspberry 33 and 35 pins.
So to use the old version, using the command 'rpi-gpio', I generated the corresponding command line
"loadrt hal_pi_gpio dir=133120 exclude=66975743"
The test run with the command "halrun -I -f servopwm_old.hal"
To use the new version, you must first run the
"sudo cp /usr/lib/linuxcnc/modules/hal_pi_gpio_new.so /usr/lib/linuxcnc/modules/hal_pi_gpio.so"
and then edit the file 'servopwm_old.hal', saving it as 'servopwm_new.hal',
using the following line
"loadrt hal_pi_gpio pi_pins={33,>,0,Y}{35,>,0,Y}"
To activate the test, the command will be this time: "halrun -I -f servopwm_new.hal"
To return to the old version of hal_pi_gpio you must reactivate the old file with the
"sudo cp /usr/lib/linuxcnc/modules/hal_pi_gpio_old.so /usr/lib/linuxcnc/modules/hal_pi_gpio.so"
Taking advantage of the end-of-year holidays and the forced lockdown due to COVID, taking into account the availability of a new version of PREEMPT_RT, I updated the 64-bit image for Raspberry 4B ( downloads.raspberrypi.org/raspios_arm64/...os_arm64-2021-11-08/ ) with patch PREEMP_RT 5.15.10-rt24 ( github.com/kdoren/linux/releases ).
However, probably because the version of PREEMPT_RT is a pre-release, the latency results have not been satisfactory, despite the fact that both WiFi and Bluetooth have been disabled, modifying the /boot/config file.txt
So I tried to use the 64-bit version of Ubuntu for Raspberry with the patch PREEMP_RT 5.15.10-rt24, installing a recent version of LinuxCNC 2.9.0~pre0.0 for ARM64.
Early latency tests give results that look better than RaspiOS, on both the Raspberry Pi 4 at 2Gb and 4Gb. However, I believe that this version should also work on 8GB models than on the Raspberry Pi 400.
In summary, at this link ( drive.google.com/file/d/19APzS3-s_BPFC1S...d9r/view?usp=sharing ) you can download an image to upload to the SD card (for example with Raspberry Pi Imager), configured as follows:
Board: Raspberry Pi4 tested on 2GB and 4Gb
OS: Ubuntu 21.10 64 bit ARM4 ( ubuntu.com/download/raspberry-pi )
Preempt RT: 5.15.10-rt24 ( github.com/kdoren/linux/releases ).
User: ubuntu
Pwd: ubuntu64
LinuxCNC: 2.9.0~pre0_arm64 deb files -> ( drive.google.com/file/d/1-RWQ3Apy71xg9nQ...Irg/view?usp=sharing )
I also added the 'rpi-gpio' command to facilitate configuration when using the standard version of the hal_pi_gpio.
( forum.linuxcnc.org/18-computer/43353-rpi...tion?start=10#226664 )
In this regard, following the invitation of virencq
( forum.linuxcnc.org/9-installing-linuxcnc...lem?start=120#229102 )
I prepared the new version of hal_pi_gpio of tjtr33
forum.linuxcnc.org/18-computer/36879-ras...map?start=480#203601
I checked the operation of both versions, driving two servomotors via PyVCP, as reported here
( forum.linuxcnc.org/38-general-linuxcnc-q...aspberry-pi-4#222291 )
The attached files are already present in the linuxcnc folder of the aforementioned image.
This test uses two PWM output signals on the Raspberry 33 and 35 pins.
So to use the old version, using the command 'rpi-gpio', I generated the corresponding command line
"loadrt hal_pi_gpio dir=133120 exclude=66975743"
The test run with the command "halrun -I -f servopwm_old.hal"
To use the new version, you must first run the
"sudo cp /usr/lib/linuxcnc/modules/hal_pi_gpio_new.so /usr/lib/linuxcnc/modules/hal_pi_gpio.so"
and then edit the file 'servopwm_old.hal', saving it as 'servopwm_new.hal',
using the following line
"loadrt hal_pi_gpio pi_pins={33,>,0,Y}{35,>,0,Y}"
To activate the test, the command will be this time: "halrun -I -f servopwm_new.hal"
To return to the old version of hal_pi_gpio you must reactivate the old file with the
"sudo cp /usr/lib/linuxcnc/modules/hal_pi_gpio_old.so /usr/lib/linuxcnc/modules/hal_pi_gpio.so"
Please Log in or Create an account to join the conversation.
04 Jan 2022 09:14 #230734
by Eyecon
Replied by Eyecon on topic Raspberry PI4, Ubuntu 64 bit & LinuxCNC
I've been using your 2.8.2 image over the past couple of months and like you said, tried everything to get stable and low servo thread latency results with no luck. I was just about to post a question when I found this! post...I will definitely try this image tomorrow on my RP4 8GB model and report back.
I've using a mesa 7i76 with isolcpus=1,2,3 and barely able to get consistent performance with servo periods upwards of 1.3ms which cause my steppers to sound very strange and not run smoothly. Even with that I still get the occasional warning that a task exceeded the servo period. With a single core essentially running the non-realtime tasks, the experience of using the UI is really bad as well!
Thanks again for taking the time to work on this!!
I've using a mesa 7i76 with isolcpus=1,2,3 and barely able to get consistent performance with servo periods upwards of 1.3ms which cause my steppers to sound very strange and not run smoothly. Even with that I still get the occasional warning that a task exceeded the servo period. With a single core essentially running the non-realtime tasks, the experience of using the UI is really bad as well!
Thanks again for taking the time to work on this!!
The following user(s) said Thank You: elovalvo
Please Log in or Create an account to join the conversation.
02 Feb 2022 22:40 #233842
by gta18
Replied by gta18 on topic Raspberry PI4, Ubuntu 64 bit & LinuxCNC
Hi,
Sorry for the newbie question. But I can't seem to get the eth0 to connect to my 7i97.
I was using the RPI4 x64 older version w/ LinuxCNC 2.8 that you have previously posted and was able to configure and connect to the 7i97.
Now on this Ubuntu version, I configured the ethernet port thru the advanced settings and the Wired Network Icon is just showing disconnected.
I also did check using xterm ip a command and saw that eth0 gets UP and Down when I connect and disconnect the ethernet cable, but the Static IP address is not showing up on eth0.
Wifi works. not sure where the internet browser on Ubuntu or if there is one?
Thanks!
Sorry for the newbie question. But I can't seem to get the eth0 to connect to my 7i97.
I was using the RPI4 x64 older version w/ LinuxCNC 2.8 that you have previously posted and was able to configure and connect to the 7i97.
Now on this Ubuntu version, I configured the ethernet port thru the advanced settings and the Wired Network Icon is just showing disconnected.
I also did check using xterm ip a command and saw that eth0 gets UP and Down when I connect and disconnect the ethernet cable, but the Static IP address is not showing up on eth0.
Wifi works. not sure where the internet browser on Ubuntu or if there is one?
Thanks!
Please Log in or Create an account to join the conversation.
03 Feb 2022 17:48 #233895
by gta18
Replied by gta18 on topic Raspberry PI4, Ubuntu 64 bit & LinuxCNC
BTW, I got it running and thank you for taking the time to post this for RPI4. Total newbie here when it comes to LINUX.
I got my setup reading the SINCOS encoder thru an EXE650 linearizer going to the Mesa 7i97 board.
I got my setup reading the SINCOS encoder thru an EXE650 linearizer going to the Mesa 7i97 board.
Please Log in or Create an account to join the conversation.
03 Feb 2022 18:22 #233898
by PCW
You need something like this is the hal file to enable and setup the DPLL:
setp hm2_7i76e.0.dpll.01.timer-us -200
setp hm2_7i76e.0.stepgen.timer-number 1
Replied by PCW on topic Raspberry PI4, Ubuntu 64 bit & LinuxCNC
Sounds like you do not have the DPLL enabled or setup properlyI've been using your 2.8.2 image over the past couple of months and like you said, tried everything to get stable and low servo thread latency results with no luck. I was just about to post a question when I found this! post...I will definitely try this image tomorrow on my RP4 8GB model and report back.
I've using a mesa 7i76 with isolcpus=1,2,3 and barely able to get consistent performance with servo periods upwards of 1.3ms which cause my steppers to sound very strange and not run smoothly. Even with that I still get the occasional warning that a task exceeded the servo period. With a single core essentially running the non-realtime tasks, the experience of using the UI is really bad as well!
Thanks again for taking the time to work on this!!
You need something like this is the hal file to enable and setup the DPLL:
setp hm2_7i76e.0.dpll.01.timer-us -200
setp hm2_7i76e.0.stepgen.timer-number 1
Please Log in or Create an account to join the conversation.
03 Feb 2022 18:38 - 03 Feb 2022 18:46 #233899
by gta18
Replied by gta18 on topic Raspberry PI4, Ubuntu 64 bit & LinuxCNC
deleted...
Last edit: 03 Feb 2022 18:46 by gta18. Reason: wrong reply
Please Log in or Create an account to join the conversation.
- sophiaabigail
- Offline
- Banned
Less
More
- Posts: 1
- Thank you received: 0
12 Feb 2022 06:01 - 12 Feb 2022 08:42 #234626
by sophiaabigail
Replied by sophiaabigail on topic Raspberry PI4, Ubuntu 64 bit & LinuxCNC
This post describes how to install a 64-bit kernel <<<LINK REMOVED>>> based on Ubuntu and build LinuxCNC to suit on the Raspberry Pi 4.
If you do not already have a Linux system, then you can install Ubuntu Linux and LinuxCNC at the same time
A LinuxCNC setup on your Raspberry Pi requires the following: A Raspberry Pi 4 (8 GB RAM recommended) MicroSD card of 8 GB or greater. A Windows, Mac, or Linux computer to flash the LinuxCNC operating system onto the microSD card.
If you do not already have a Linux system, then you can install Ubuntu Linux and LinuxCNC at the same time
A LinuxCNC setup on your Raspberry Pi requires the following: A Raspberry Pi 4 (8 GB RAM recommended) MicroSD card of 8 GB or greater. A Windows, Mac, or Linux computer to flash the LinuxCNC operating system onto the microSD card.
Last edit: 12 Feb 2022 08:42 by tommylight. Reason: Removed link
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19188
- Thank you received: 6432
12 Feb 2022 08:43 #234632
by tommylight
Replied by tommylight on topic Raspberry PI4, Ubuntu 64 bit & LinuxCNC
The above post has been edited and the suspicious link was removed, it's content is a copy paste form here:
forum.linuxcnc.org/9-installing-linuxcnc...bian-64-bit-linuxcnc
forum.linuxcnc.org/9-installing-linuxcnc...bian-64-bit-linuxcnc
The following user(s) said Thank You: elovalvo
Please Log in or Create an account to join the conversation.
10 Jun 2022 09:19 - 10 Jun 2022 09:22 #244851
by prochj51
Replied by prochj51 on topic Raspberry PI4, Ubuntu 64 bit & LinuxCNC
Thank you for your work Elovalvo.
It seems that your link for SD image is just for view, not for download. At least I am not able to download it.
It seems that your link for SD image is just for view, not for download. At least I am not able to download it.
Last edit: 10 Jun 2022 09:22 by prochj51.
Please Log in or Create an account to join the conversation.
10 Jun 2022 13:52 #244870
by elovalvo
You are right. I rearranged everything.
However, an update of the preempt_rt (5.15.40-rt43) is available at this link :
github.com/kdoren/linux/releases
Replied by elovalvo on topic Raspberry PI4, Ubuntu 64 bit & LinuxCNC
Thank you for your work Elovalvo.
It seems that your link for SD image is just for view, not for download. At least I am not able to download it.
You are right. I rearranged everything.
However, an update of the preempt_rt (5.15.40-rt43) is available at this link :
github.com/kdoren/linux/releases
Please Log in or Create an account to join the conversation.
Time to create page: 0.087 seconds