rubienr / bbb-linuxcnc-config

Yet another Linuxcnc Configuration
Apache License 2.0
5 stars 1 forks source link

Introduction

A Linuxcnc configuration using the Panther cape (Necitec). Since this configuration relys on a new(er than Necitec's supported) Machinekit/Debian version, this notes also leave some hints on how to install the Debian image and compile Machinekit on the BBB.

Usage: Checkout the reposigory and start machinekit with the correct arguments, i.e.:

machinekit@beaglebone:~$ machinekit <repository-clone>/machinekit/configs/ARM.BeagleBone.Panther/Panther-3-axis.ini

Create Debian Image

  1. For creating a bare debian image follow this steps.

  2. Flash the eMMC contents back to the micro-SD card Insert a micro-SD into your BBB and run:

    sudo /opt/scripts/tools/eMMC/beaglebone-black-make-microSD-flasher-from-eMMC.sh
  3. Use/modify this uEnv.txt template.

  4. install and setup machinekit-deban-stretch image

  5. setup lightdm/xfce

  6. setup autologin

  7. Setup the Necitec Panther cape: The Panther overlay must be copied from the necitec provided image to our debian image on the BBB, otherwise this will fail. Optional use this files, or the compile and install script.

Manula way:

# optionally compile the source
sudo dtc -O dtb -o /lib/firmware/panther-00A0.dtbo -b 0 -@ /home/machinekit/machinekit/configs/ARM.BeagleBone.Panther/panther-00A0.dts

# copy the compiled file to the debian
/lib/firmware/panther-00A0.dtbo 

# optionally add the overlay to /boot/uEnv.txt
uboot_overlay_addr4=/lib/firmware/panther-00A0.dtbo

References

Compilation HowTo

Compile Machinekit

Using BBB and swap Device

  1. compile on BBB as far as possible (Machinekit Developer Howto)

    1. install prerequisites

    2. configure

    3. make

    4. run machinekit

Using BBB Without swap Device

Since the compiling process requires more RAM memory as provided by the BBB, it cannot be completed using the BBB only. In this case we mount the build folder from the BBB via sshfs to a changeroot on a diffrerent machine.

This rules fail to compile on bbb:

Note: An alternative is to swap on MicroSD (if available), which works fine.

The basic steps in a nutshell:

  1. compile on BBB as far as possible (Machinekit Developer Howto)

    1. install prerequisites

    2. configure

    3. make

  2. compile the rest in a changeroot

    1. download debian ARM image and changeroot as described in this repository

    2. install prerequisites as done above

    3. mount the BBB build folder to your changeroot

    4. compile the rest

  3. return to your BBB and run machinekit

Rough Procedure Description

  1. on beaglebone black

    1. clone repository

      machinekit@beaglebone:~$ mkdir ~/git
      machinekit@beaglebone:~/git$ cd ~/git
      machinekit@beaglebone:~/git$ git clone https://github.com/machinekit/machinekit.git
    2. Compile linuxcnc on BBB as far as possible, which means until the compiler crashes due to out of memory.

  2. on a different machine

    1. Download and prepare the changeroot as described here.

      user@host:~/bone-debian-8.7-machinekit-armhf-chroot$ sshfs machinekit@<machinekit-ip>:~/<build-folder>  ./home/machinekit/<build-folder>
      root@host:~/bone-debian-8.7-machinekit-armhf-chroot$ sudo chroot  <path-to-your-chroot> /bin/bash
      root@host:/$ su - machinekit
      (chroot)machinekit@host:~$ cd <build-folder>
      (chroot)machinekit@host:~/git/machinekit$ make
  3. Return to your BBB and proceed further as described in the Machinekit Developer Howto.

Tested with

Other References

start/stop, resume/step halui diagram