Installation Instructions - Sector67/router-conversion GitHub Wiki
This document describes the installation procedure for the gantry router at Sector67.
Special considerations and decisions for this project
Some considerations when building this machine as of 8/31/2019:
-
We are using Mesa hardware (7i93) that requires the hm2_eth driver, which only works in uspace. This means the stock RTAI kernel supplied with the current live CD will not work without modification. As a result, it makes sense to make use of a newer image. Images are available at (http://www.linuxcnc.org/testing-stretch-rtpreempt/ ). These will eventually get officially released, but are usable for now. We are using the latest
linuxcnc-stretch-uspace-amd64.iso
, currently-r13
. Starting from the RTPreempt kernel simplifies the install significantly. An additional benefit of this approach is that instead of the ancientwheezy
distribution we move forward to the newer debianstretch
distribution. -
Configuring the
XXYZ
servo gantry configuration (tandem X motors) is much simpler in LinuxCNC 2.8.x. As a result we will be using 2.8.x to get the machine working. 2.8.x is not officially released yet either, but will be hopefully soon. PathPilot is also not yet based on 2.8.x, so we will not be able to move the configuration over to PathPilot for a while. -
The pncconf wizard in LinuxCNC 2.8.x does not yet support the 7i93 Mesa card nor servo-based tandem axes. So we will need to make manual modifications to the pncconf-generated files to get a working configuration. UPDATE: Thanks to cmorely, as of 9/7/2019 the latest 2.8 branch does support the 7i93!
Installing
Basic LinuxCNC install
To get started we need to build an install USB stick from the .iso file and work through the installation process. That process is documented elsewhere and depends on what OS you are using to generate the install, so I am not documenting that here. During installation it is helpful to be connected to the Internet, although eventually we may have this machine isolated.
Auto login
To have the machine auto-login, edit the /etc/lightdm/lightdm.conf
file and configure the following:
autologin-user=linuxcnc
autologin-user-timeout=0
in the [Seat:*]
section of the configuration. Take extra care that you are not editing a comment section, as those same settings show up there as well.
Upgrade to 2.8.x
After installation, you will have LinuxCNC 2.7.x installed. To upgrade, you can add the following lines to your /etc/apt/sources.list.d/linuxcnc.list
file:
deb http://buildbot.linuxcnc.org/ stretch 2.8-rtpreempt
deb-src http://buildbot.linuxcnc.org/ stretch 2.8-rtpreempt
You should also comment out the existing 2.7 and base entries in that file. Then run the following to upgrade:
sudo apt-get update
sudo apt-get install linuxcnc-uspace
Generating a config via pncconf
The following options are specified when generating the machine configuration via pncconf:
Start
Name | Value |
---|---|
Create a desktop shortcut to start LinuxCNC with this configuration | checked |
Base Information page
Name | Value | Notes |
---|---|---|
Actual Servo Period | 500000 ns | Setting this faster than the default is helpful for the H-bridge tuning. We were getting real time notifications at 250000 ns |
Require homing before MDI / Running | checked | This is fairly important for the gantry configuration |
Screen page
Name | Value | Notes |
---|---|---|
Display Geometry | xyz | This is different than the trajectory. |
Max linear velocity | 600 in/min | Current tuning value |
VCP page
Mesa Card 0 page
Name | Value | Notes |
---|---|---|
PWM base frequency | 50000 Hz | Per documentation on (http://linuxcnc.org/docs/html/config/pncconf.html) |
Configuration Page tab
Name | Value | Invert |
---|---|---|
Board name | 7i93-Internal Data | |
Firmware | SVST4_4d | |
Card address | 192.168.1.121 | |
Num of encoders | 4 | |
Num of pwm generators | 4 | |
Num of step generators | 0 |
Then click "Accept component Changes"
I/O Connector 1 tab
Name | Value | Invert |
---|---|---|
Input 024 | X Home | Invert |
Input 025 | X2 Tandem Home | Invert |
Input 026 | Y Home | Invert |
Input 027 | Z Home | Invert |
Input 028 | ESTOP In | Invert |
Output 040 | Spindle Z Brake | |
Output 041 | TODO: flood coolant? | |
Output 042 | TODO: vacuum table custom signal? | |
Output 043 | TODO: Spindle enable/CW? |
We could set the switches as home+limit, but since we will be using software limits for the other extent of each axis, and homing is required before running this gantry, we are configuring the switches as homing only. The custom "Spindle Z Brake" signal is created by simply typing that name into the signal name box next to the 040 output.
We are using the flood coolant signal to represent the table vacuum cleaner.
I/O Connector 2 tab
Name | Value | Invert |
---|---|---|
Encoder 0 | X Encoder | |
Encoder 1 | X2 Tandem Encoder | |
Encoder 2 | Y Encoder | |
Encoder 3 | Z Encoder | |
PWM 0 | X Axis PWM | |
PWM 1 | X2 Tandem PWM | |
PWM 2 | Y Axis PWM | |
PWM 3 | Z Axis PWM |
X Motor
Name | Value |
---|---|
encoder Scale | 7947.66 |
Maximum Velocity | ? |
Maximum Acceleration | ? |
Rapid Speed Following Error | 0.500 |
Feed Speed Following Error | 0.0500 |
X Axis
Name | Value | Note |
---|---|---|
Positive Travel Distance | ? | |
Negative Travel Distance | ? | |
Home Position Location | ? | |
Home Switch Location | ? | |
Home Search Velocity | ? | |
Home Search Direction | Towards Positive Limit | |
Home latch Velocity | ? | |
Home Final Velocity | ? | |
Use Encoder Index For Home | Yes | |
Home Search Sequence | 2 | pncconf automatically adds the negative for tandem axes |
Y Motor
Name | Value |
---|---|
encoder Scale | 6624.32 |
Maximum Velocity | ? |
Maximum Acceleration | ? |
Rapid Speed Following Error | 0.500 |
Feed Speed Following Error | 0.0500 |
Y Axis
Name | Value |
---|---|
Positive Travel Distance | ? |
Negative Travel Distance | ? |
Home Position Location | ? |
Home Switch Location | ? |
Home Search Velocity | ? |
Home Search Direction | Towards Positive Limit |
Home latch Velocity | ? |
Home Final Velocity | ? |
Use Encoder Index For Home | Yes |
Home Search Sequence | 1 |
Z Motor
Name | Value |
---|---|
encoder Scale | 17339.818 |
Maximum Velocity | ? |
Maximum Acceleration | ? |
Rapid Speed Following Error | 0.500 |
Feed Speed Following Error | 0.0500 |
Z Axis
Name | Value |
---|---|
Positive Travel Distance | ? |
Negative Travel Distance | ? |
Home Position Location | ? |
Home Switch Location | ? |
Home Search Velocity | ? |
Home Search Direction | Towards Negative Limit |
Home latch Velocity | ? |
Home Final Velocity | ? |
Use Encoder Index For Home | Yes |
Home Search Sequence | 0 |
Spindle Motor
Fixing the generated pncconf
There are a couple of defects in the generated configuration that we are fixing via shell script. These scripts should be run after each pncconf configuration change to ensure proper functionality:
~/fix-config.sh
~/fix-launcher.sh
The scripts can be seen in our repo in the scripts
directory.
The spindle Z brake
This machine has a pneumatic brake on the Z axis to prevent the head from falling when not under power. Ideally this brake would disengage a short time after the machine is enabled, and engage a short while before the machine is disabled. This is different than the "spindle brake" that is handled by the motion component, as that is intended to stop the spindle spinning versus stopping the spindle dropping. Although reusing the spindle brake might work, it could have odd edge cases (moving the Z axis when the spindle is not supposed to be running, etc.). As a result, we'll have to handle this with a bit of customization. We can make use of the LinuxCNC timedelay component to achieve at least the first part of that:
(http://linuxcnc.org/docs/html/man/man9/timedelay.9.html)
To achieve that in harmony with our pnc-based configuration, we create a custom signal name for the spindle-brake in the pncconf GPIO configuration, and then put content in a custom.hal
file to connect the machine enable signal to the timer input. To see the solution you can view our config/custom.hal
file.
Spindle delay
We currently do not have RPM feedback for the spindle, so we want to introduce a fixed delay after starting the spindle and before cutting. In LinuxCNC 2.8 the spindle.0.at-speed
signal is perfect for this, and you can view our config/custom.hal
file to see how we introduced a 3 second delay after spindle startup. Rapids will still happen after spindle startup, but not cuts.
Squaring the gantry
If there are issues with the gantry squareness after homing, those can be addressed by changing the HOME_OFFSET of one of the X joints in the .ini file. This could also be fixed by adjusting the location of the home switch, but solving it in software is fairly simple. You can see the values in the config file for how we have fixed a 0.06 inch difference. Also you can see in the 'scripts/fix-config.sh` script how we automated that for the X1 axis, since pncconf does not allow distinct HOME_OFFSET settings per joint.