LinuxCNC runs on Linux. If you haven't ever used Linux before, it can be a bit frustrating when you boot it up and try and find your way around (like any operating system that is new can be).
We are starting to put together some basic resources for new Linux users on this page. Take a look, and please contribute your questions so we can continue to improve it.
LinuxCNC is a control method that runs on either an Intel/AMD PC or Raspberry Pi 4, and is paired with either a parallel breakout board (bob) or ethernet connected Mesa 7i76e or 7i96.
The bob needs a PC that's old enough to have a parallel port or an add-on card, and ideally is no newer than a Gen 2 i5, though older core 2 quad or duo systems work as well, even Pentiums.
A newer PC (without a parallel port) or Pi requires a Mesa controller which uses the onboard FPGA chip to generate the clock timing cycles for the controller.
It is recommended that you use linuxCNC >2.8 as it supports moving gantry style machines like the printNC
A post-processor converts your programmed tool paths in a file format that your controller can understand (eg, LinuxCNC, GRBL etc) there can be many small variations with how this code is generated that may affect the exact way the tool path is interpreted by the controller.
Fusion 360 includes a post-processor for LinuxCNC, this post is useable however its default settings may cause unexpected behavior when running you jobs
The PrintNC Post Processor corrects this by default (most notably G64 P0.01) and will ensure your simulated paths are the same as your actual paths.
In addition, when you running your code the machine will rapid from its current position to the programmed workpiece origin, standard behavior for this is a direct path. This post separates the move into Y first then X which will prevent collisions when using high stock that clears the gantry but is taller than the base of the Z axis. This is also useful if auto tool length tool change is being used
Download PrintNC-Post-Processor
Reference this video to help you understand how to manually import the file: https://youtu.be/eY8e4un-wm0?t=120
Place the file in C:\Users > your user name > Appdata > Roaming > Autodesk > Fusion 360 CAM > Posts.
Copy the postprocessor file here to this folder and it will show up in the list when you choose the Personal - Local library option in the drop down.
For LinuxCNC, there's either parallel bob (cheap, limited IO) or mesa (FPGA creates timing cycles, lots of IO). More recently there is the FlexiHAL (MCU creates timing, decent IO). For $120usd, the 7i96 has plenty of IO for a stock build, though some people have gone for the 7i76e thinking 11 inputs weren't enough.
https://forum.linuxcnc.org/27-driver-boards/40646-7c80-vs-7i96
Also see FAQ at bottom of page for more Mesa board content.
The FlexiHAL works by integrating with a Raspberry Pi 4B (4GB or more) and communicates via SPI to perform external step generation via the Remora component.
https://github.com/Expatria-Technologies/remora-flexi-hal
It is recommended that linuxCNC installed using the iso from the LinuxCNC site: http://www.linuxcnc.org/iso/linuxcnc-2.8.0-buster.iso
NOTE: The PrintNC community has a new troubleshooting tool called ‘showme’ that will make it easy for members who are new to Linux to easily collect information and make it available when asking for help on Discord. You can get the program and details on how to use it over on the showme introductory page here.
A more detailed install guide that contains details like installing Discord and general linux settings can be found at the following link
/en/controllers/linuxcnc/install
If you have a Dell Optiplex and the install is not working: Notes for installing on a Dell Optiplex
Configuration
This section is here to help people understand the ini and the hal files that are generated.
A video overview of basic configuration is available here.
NOTE: If you are trying to install from a USB stick and it wants to mount a CD, remove and re insert the USB stick, try different ports, that should get it working.
This is where we set up linuxcnc to handle a moving gantry. We have four ‘joints’ hypothetically: X, Y1, Y2, and Z.
The [TRAJ] section is more for the GUI, most don't need to change but the default linear velocity and max linear velocity set the initial and maximum jog speeds in your GUI (in mm/min below).
[KINS]
JOINTS = 4
KINEMATICS = trivkins coordinates=XYYZ kinstype=BOTH
[TRAJ]
COORDINATES = XYYZ
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 10.00
MAX_LINEAR_VELOCITY = 100.00
At the beginning of each axis there are the following lines
[AXIS_Y]
MAX_VELOCITY = 1.9
MAX_ACCELERATION = 30.0
MIN_LIMIT = -0.01
MAX_LIMIT = 8.0
http://linuxcnc.org/docs/html/config/ini-homing.html
Note: You will need working limit switches to get the dual Y axis working, Linuxcnc needs to run the homing sequence before you can jog the axises. You can do this on a test bench setup fairly easily.
Connecting Multiple Probes in HAL
Z Toolsetter Guide (not using Probe Screen)
The PrintNC project strongly recommends using your Huanyang VFD with RS485, which runs on a modified modbus. This allows you to control and get feedback from your spindle in your GUI. The guide can be found here:
Huanyang VFD LinuxCNC Configuration Guide
These steps need to be followed to make the x11vnc ( VNC server ) autostart at boot time ( you need to have the auto-login set before -→ see disable login here https://wiki.printnc.info/en/controllers/linuxcnc/install ).
( the installation of x11vnc is required before proceeding → sudo apt-get update && sudo apt-get install x11vnc )
edit the service file with:
sudo nano /etc/systemd/system/x11vnc.service
insert the following into that file:
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -forever -auth guess -display :0
[Install]
WantedBy=multi-user.target
Restart the service daemon:
sudo systemctl daemon-reload
sudo systemctl enable x11vnc.service
sudo systemctl restart x11vnc.service
And finally check if the service is running ok:
sudo systemctl status x11vnc.service
Keyboard controls for LinuxCNC are detailed here.
Josh 🇺🇸: one thing I haven't figured out yet is if there is a keyboard shortcut to move the Z has anyone found one?
kotlikm 🇺🇸: Page up page down. Another nice on is hit "|" (pipe, aka shift-backslash on US keyboards) and it cycles through the increments of movement.
gerrg TX 🇺🇸 : At least in Linux cnc I just use the number pad. 2 and 8 to move the Y axis, 4 and 6 to move the X axis, and 3 and 9 to move the Z axis. Not sure if it matters if the numlock is on or not. This corresponds to the arrow keys on the number pad to move X and Y, and page up and down to move the Z
Yes. Trader on Discord found a highly realtime optimized kernel project that builds and packages kernels for gamers, audio and other real time use. It has resulted in a significant drop in latency on his older Dell i3 system, making his system viable for use as a Mesa LinuxCNC host. It's called Xanmod and you can read about it here.
Installing the kernel is very straight forward, just four steps of commands in the terminal:
# Lines starting with # are comments and do not need to be copied
# Open a terminal window
# Install the wget tool for downloading things from web addresses at the command line
# You may already have this installed, but if you have a fresh install, it isn't included for some reason
sudo apt-get update && sudo apt-get install wget
# What is the command above doing?
# apt-get update grabs the latest package lists from the repo
# && is a seperator between two commands that means "if the first one completes successfully then run the second one"
# sudo apt-get install wget installs the package wget from the repo
# Add the Xanmod (www.xanmod.org) Kernel repository to your sources list for downloading
sudo echo 'deb http://deb.xanmod.org/ releases main' | sudo tee /etc/apt/sources.list.d/xanmod-kernel.list
# What is the command above doing?
# sudo echo 'deb http://deb.xanmod.org/ releases main' just prints some text that we then pipe (send) to the next command
# pipe (written as | which is the shift backslash key on a north american keyboard) means instead of sending
# the output of the command to standard out (the terminal, normally), send it to the next command
# sudo tee means T like in a water pipe... send a copy of the output to the console and to the file specified
# /etc/apt/sources.list.d/xanmod-kernel.list is a new file it is creating to store the repo info in the repo sources tree
# Add the Xanmod GPG security key for the repo so you can verify the signed packages you download
wget -qO - https://dl.xanmod.org/gpg.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/xanmod-kernel.gpg add -
# Install the Xanmod long term support RealTime (RT) kernel
sudo apt update && sudo apt install linux-xanmod-rt
# What is the command above doing?
# Updating the package list from all your software repos (which now include Xanmod)
# Installing the xanmod-rt (realtime) kernel on your system.
# It will not remove your older kernels, it will simply add this and set it as the default boot kernel
# You can still select an older kernel at the boot menu to revert
# Reboot to apply changes
sudo reboot
Now you can go back and re-run your latency tests and see how your hardware performs.
This is not a replacement for the various command line options you may have used or need to use to optimize for your system, but it has yielded significant latency reductions overall for the few who have tried it.
If you find that your display won't go higher than 1024x768 after this installation, you can create a new file that will run at login (put it in your .bash_profile file). Mine is called xrandr.sh:
#!/bin/bash
sudo xrandr --newmode ""1280x1024_60.00"" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync
sudo xrandr --addmode DVI-1 1280x1024_60.00
xrandr --output DVI-1 --mode 1280x1024_60.00
You need to get the mode using
cvt 1280 1024 60
which will give you the string you can use on the first line above. Also change the DVI-1 to the name of your display (look at the link below). Change this file to be executable with:
sudo chmod +x xrandr.sh
More information here: https://askubuntu.com/questions/281509/how-do-i-change-the-screen-resolution-using-ubuntu-command-line
It has helped some people on dual-core systems to set isolcpus=1
at the terminal, type:
sudo pico /etc/default/grub
when this opens, add this line (for a 2 core system):
GRUB_CMDLINE_LINUX="isolcpus=1"
You can add this below the other command line parameters in the file. Then hit control-x to save it.
then type:
sudo /sbin/update-grub
then reboot.
Verify that it worked by doing:
sudo dmesg
or
cat /proc/cmdline
which shows the parameters used for the current bootup
You should see your isolcpus command in that list.
Addressing latency problems is a really hard process. You could get lucky and have it work, or you could live with latency issues until you can upgrade to a Mesa or grblhal board.
Here are things that worked for a Dell 755 (core2 duo; dell made several different 755 computers):
It is a lot of trial and error. For me, I would get an error about 80% of the time I started linuxcnc saying a delay exceeded my 50000ns jitter value. I now have a .ini value of 20050. I finally have a system that I think will work.
Linux is a massive topic, but thankfully you only need a thin skim of knowledge to get LinuxCNC up and running in most cases. In order to make it easier for new PrintNC community members, regardless of experience level, I have started a new page on Linux Basics and will attempt to include answers to the common questions that come up as people reach this stage of their PrintNC build. You can find this information on the New PrintNC Linux Basics Page.
LinuxCNC can be tricky in terms of which computer works and which one has issues. Spikee has recently made a blog post about the Dell Optiplex 7050 mini for LinuxCNC ~140$
irrenhaus: I was using it for a little bit. It worked quite fine, I did not really have any problems with it. However, after I had to bump up the servo thread duration to 1150000 due to jitter and still got realtime thread issues (as in lcnc warned about an unexpected real time thread duration) when opening a browser while having lcnc running I ditched it and went back to the random computer I still had lying around, which also is not very good but not nearly as bad in regards to realtime. The Pi4 worked though and the only thing I noticed was that something durings manual movements (like, holding the arrow key pressed) one of the axis sometimes had small ... glitches. As in seemingly loosing the key input 1 or 2 times and thus shortly decelerating and then accelarting again.
Honestly I think using some random PC still is way better. And since you can get some of the thin client stuff for really not that much more than a PI4 I would definitively go that route. It seems any PC will perform better with a bit of tweaking. The Pi4 worked, too, though.
I did not try to tweak the pi4 installation though, so I did not use anything like isolcpus, I just used it as it was done by lcnc, so maybe there is some more performance to get out of it.
thesnuggsToday at 6:07 AM
hrmm, kinda out of the box with the latest preempt kernel 'm seeing 109k ns max jitter on the pi, still tuning
Logan: Under 250 is fine, @thesnuggs, the Mesa deals with the timing pulses.
Old PC with a parallel port and a parallel port breakout board (BOB) is a bit more tried and true but also means finding and maintaining old PC hardware going forward. The Reaspberry Pi 4 with Mesa Ethernet option is very recently added.
A middle ground solution that eliminates the older PC is to use a newer PC and one of the Mesa FPGA based Ethernet boards. This means you can maintain and upgrade your PC over the years without worrying about affecting the stable transmission rate of commands to the stepper drivers as that is handled by the Mesa. The PC talks to the Mesa card over a standard Ethernet cable.
Logan: Depends on you, all our components can be driven by sourcing or sinking outputs.
DZwijnenburg: Hmm, I'm in over my head here. So just what is mostly used by everyone here. I'm looking to use “stock” everything to align with the community.
SOURCING VS SINKING OUTPUTS
The advantage of sourcing type field wiring is that it is less likely to cause inadvertent device actuation from the most likely type of field wiring problem which is a short to ground. The advantage of sinking drivers is compatibility with existing hardware on retrofits and the capability of using mixed output voltages.
I purchased the sourcing version.
thanks, I also asked @EisbaerLars 🇩🇪 he confirmed sourcing as well!
Yes, they are well supported and many PrintNC users have or are planning “bit setter” touch off-blocks to enabled auto-tool length updates as part of the tool change process.
@logan: Absolutely not, LinuxCNC under VM has nasty jitter.
LinuxCNC has a prebuilt Debian Buster 10 distro image available from their website with some kernel tweaks etc.
You can find the ISO image downloads here: http://linuxcnc.org/downloads/
Logan BC: Don't use 10 for parallel port BOBs. Debian 7 or 9 both seem to have much lower jitter. But note it is a 2GB file so consider how you will get it over to the machine you need to boot if you don't have a DVD drive in it.
Trader: A useful free tool for creating bootable USB thumb drives from ISO images is Balena Etcher. Note that you may need to install it or run it as administrator, I have had some issues with that. You will l likely need to enable booting from USB in your BIOS on an older machine.
@"Bob" from PA: “This turned out to be because it had the install CD in the repo list and was trying to refer to it when I had removed it. Edit your /etc/apt/sources.list and remove the entry referring to your CD-ROM as a repo. In my case it was my first line."
https://wiki.debian.org/WiFi/HowToUse
@ljkenny: @ReduX_Hz knowing what I know now, my suggestion would be to pull down your *.ini and *.hal files from the wiki. They're a nice reference, but are more likely to cause confusion than anything. My personal opinion is that we should be encouraging people to run through the StepConf Wizard instead of using pre-formatted config files.
There are too many variables (motors, screw [length, diameter], measurement system [metric/imperial], etc) for them to be totally useful. Turns out that my resultant files are very different from yours.
https://wiki.printnc.info/en/buildlogs/Mishkan/linuxcncconfigs
rcw: All your config stuff gets placed in its own folder under your home directory (by default). It's entirely separate from the LinuxCNC installation.
Trader: so all you need to do to "start fresh" is blow away the contents of that under your home directory?
Rcw: Yes. Also, one nice thing about Linux these days (at least Debian and Redhat and derivatives) is that every package "owns" the program files and config files that it installs. No other package can touch those. So there's no "DLL hell" like on Windows.
GTKpluplus: Or just create a new config. You don't even need to delete the old one.
gerrg: the big problem i had was in the ini file, one of the lines was like this (straight from the github download)
SUBROUTINE_PATH = macros:psng/macros
and it kept giving me errors about not my axis.ngc file so I changed it to this (just adding a "/" in front of the psng
SUBROUTINE_PATH = macros:/psng/macros
At the moment it seems like most people are using Gmoccapy.
@logan: I think the first two rows should be the same as the 7i76e (I checked, they are) so it's only the last row on the right that needs a custom label.
Logan: Yes, you can connect a bob to the parallel port on the Mesa, that's what it's for. Or one of their own daughter boards
EisbaerLars: Tweaked two things for mounting the 7i76e as well for my needs - needs less filament - also know that @kjordan 🇨🇦 posted his as well, so that one on top should give everybody with a Mesa 7i76e another option to mount
https://www.thingiverse.com/thing:4712274
NOTE: Cybran Nakh: Also.... there was a link here for a 7i76e din mount on thingiverse.... one of the mount holes was out of place (not critical but I fixed it) will upload the thingiverse remix soon and put a link here for people to use. Just testing it to make sure it fits…
Bob: If anyone is using the Mesa boards and want to go with a DIN setup, you will need these. https://mesaus.com/product/3-7din/ for $3 for one.
There are kits here with 2 or three for a bit more: http://store.mesanet.com/index.php?route=product/search&search=din
Not to be outdone, Lars did a modification of his design above for the 7i96 -
EisbaerLars: Made one real quick for the Mesa 7i96 as well - https://www.thingiverse.com/thing:4732506
You can find detailed documentation and build/install details for the 7i96 configuration tool here: https://jethornton.github.io/7i96/index.html
Mishkan: doesn't matter, either work
J1mbo: I now see that after looking at Mok's wiring diagram, the USB dongle doesn't go near the Mesa board.
J1mbo: I tried the https://jethornton.github.io/7i96/install.html configuration tool after some trouble getting it installed and came to the conclusion that whilst its arguably better laid out than the linuxcnc Pncconfig tool, it was more hassle than required and the pncconfig does the same job as far as initial setup is concerned. My impression is that the jethornton's guide will also lag slightly behind any updates to Linuxcnc, so you may as well just stick with the stock linuxcnc config tool.
First you need to make sure you have your input pins for your limit switches configured correctly under LinuxCNC for your Mesa board [reference neeeded].
Yes, you could use a simple four port relay module like this one that is <$15 from Amazon and have the NPN limit switches, which are “trigger low” activated - that means when you ground the control pin on the control/input side of the relay, it switches the output side of the relay. So you can send a reference voltage from the control board output pin in to the common on the output side of the relay and return the signal from the appropriate side of that relay (NC side I believe) back to your input pin on the control board. Then, when your NPN sensor grounds the signal line, it will trigger the relay to fire, and reference voltage from your controller output pin will appear on the input/alarm pin and pull it high - flagging the alarm.
Likewise, if you had the opposite problem and bought PNP style switches and wanted to pull them low, you could use a similar relay to the one above but one that is “trigger high” at the voltage you are powering your sensor with and that appears on the signal line when the sensor is tripped. It could then switch ground on to the input pin of your controller.
Obviously, it is more convenient to get the preferred switch type from the outset, but it is an easy problem to overcome for a minimal cost if you run in to it.
It may be easier to complete your limit sensor wiring and setup first to ensure you have that layer of safety in place before operating the machine. However, if you do need to jog the machine while working towards completing all the steps then you need to disable homing on each of your axes.
These are the entries required in /linuxcnc/configs/<yourCNCfolder>/<yourmachinename>.ini,
under each axis that you want to set the current position to the home position:
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_USE_INDEX = NO
HOME_SEQUENCE = 0
so something like this:
[JOINT_1]
TYPE = LINEAR
HOME = 0
FERROR = 10.0
MIN_FERROR = 1.0
MAX_VELOCITY = 75.0
MAX_ACCELERATION = 750.0
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 93.75
STEPGEN_MAXACCEL = 937.50
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0.0
# these are in nanoseconds
DIRSETUP = 10000
DIRHOLD = 10000
STEPLEN = 5000
STEPSPACE = 5000
STEP_SCALE = -160.0
MIN_LIMIT = -2.000
MAX_LIMIT = 585.1
HOME_OFFSET = 0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_USE_INDEX = NO
HOME_SEQUENCE = 0
where the last 4 lines are the ones to be added to disable homing
and just duplicated for all of the relevant Joints (in the case of the PrintNC, that is Joint_0, Joint_1, Joint_2 and Joint_3)
NOTE: You'll still need to hit "home all" once the changes are made, it's just nothing will happen and it will home instantly
Essentially correct. You do define an axis and then you have a related joint with details, but for general discussion, yes.
ljkenny: Don't forget to invert the sign (-) for Y1 and Y2's HOME_SEQUENCE
That's what tells LinuxCNC that they're to be synchronised.
J1mboToday: So edit the "HOME_SEQUENCE = -1" entry in both JOINT_1 (Y1) and JOINT_2 (Y2) sections of the .ini file?
ljkenny: Correct. Usually you want Z to be '0' (this lifts the cutter out of the work before moving X,Y). Then it's up to you - I have X and Y to home at the same time, so X=1' 'and Y1 and Y2 = '-1'
If you wanted to home X THEN Y, you'd do: X='1', then Y1 = '-2' and Y2 = '-2'
--
Excerpt from the LinuxCNC manual PDF:
8.3.6.10 HOME_SEQUENCE
Used to define a multi-joint homing sequence HOME ALL and enforce homing order (e.g., Z may not be homed if X is not yet
homed). A joint may be homed after all joints with a lower (absolute value) HOME_SEQUENCE have already been homed and
are at the HOME_OFFSET. If two joints have the same HOME_SEQUENCE, they may be homed at the same time.
The use of the ‘-’ sign triggers any joints sharing the same absolute value to synchronize their homing. Use of the ‘-’ in front of any absolute number causes all joints with the same absolute number in the homing sequence to syncrhonize. So y1=-2, y2=-2 is the same as y1=-2, y2=2. For readability, it is probably a good idea just to sign all of the syncrhonized joints.
--
Logan: - means they wait until both have homed before moving away from the endstop
hoges: This line is very clear and should get added to the wiki. It explains what synced means for even simple people like me
Logan: did you set your Z for both an endstop and homing trigger, or just homing?
ljkenny: @ReduX_Hz {MAX,MIN}_LIMIT will dictate that
ReduX_Hz: awesome, that did it, had some numbers backwards
gerrg: mind sharing your INI file? also, when you're homing, the Y axis moves, reaches your homing switch, and then does it move back (so it's off the switch), or does it just stay there?
liberado: It just stays there
gerrg: it should move back away a bit, then home a little slower once more until it hits the switch again, then it should move back again a set amount and stay there
This is from my ini file:
[AXIS_Y]
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 750.0
MIN_LIMIT = -0.001
MAX_LIMIT = 585.001
[JOINT_1]
TYPE = LINEAR
HOME = 0
FERROR = 10.0
MIN_FERROR = 1.0
MAX_VELOCITY = 75.0
MAX_ACCELERATION = 750.0
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 93.75
STEPGEN_MAXACCEL = 937.50
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0.0
# these are in nanoseconds
DIRSETUP = 10000
DIRHOLD = 10000
STEPLEN = 5000
STEPSPACE = 5000
STEP_SCALE = -160.0
MIN_LIMIT = -2.000
MAX_LIMIT = 585.1
#offset = .833 = 2 - 1.167
HOME_OFFSET = -0.833
HOME_SEARCH_VEL = -10.000000
HOME_LATCH_VEL = -0.500000
HOME_FINAL_VEL = 0.000000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = -2
i'm still a little confused on things, but this is working for me. So my Home=0 line says that after i'm done homing my position will be at 0mm. the home_offset = -0.833 moves that joint away from the switch .833mm (my Y2 joint moves it away 2mm, and the difference between these two is my squaring offset) i thought you could move it back a set distance with the MIN_limit... but it didn't actually change for me when i tried this, so that's that part i'm a little confused about
liberado: hmm i also used your ini and only changed .833 to 0. try to make a video tomorrow. i also changed HOME_SEARCH_VEL = -10.000000 to +10. Cause -10 searched in wrong direction
gerrg: you might change the offset to -1 or 1 (not sure which direction is right, 1mm shouldn't move it to far in the wrong direction though, so you can figure out the sign, and then increase or decrease that value to whatever you want.
irrenhaus 🇩🇪: I had it running on a Pi4 with a Mesa 7i96 and had a jitter value of 140_000 and it was perfectly fine... So no worries, max jitter of 18_000 would make it a pretty good PC for software stepping
irrenhaus: Yes, exactly. See here: http://linuxcnc.org/docs/html/install/latency-test.html
So, what do the results mean? If your Max Jitter number is less than about 15-20 microseconds (15000-20000 nanoseconds), the computer should give very nice results with software stepping. If the max latency is more like 30-50 microseconds, you can still get good results, but your maximum step rate might be a little disappointing, especially if you use microstepping or have very fine pitch leadscrews. If the numbers are 100 us or more (100,000 nanoseconds), then the PC is not a good candidate for software stepping. Numbers over 1 millisecond (1,000,000 nanoseconds) mean the PC is not a good candidate for LinuxCNC, regardless of whether you use software stepping or not.
Using a mesa is offloading the step generation to the mesa card and thus you don't need the hard realtime requirements anymore. What's left over is the servo thread which is responsible for doing calculation work. For example if you load any logic elements into your HAL (e.g. and/or/not) these would be processed on the servo thread (obviously it's doing everything else realtime, too). These simply don't have the frequency requirements of the step generation, so you can more or less use what you want for a mesa based system (obviously with limits to that rule).
irrenhaus: There is one included with Fusion, you can simply select it. I think it's still called EMC2 though (old name of LinuxCNC)
https://docs.google.com/document/d/1lulU0Wgbz6rShSlq1X2bUhlRkG_RJpVpbe6suWTK6RU/edit
Thesnuggs: btw was real easy to get this thing booted headless when i found the right set of instructions
Trader: I haven't settled on a PC yet, but I am intrigued by the idea of a headless Pi4 quietly working away and just remote desktoping in from my Fusion Laptop
Thesnuggs: skeletal wpa_supplicant
country=US # Your 2-digit country code
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
ssid="YOUR_ESSID"
psk="YOUR_PASSWORD"
key_mgmt=WPA-PSK
}
when you flash it, just put that (well edited with your wap and password) on the fat partition it creates along with an empty file named 'ssh' and it will auto connect to wifi
Ljkenny: LinuxCNC complains with "error on joint"
NeoKurtex: what board are you running
Ljkenny: Parallel breakout board (BOB). Initially had microstepping set to 1/8. So I lowered it to 1/4 thinking it was a bandwidth thing, but it right make a difference. @hoges says I should be getting x3 that
Hoges: what is your max joint and max axis set to?
Ljkenny: Length?
Hoges: post a screen shot of your settings
Hoges: velocity and acceleration
Ljkenny:
[AXIS_X]
# Hoges says this could be 150
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 750.0
MIN_LIMIT = -0.001
MAX_LIMIT = 1030.0
[JOINT_0]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -0.001
MAX_LIMIT = 1030.0
# Hoges says this could be 150
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 750.0
SCALE = 80.0
FERROR = 1
MIN_FERROR = .25
HOME_SEQUENCE = 1
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 15.0
HOME_LATCH_VEL = 0.1
(sorry for putting your name all over my config files - I tend to make notes in them)
Ljkenny: Same settings for Y1 and Y2
Hoges: post a photo of the dip switches on the driver too please
Ljkenny: 5.6A (1/2 set) 400
Hoges: try lowering the axis acceleration and velocity so it's a little lower than the joint
and ensure that you have 1/4 microstepping set on the drivers
NeoKurtex: i clamped a meat thermometer to a motor to see how hot it gets, you might want to do the same. thats unlikely to be whats causing the software issue, tho
do you have a pic of your latency-histogram?
Ljkenny: I don't. I got 30k when I did the test. That's with lots of 1080p videos running and glxgears. I'll do the things, bear with
Jkenny: This worked thanks. Maxed out at 125mm/s (7500mm/min)
Hoges: Great, you could likely tweak the settings to get some more out of it but really 7500m/min is pretty fast already so I'd be tempted to leave for now, start making chips and come back to it down the track of you want
Just had to change mine, as I set it the same as X, Y1, Y2. Pitch should be 4mm rather than 10mm
Logan: Your travel distances might be off. If you move 100mm does it actually move 100mm?
Liberado: hmm not in x. Y seems to be ok. What can be the reason that the distance is not ok ?
"BOB": Well considering you have a circle and your other shapes arent skewed, I think you either have to calibrate all your axis the same if they are not moving the correct distance you are telling them to or your design isnt using the correct measurements. Otherwise, that image looks to be pretty good despite not having enough material.
Liberado: nope it should look like this
x is configured the same as y, so i dont understand why its different
"BOB": You wont get those tight corners with the large bit you are using. And it DOES look like that image besides the radius in the mouth but that is due to bit size
kotlikm: I looked at the config files you posted yesterday when we were troubleshooting in linuxcnc, your X and Y axis have different settings for the following, which will cause your scale ot be skewed.
DIRSETUP = 10000
DIRHOLD = 10000
STEPLEN = 5000
STEPSPACE = 5000
STEP_SCALE = 400.0
Are those different than they were the other day? X was :
DIRSETUP = 5000
DIRHOLD = 5000
STEPLEN = 5000
STEPSPACE = 5000
STEP_SCALE = 400
Y was:
DIRSETUP = 10000
DIRHOLD = 10000
STEPLEN = 5000
STEPSPACE = 5000
STEP_SCALE = 160.0
Liberado: I changed them all to:
DIRSETUP = 5000
DIRHOLD = 5000
STEPLEN = 5000
STEPSPACE = 2500
Kotlikm: Is STEP_SCALE consistent?
Liberado: Hmm no, x is stepscale 400 and y is 160
Kotlikm: Are you running different ballscrews on X and Y?
Liberado: no. is that the reason? I will try it
Kotlikm: Unless you have different driver settings, or different ballscrews on X and Y, all those setting should be the same. Did you use the "Calculate Scale" in PNCCONF?
Use the Leadscrew Metric Pitch - 10 for a 1610 ballscrew
Microstep Multiplication Factor - Whatever you have your driver set to, 5 for 1/5th, 8 for 1/8th
Motor Steps per revolution - 200
Liberado: no i copied the settings
Kotlikm: what microstepping are you using on your drivers?
Liberado: i have the ali pro kit. So i thought i can copy the settings? I have 8 microstepping
Kotlikm: so in MM, for a 1610 ballscrew with 1/8th microstep, your scale should be 160. So i would both X and Y to 160.
Liberado: great thank you
Kotlikm: using a 1204 for Z?
Liberado: yes, there i have stepscale 400
kotlikm:that is correct
liberado: yippy
kotlikm: before you run new code after changing those, i would verify when you tell the machine to go Xmm, it actually go Xmm in both directions… or atleast very close, you can dial in any differences later
liberado: ok will try that. thank you very much
kotlikm: no problem, hope it works
liberado: So i am back from the shop. Works like a charm. Thank you very much. Really great community here
kotlikm: Awesome, congrats, Sounds like you need to update to cutting in #requests
kotlikm: For a sanity check, I should be using a value of 10 in "leadscrew metric pitch" when calculating my scale for 1610 ballscrews, and 4 for the 1204 right?
gerrg TX: i'm not sure... I know for my X and Y axis, my step_scale is -160 (using 1600 as my step setting on my driver) and -400 for my Z axis and my settings are in mm
kotlikm: Hmm, I have been toying with going metric, but my visual/mental scaling is inches
Logan: yeah, a 1610 is 10mm per rotation, and a 1204 is 4mm per rotation.
m0jo: you can set the UI in inches while using the correct mm pitch in the config
gerrg TX: Thank you!
hoges: If you want to fix it properly... you can switch any two wire pairs on the Y stepper motors. or you can just put a - in front of the scale in the ini file for the Y axis joints
liberado: Tried that. Doesn't help
hoges: the - or swapping wires?
liberado: The minus helps. But when I press now the down button linuxcnc said it drives into minus. And my min value reached after 3 centimeters
hoges: i personally would prefer to have the scale positive and fix the wiring - getting the wiring an ini right the first time will save headaches down the road. When you switched the wires did you swap these ones here:
liberadoToday: I switched b+ and b-. AND A+ an A-
hoges: yeah that won't do anything. you only need to switch a single pair. it's counter intuitive but it works
liberado: Ah ok. So only a+ and A- ?
hoges: correct
liberado: I figured it out how I get that working. network manager>edit connections>wired connection X>IPv4 settings> ROUTES > just click on the "use this connection only for resources on its network"> OK>save>network manager>reconnect to that network.
gerrg: I had seen that somewhere and tried it to find it (for 2 minutes) but wicd didn't have that option. The gnome network manager has it that it looks like. Thanks!
J1mbo: no single cpu was maxed or anywhere close as it happens and memory is about .5gb of 4gb installed
ljkenny: And it lagged again?
J1mbo: yes but marginally less so. I have isolcpus 3, 4 core cpu
Logan: try 2,3 or 1,2,3 - isolcpus 3 just means it doesn't use 3rd (4th) core
J1mbo: "3. Latency with preempt_rt
isolcpus= should be set for the highest core in the CPU. The core numbers start counting at 0 vs 1.
isolcpus=3 for a 4-core CPU.
isolcpus=5 for a 6-core CPU."
ljkenny: I had best luck with only 1 core isolated, But YMMV. But some have had better luck with multiple
J1mbo: would you believe it... it was the trackpad... wired mouse works fine
Logan: I think that's a floating ground problem with the mesa. A few people have complained about noise from the mesa connected motors after closing linuxcnc.
liberado: Ah ok. Is there any fix for this ?
Logan: I don't have a mesa so I can't work on a fix. Maybe search the linuxcnc or mesa support forums?
Yes, you want a more detailed “top” program, which is the program that shows you what processes and load are occurring on your system. htop is a good choice:
sudo apt update && sudo apt install htop
There seem to be two popular options (if you need more than a simple three axis corner finder for non-metallic materials):
https://topcom.cz/dig3dlpm/DIG3D-LP-M-p262128333
and the Vers.by: https://vers.by/en/
Kotlikm: I am just using a 24V relay to power my palm router
Trader: You're switching mains with a 24V rated relay? Hmm… I have some 5V trigger relays but they are mains rated at 250V
Kotlikm: https://www.amazon.com/gp/product/B07QXXM1RV/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 is rated to switch Contact Capacity: 10A 250VAC/10A 28VDC; in your spec, so you are fine
Trader: @kotlikm 🇺🇸 Are you using a Mesa or how are you triggering it?
Kotlikm: Mesa, 24V output from the MESA Output
Mishkan (updated by Trader to show correct syntax for LinuxCNC 2.8, triggering the third Mesa output (reminder, they are numbered from zero):
# Add this in your ~/linuxcnc/configs/MACHINENAME/custom.hal file and it will persist even if you run pncconf
net spindle-cw spindle.0.forward => hm2_7i96.0.ssr.00.out-02
is what i'd do, depending on which out you're running it through
Trader: TY. Oh right, I’ll need a 12V relay rated for AC loads if that is what I am driving my sensors with. I’m going with the Cisco PSU so I think my sensors will be at 12V, need to double check.
kotlikm: Ill try and throw something together. I just use the Spindle CW in output 0 when setting up in PNCCONF.
ljkenny: Kazam for screen recording - real easy
sudo apt install kazam
hmunktell: Super messy, and super old. But works super, going to update the script for my pnc. https://youtu.be/9H86iNWPYds. There are a github link in the Youtube description for my setup with the tool change remap.