Page 41 of 41

Re: LinuxCNC

Posted: Thu Aug 18, 2016 7:52 pm
by VikTan
Hi kinsa,

I would like to ask again, do you have an img. file for updated Machinekit installation based on Raspbian Jessie? I made one based on your steps but I still have a problems also on RasPi2. I had to make any mistake. Can you help with it?

Thanks, Viktor

Re: LinuxCNC

Posted: Wed Sep 28, 2016 7:24 am
by jbjalling
What is the status of the V3 picnc board? Can it be used, or is the recommended board rev. 2?
I think the V3 offers some interesting features (like 200khz stepping, and mounting it on top of the RPi).

BR Jonas

Re: LinuxCNC

Posted: Tue Oct 04, 2016 11:30 am
by AsaltedPnut
Hi Guys

I have a very challanging request:

I have a 5 axis cnc machine at college, it has been redused to manual only as I think its the software behind it. I have tested all the diffrent axis, all seem fine, but machine does not HOME or run a G code program.
It is currently running from the standard built in pc (running windows CE). (More or less similar to Pi 3 Specs)

Ive tried finding the fault, but looks like only way to get new software is to go to the origional manufacturer, and thats going to cost a fortune.

Do you guys think it would be possible to switch out the pc for a Rasberry Pi & run your linuxcnc software?

Here are some of the Specs & info of the machine: (Excuse the mess, College never stops :roll: )

Re: LinuxCNC

Posted: Tue Oct 04, 2016 12:02 pm
by kinsa
I would suggest that you try linuxcnc running on a PC first.

I don't know what hardware you have, maybe it can be directly used under linuxcnc. Otherwise, if you want to make use of all the axis then you'll need to use the fpga based cards such as those provided by Mesa.

Another thing to consider is that you'll get more support if you use standard installation of linuxcnc.

Re: LinuxCNC

Posted: Tue Oct 04, 2016 12:26 pm
by AsaltedPnut
Thanks for the speedy reply, I will have to investigate further, but think the raspberry is really capable of controlling the cnc machine. But as you said I might require some new hardware, or change current hardware.

Re: LinuxCNC

Posted: Thu Nov 10, 2016 4:13 pm
by er85
Hi, my plasma cutter is pretty much up and ready to run now but some serious noise issues are keeping me back.
As soon as the torch lights up PICnc is reset (have to close Axis to turn off the torch too) and it looks like everything is triggered, joint follow errors and so on. Cables for home switches and motors have braided shields grounded on one side only (inside the cabinet).

Would you think making a simple cape for PICnc with optocouplers on all inputs could help? Or should I buy an expensive breakout board? Any other suggestions?


Re: LinuxCNC

Posted: Thu Nov 10, 2016 4:54 pm
by Wire
Disconnect the cables from the machine to the controller and strike the torch and see if the reset goes away.

If so the noise is getting picked up on the cables. You can start plugging them in one at a time and see which one is adding the sensitivity and depending on what they do the solution varies.

If the PIC resets with the cables disconnected the sensitivity is on the PCB, power supply, or Cabling back to the monitor, network ect.

How / where do you have the PICnc mounted with respect to the plasma cutter? Is it in a metal grounded box?

Re: LinuxCNC

Posted: Thu Nov 10, 2016 6:10 pm
by er85
I tried that now and even when I disconnect the LPT-cable completely it resets which probably points to something with the power supply then maybe? The strange thing is that the RPi2 is perfectly fine.. never rebooted or anything.

Looks like a mess right now but here's the cabinet and machine:
IMG_20161110_183819335_crop2.jpg (58.44 KiB) Viewed 6457 times
IMG_20161110_183641564_crop2.jpg (62.84 KiB) Viewed 6457 times

Re: LinuxCNC

Posted: Thu Nov 10, 2016 8:01 pm
by Wire
Wondering if the wires between the Pi and the PICnc are picking up noise and causing issues. Try wrapping them all in foil and connect it to ground on the Pi. Try that with the PLL port unplugged. Also check the reset pin into the PIC and make sure it is not floating.

Re: LinuxCNC

Posted: Fri Nov 11, 2016 9:24 am
by er85
I tried that with no success. I also tried taking out the Pi and PICnc from the cabinet, disconnect the printer cable, HDMI, relay board and run through Xming on my laptop but it still resets.. I guess next I'll have to try putting them in a metal box connected to earth and maybe a better 5V source.

I also noticed if I kept the printer cable connected to the driver board and just hanging free in the other end the motors will still move when I trigger the plasma. If I disconnect the cable completely they don't... so I guess there's a lot of RF inside the cabinet.

Re: LinuxCNC

Posted: Fri Nov 11, 2016 1:49 pm
by Wire
Floating terminated nets will act like antennas and a plasma cutter will act like a broad spectrum spark gap transmitter. So the fact they jump around when not plugged into anything is not unexpected.

On the PICnc end try adding a large electrolytic capacitor to the power rails. That should help if the noise is coming in there.

Re: LinuxCNC

Posted: Fri Nov 11, 2016 9:46 pm
by er85
It feels like I've tried everything I can with what I have right now. I made a simple LC-filter (100µH / 470µC) for the Pi and PICnc and also put a cap on the PICnc supply pins. Then I put everything inside a computer case, but no improvements.
Maybe I'll have to start looking at using a PC for this machine.

Re: LinuxCNC

Posted: Wed Aug 09, 2017 2:44 pm
by devilmind
Hello guys,
I'm trying to install machinekit on RPi3 and to use GPIO to control my machine.
I'm using Rpi3 model B and I have installed raspian-jessie as distribution.
I have followed the illustrated procedure and steps but after installation I got some issues.
The makinekit software seems is installed fine and my latency is 37452 so seems acceptable.
I cannot start a my-mill configuration due hal.parport.8 or pin issue and only the machinekit examples are starting well for the simulation.
The one point that is blocking me is on the following:

1) I want to use the gpio to test a sample configuration but when I try to compile hal_gpio.c file I obtain:

a. [email protected]:~# comp --compile hal_gpio.c
Traceback (most recent call last):
File "/usr/bin/comp", line 26, in <module>
from yapps import runtime
ImportError: No module named yapps
[email protected]:~#

b. [email protected]:~# gcc hal_gpio.c
hal_gpio.c:20:48: fatal error: rtapi.h: File o directory non esistente
#include "rtapi.h" /* RTAPI realtime OS API */
compilation terminated.
[email protected]:~#

Can you help me please? I'm stucked here.
Any suggestion on how to solve my issue in order to work with GPIO will be very appreciated.
Thanks in advance.


Re: LinuxCNC

Posted: Fri Oct 06, 2017 2:07 pm
by Fieldy
Dear Kinsa,

I have a short question: We have a Haase CUT2500L [1] CnC machine in our lab. This machine has a parallel port interface for controlling.
Currently it is connected to a very old desktop PC with an on-board LPT port and controlled via LinuxCnC. Unfortunately the PC died recently and now we are searching for a replacement. With USB-Adapters it is not possible to let more than one motor drive simultaneously, so they do not work for us.

I'm wondering if your PICnc board in combination with a Pi3 could work for our machine.

jbjalling mentioned (on Sep28, 2016) a version 3 of your board, which should be directly mountable on the Pi. Is this version available? I could not find it on github.

Best regards,

[1] (german)

Re: LinuxCNC

Posted: Fri Nov 03, 2017 5:47 am
by TadyTheFish
Do your preliminary steps still work? I got an error when installing machinekit-dev

Thank you

P.S. when I run

Code: Select all

sudo comp --compile picnc.c
i get an error sh: 1: make: not found

Re: LinuxCNC

Posted: Thu Nov 16, 2017 6:40 pm
by TadyTheFish
Is this thread totaly dead?

Re: LinuxCNC

Posted: Thu Feb 01, 2018 11:23 am
by LittleBird
Hello i have been following this guide to install MachineKit on Raspberry pi3 model B. :)
but when i try to execute ''apt-get install -y machinekit-dev machinekit-rt-preempt'' this happens E: Package 'machinekit-dev' has no installation candidate.

[email protected]:~# apt-get install -y machinekit-dev machinekit-rt-preempt
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package machinekit-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'machinekit-dev' has no installation candidate

Re: LinuxCNC

Posted: Thu Feb 01, 2018 8:09 pm
by MrGreg
It's all a little out of date.... The following should work OK

Take a look here for the Machinekit and RT inatall ... -packages/

Also read through the "For Starters" links on the left of the page for more general background info.
Also FYI... There isn't an out of the box working solution for Stretch. I suggest you go for the Jessie version which works.
Also There is no particular need to use Miniban unless you have an RPIv1 and want to conserve resources. Works OK on a std install on the RPIv2.
Just about works on an RPIv1 but the GUI is V slow and notchy.
Note::: You will be wanting to use the the "Jessie" armhf in the machinekit repos.. ! Eg ... -raspbian/

The Machinekit driver for Picnc and firmware etc are still in kinsa's GIT repo here

Read through the wiki for all info related to the Picnc.

I think that about covers the current details to get it all running

Re: LinuxCNC

Posted: Thu Aug 16, 2018 3:54 pm
by tomp3
Hello MrGreg
Sorry if this is off topic.
I cannot get _any_ gpio pins to work as inputs using hal_gpio.
I can get _all_ 26 pins to work as outputs.

I can get _all_26 pins to work as inputs using the python module RPi.GPIO
I can get _all_ 26 pins to work as inputs with the bcm2835 C examples ( programname 'gpio' )

I have duplicated this on 3 different 'builds' of raspian jessie rt-preempt.
on an rpi3B+
(i say 'builds' becasue it actually just putting pieces together using apt-get dpkg etc )

Can someone please confirm that inputs are possible using hal_gpio ?
And give me a small hal code that shows it to work?

My hal code
# run with halrun -I nameofthisfile,hal

# this line should make all pin available and all pins inputs
# show pin hal_gpio.* agrees that all pins were created and all are named 'hal_gpio.
loadrt hal_gpio exclude=0 dir=0

newthread fast 100000
newthread slow 1000000 fp

#loadusr halmeter

addf hal_gpio.write fast


the output of show pin hal_gpio.*

Component Pins:
Comp Inst Type Dir Value Name Epsilon Flags linked to:
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 bit OUT FALSE --l-
78 s32 OUT 0 ----
78 s32 I/O 0 ----
78 bit OUT FALSE ----
78 s32 OUT 1459 hal_gpio.write.time ----
78 s32 I/O 11250 hal_gpio.write.tmax ----
78 bit OUT FALSE hal_gpio.write.tmax-inc ----

Please, I've wasted days building these images just to have 10 seconds of testing tell me inputs just dont work with hal_gpio.
The examples at machinekit are all output, and that works fine.
I cant believe that the crew didnt notice that ALL inputs were broken
but I also cant see any notice being jumpered to +3.3V pin 1 !!!

remember all pins work with same hdwr on same rpi under same kernel when the python or compiled C pgms are used.


Re: LinuxCNC

Posted: Fri Aug 17, 2018 1:57 am
by tomp3
MRGREG et al
re: hal_gpio inputs not working

Sorry, my fault, I had not done

Code: Select all

addf threadname
with that change, the inputs work

there are so few demos of raspi hal_gpio in the web
that i didnt see an input example until
this morning ... LUEBOT.hal
whei scanned the file i saw the addf
and screamed
DOH! that answers the mystery where other toolkits worked but hal_gpio did not.
sorry, mea culpa

Re: Machinekit Raspbian Jessie for RPi1 and RPi2

Posted: Wed Oct 10, 2018 4:47 am
by ziaaan
kinsa wrote:
Sat Mar 05, 2016 2:02 pm
Here are the preliminary steps to create an updated Machinekit installation based on Raspbian Jessie for RPi v1 and v2:
  • Download and install MINIBIAN
    The default un/pw is root/raspberry
  • Install raspi-config

    Code: Select all

    apt-get update
    apt-get install -y raspi-config raspberrypi-bootloader
  • Configure RPi

    Code: Select all

    • Expand Filesystem
    • Overclock
    • reboot to apply changes
  • Add Machinekit repo:

    Code: Select all

    apt-key adv --keyserver hkp:// --recv-key 43DDF224
    echo "deb raspbian main" > /etc/apt/sources.list.d/machinekit.list
    apt-get update
  • Install RT-PREEMPT kernel
    • RPi1

      Code: Select all

      apt-get install -y linux-image-rpi-rt
    • RPi2

      Code: Select all

      apt-get install -y linux-image-rpi2-rt
  • Update /boot/config.txt to use the new kernel
    • RPi1

      Code: Select all

      cd /boot
      echo kernel=$(ls kernel_rt*.img) >> config.txt
      echo device_tree=dtbs_rt/bcm2708-rpi-b-plus.dtb >> config.txt
      Use the corect dtb file for your board.
    • RPi2

      Code: Select all

      cd /boot
      echo kernel=$(ls kernel_rt*.img) >> config.txt
      echo device_tree=dtbs_rt/bcm2709-rpi-2-b.dtb >> config.txt
    Sample /boot/config.txt for RPi2

    Code: Select all

    [email protected]:~# cat /boot/config.txt
    device_tree= dtbs_rt/bcm2709-rpi-2-b.dtb
  • Add the following parameters to /boot/cmdline.txt

    Code: Select all

    dwc_otg.fiq_enable=0 dwc_otg.fiq_fsm_enable=0 dwc_otg.nak_holdoff=0
    Sample /boot/cmdline.txt

    Code: Select all

    [email protected]:~# cat /boot/cmdline.txt
    dwc_otg.fiq_enable=0 dwc_otg.fiq_fsm_enable=0 dwc_otg.nak_holdoff=0 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 elevator=deadline root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
  • Install Machinekit

    Code: Select all

    apt-get install -y machinekit-dev machinekit-rt-preempt
  • Install PICnc-v2 driver

    Code: Select all

    cd ~/
    comp --compile picnc.c
    sudo cp /usr/lib/linuxcnc/rt-preempt
  • Install your favorite DE

    Code: Select all

    apt-get install lxde
    Replace lxde with whatever suits your fancy ;-)
  • Add Machinekit user

    Code: Select all

    adduser mk
  • Reboot

    Code: Select all

MINIBIAN was chosen to keep the installation size small. Standard raspbian image can also be used, just omit the DE installation step.

The rt-preempt kernels are still considered beta, tests are needed to see if this is suitable for Machinekit.

updates: Added RPi2 kernel
is that method still work on raspbian stretch?

Re: LinuxCNC

Posted: Wed Oct 10, 2018 7:01 pm
by MrGreg
Errrr... No

Those instructions were for Raspbian Jessie only and are now rather outdated.
Raspbian Jessie is still useable. I am still running Jessie on my cnc setup, although it is for cnc only and not for general use, eg anything to do with the www or other activities likely to comprimise security.

See here for Machinekit instructions ... -packages/
Scroll down to near the bottom for RPI
Machinekit do not supply a single up to date realtime kernel for Stretch (arm version) You will need to choose one from their repo ( There are 1000s ! )
You could try this

The above links to an image of Raspbian Lite Stretch with realtime kernel.So no need to use Miniban.
I have not tested it as yet with Machinekit or Kinsa's Picnc. I hope to do this in the comming weeks, I will post here if I have a sucessful outcome.
It "Should" work ?
You could try asking on the Linuxcnc forum.

Good luck
& post back your findings