This guide documents how to configure LinuxCNC 2.8 for the Torsion CNC Router when using a Mesa 7i76e FPGA board and Leadshine stepper motor drivers.
Pncconf Wizard is used for the initial setup. A few options are not built into the wizard, so there will be manual updates made after the initial configuration is generated by the wizard.
Note: Pncconf (Point and click configuration) Wizard is used when Mesa boards are used. For other stepper based systems, use Stepconf (Stepper Configuration) Wizard.
The Pncconf wizard created a folder on the desktop with the machine name. Open this folder and find the file named custom.hal. Open this file with a text editor to make changes.
Note that there is also a file named [machine_name].hal that is created by the Pncconf Wizard. Anytime you re-run the wizard, this file will be regenerated and any changes you made to it manually will be lost. That is why there is a custom.hal file, to allow you to customize the hal code without it being overwritten.
If using a water cooled spindle add the following two lines to custom.hal:
# --- Spindle Coolant Pump On/Off ---
net spindle-enable => hm2_7i76e.0.7i76.0.0.output-03
If using RS-485 to control the VFD/spindle, add the following to custom.hal:
# RS-485 Spindle Control
loadusr -Wn vfd hy_vfd -n vfd -d /dev/ttyUSB0 -p none -r 19200
net spindle-vel-cmd-rpm-abs vfd.speed-command
net spindle-enable vfd.spindle-on
net spindle-cw vfd.spindle-forward
net spindle-ccw vfd.spindle-reverse
net spindle-at-speed vfd.spindle-at-speed
setp vfd.enable 1
If using Analog Spindle Control via the Mesa 7i76e, there are additional changes you can make to custom.hal for tuning the spindle speed for better accuracy. A link will be added here soon.
For slaved (tandem) Y axis homing when there is only a home switch on one side of the axis:
It is recommended to have a limit/home switch on both the Y1 and Y2 drive systems, but in the case of having only a single switch, follow these instructions to get it working.
Add the following lines to the custom.hal file:
# Need to comment out the following three lines from the regular [machin_name].hal file
#
# net y2-home-sw => joint.2.home-sw-in
# net y2-neg-limit => joint.2.neg-lim-sw-in
# net y2-pos-limit => joint.2.pos-lim-sw-in
net min-home-y => joint.2.home-sw-in
net min-home-y => joint.2.neg-lim-sw-in
net y-pos-limit => joint.2.pos-lim-sw-in
Then comment out these lines in the [machine_name].hal file, by adding the “#” at the beginning of each line.
# net y2-home-sw => joint.2.home-sw-in
# net y2-neg-limit => joint.2.neg-lim-sw-in
# net y2-pos-limit => joint.2.pos-lim-sw-in
Each time Pncconf is re-run, any changes made manually in [machine_name].hal will be overwritten and these three lines will need to be commented out again. That is why a comment was added about this in the custom.hal file as a reminder of what needs to be done when the changes get wiped out.