VikTan
Posts: 11
Joined: Wed Nov 11, 2015 2:36 pm
Location: Bratislava

Re: LinuxCNC

Thu Aug 18, 2016 7:52 pm

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

jbjalling
Posts: 1
Joined: Wed Sep 28, 2016 7:16 am

Re: LinuxCNC

Wed Sep 28, 2016 7:24 am

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

AsaltedPnut
Posts: 8
Joined: Fri Jul 22, 2016 3:46 pm

Re: LinuxCNC

Tue Oct 04, 2016 11:30 am

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: )
Attachments
IMG_20161004_115326(1)__1475580456_154.115.9.34.jpg
IMG_20161004_115326(1)__1475580456_154.115.9.34.jpg (9.72 KiB) Viewed 6936 times
IMG_20161004_115318__1475580409_154.115.9.34.jpg
IMG_20161004_115318__1475580409_154.115.9.34.jpg (19.9 KiB) Viewed 6936 times
IMG_20161004_115259__1475580357_154.115.9.34.jpg
IMG_20161004_115259__1475580357_154.115.9.34.jpg (18.56 KiB) Viewed 6936 times
Last edited by AsaltedPnut on Tue Oct 04, 2016 12:23 pm, edited 1 time in total.

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Tue Oct 04, 2016 12:02 pm

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.
42

AsaltedPnut
Posts: 8
Joined: Fri Jul 22, 2016 3:46 pm

Re: LinuxCNC

Tue Oct 04, 2016 12:26 pm

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.

er85
Posts: 8
Joined: Fri May 15, 2015 3:29 pm

Re: LinuxCNC

Thu Nov 10, 2016 4:13 pm

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?

Thanks,
Erik

Wire
Posts: 78
Joined: Tue Sep 11, 2012 6:46 pm

Re: LinuxCNC

Thu Nov 10, 2016 4:54 pm

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?

er85
Posts: 8
Joined: Fri May 15, 2015 3:29 pm

Re: LinuxCNC

Thu Nov 10, 2016 6:10 pm

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
IMG_20161110_183819335_crop2.jpg (58.44 KiB) Viewed 6462 times
IMG_20161110_183641564_crop2.jpg
IMG_20161110_183641564_crop2.jpg (62.84 KiB) Viewed 6462 times

Wire
Posts: 78
Joined: Tue Sep 11, 2012 6:46 pm

Re: LinuxCNC

Thu Nov 10, 2016 8:01 pm

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.

er85
Posts: 8
Joined: Fri May 15, 2015 3:29 pm

Re: LinuxCNC

Fri Nov 11, 2016 9:24 am

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.

Wire
Posts: 78
Joined: Tue Sep 11, 2012 6:46 pm

Re: LinuxCNC

Fri Nov 11, 2016 1:49 pm

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.

er85
Posts: 8
Joined: Fri May 15, 2015 3:29 pm

Re: LinuxCNC

Fri Nov 11, 2016 9:46 pm

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.

devilmind
Posts: 2
Joined: Wed Aug 09, 2017 2:30 pm

Re: LinuxCNC

Wed Aug 09, 2017 2:44 pm

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.

Antonio

Fieldy
Posts: 16
Joined: Tue Jun 05, 2012 9:52 am

Re: LinuxCNC

Fri Oct 06, 2017 2:07 pm

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,
Florian


[1] https://www.team-haase.de/cut2500/ (german)

TadyTheFish
Posts: 3
Joined: Fri Nov 03, 2017 5:43 am

Re: LinuxCNC

Fri Nov 03, 2017 5:47 am

Kinsa
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

TadyTheFish
Posts: 3
Joined: Fri Nov 03, 2017 5:43 am

Re: LinuxCNC

Thu Nov 16, 2017 6:40 pm

Is this thread totaly dead?

LittleBird
Posts: 1
Joined: Thu Feb 01, 2018 11:14 am

Re: LinuxCNC

Thu Feb 01, 2018 11:23 am

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

MrGreg
Posts: 66
Joined: Sun Jun 10, 2012 7:25 pm

Re: LinuxCNC

Thu Feb 01, 2018 8:09 pm

It's all a little out of date.... The following should work OK

Take a look here for the Machinekit and RT inatall
http://www.machinekit.io/docs/getting-s ... -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
http://www.machinekit.io/docs/getting-s ... -raspbian/

The Machinekit driver for Picnc and firmware etc are still in kinsa's GIT repo here
https://github.com/kinsamanka/PICnc-V2/wiki

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

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

tomp3
Posts: 2
Joined: Thu Aug 16, 2018 3:29 pm

Re: LinuxCNC

Thu Aug 16, 2018 3:54 pm

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

start
------------------------

the output of show pin hal_gpio.*

Component Pins:
Comp Inst Type Dir Value Name Epsilon Flags linked to:
78 bit OUT FALSE hal_gpio.pin-03-in --l-
78 bit OUT FALSE hal_gpio.pin-05-in --l-
78 bit OUT FALSE hal_gpio.pin-07-in --l-
78 bit OUT FALSE hal_gpio.pin-08-in --l-
78 bit OUT FALSE hal_gpio.pin-10-in --l-
78 bit OUT FALSE hal_gpio.pin-11-in --l-
78 bit OUT FALSE hal_gpio.pin-12-in --l-
78 bit OUT FALSE hal_gpio.pin-13-in --l-
78 bit OUT FALSE hal_gpio.pin-15-in --l-
78 bit OUT FALSE hal_gpio.pin-16-in --l-
78 bit OUT FALSE hal_gpio.pin-18-in --l-
78 bit OUT FALSE hal_gpio.pin-19-in --l-
78 bit OUT FALSE hal_gpio.pin-21-in --l-
78 bit OUT FALSE hal_gpio.pin-22-in --l-
78 bit OUT FALSE hal_gpio.pin-23-in --l-
78 bit OUT FALSE hal_gpio.pin-24-in --l-
78 bit OUT FALSE hal_gpio.pin-26-in --l-
78 bit OUT FALSE hal_gpio.pin-29-in --l-
78 bit OUT FALSE hal_gpio.pin-31-in --l-
78 bit OUT FALSE hal_gpio.pin-32-in --l-
78 bit OUT FALSE hal_gpio.pin-33-in --l-
78 bit OUT FALSE hal_gpio.pin-35-in --l-
78 bit OUT FALSE hal_gpio.pin-36-in --l-
78 bit OUT FALSE hal_gpio.pin-37-in --l-
78 bit OUT FALSE hal_gpio.pin-38-in --l-
78 bit OUT FALSE hal_gpio.pin-40-in --l-
78 s32 OUT 0 hal_gpio.read.time ----
78 s32 I/O 0 hal_gpio.read.tmax ----
78 bit OUT FALSE hal_gpio.read.tmax-inc ----
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.

helllp!
tomp3

tomp3
Posts: 2
Joined: Thu Aug 16, 2018 3:29 pm

Re: LinuxCNC

Fri Aug 17, 2018 1:57 am

MRGREG et al
re: hal_gpio inputs not working

Sorry, my fault, I had not done

Code: Select all

addf hal_gpio.read 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
https://github.com/JSBattista/SampleHAL ... LUEBOT.hal
whei scanned the file i saw the addf hal_gpio.read
and screamed
DOH! that answers the mystery where other toolkits worked but hal_gpio did not.
sorry, mea culpa
tomp3

ziaaan
Posts: 2
Joined: Tue Sep 25, 2018 2:17 pm

Re: Machinekit Raspbian Jessie for RPi1 and RPi2

Wed Oct 10, 2018 4:47 am

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

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

    Code: Select all

    apt-key adv --keyserver hkp://keys.gnupg.net --recv-key 43DDF224
    echo "deb http://deb.machinekit.io/debian 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
    gpu_mem=16
    arm_freq=1000
    core_freq=500
    sdram_freq=500
    over_voltage=2
    kernel=kernel-4.4.3-rt9-v7+.img
    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 fsck.repair=yes rootwait
  • Install Machinekit

    Code: Select all

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

    Code: Select all

    cd ~/
    wget https://github.com/kinsamanka/PICnc-V2/raw/master/HAL/picnc.{c,h}
    comp --compile picnc.c
    sudo cp picnc.so /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

    reboot
Note:
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?

MrGreg
Posts: 66
Joined: Sun Jun 10, 2012 7:25 pm

Re: LinuxCNC

Wed Oct 10, 2018 7:01 pm

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

http://www.machinekit.io/docs/getting-s ... -packages/
Scroll down to near the bottom for RPI
Note:
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 ! )
Or
You could try this

https://github.com/guysoft/RealtimePi

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

Return to “Automation, sensing and robotics”