Config - Sector67/router-conversion GitHub Wiki

Sector67 router configuration notes

Control system hardware

1x Mesa 7i93 Ethernet Anything I/O manual

2x Mesa 7i40 Dual 400W HBridge manual

1x Mesa 7i37TA Isolated Anything-IO adapter manual

The 7i93 ships default with an IP address of 192.168.1.121. As long as we don't want to put this machine on the Internet (we generally don't), then we can just keep the single-cable connection between the on-board ethernet and the 7i93, with the PC configured with a static IP address of 192.168.1.120. If this is working properly you should be able to ping the 7i93 and run mesaflash.

The boards are powered by an external 5V supply. As the 7i93 cannot be configured to disable power on pins 49 and 50 the two 7i40 cards are powered via the 50-pin cable. The 7i37TA has the jumper set to power from p1 and is independently powered. The jumpers on the 7i40's are set to differential encoders, with one card set to motors 0,1 and one set to 2,3.

7i93 firmware

In retrospect the firmware the 7i93 shipped with was probably fine for our configuration (shown in the sed script below). By default firmware files are found in /usr/share/doc/hostmot2-firmware-<board>/. We downloaded the latest firmware files and referenced them from the linuxcnc user's home directory.

Software

Initial: LinuxCNC 2.7 from the live install CD, with modifications to run uspace for the hm2_eth driver. To run with uspace:

sudo add-apt-repository "deb http://linuxcnc.org/ wheezy base 2.7-uspace"
sudo apt-get update
sudo apt-get install linuxcnc-uspace linuxcnc-doc-en

<Reboot with Linux 3.2.0-6-rt-686-pae>

sudo apt-get remove linux-image-3.4-9-rtai-686-pae
sudo update-grub

A simple sed script to fix up pncconf output after generating the config for a 7i43:

sed -i -e 's/7i43/7i93/g' router.hal
sed -i -e 's/7i43/7i93/g' router.ini
sed -i -e 's/^loadrt hm2.*/loadrt hm2_eth board_ip="192.168.1.121" config="num_encoders=4 num_pwmgens=4 num_stepgens=0 "/' router.hal

Steps

Good advice in these threads:

https://forum.linuxcnc.org/9-installing-linuxcnc/33596-mesa-7i93-7i33-7i37-easiest-install

To see the pinout when running LinuxCNC with rtai:

sudo dmesg -c
<start LinuxCNC>
dmesg > hm2.txt

You can also try this:

Power up the system but do not start LinuxCNC. Open a terminal:

halrun
loadrt hostmot2
loadrt hm2_pci
show pin
show param
exit

To see the pinout when running LinuxCNC with uspace, start linuxcnc via command line (see the command line in the desktop shortcut). Output should look like this, with the appropriate number of pwms and encoders as well as GPIO:

LINUXCNC - 2.7.14
Machine configuration directory is '/home/linuxcnc/linuxcnc/configs/router'
Machine configuration file is 'router.ini'
Starting LinuxCNC...
Found file(REL): ./router.hal
hm2: loading Mesa HostMot2 driver version 0.15
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
hm2_eth: 192.168.1.121: Hardware address: 00:60:1b:14:00:32
hm2_eth: discovered 7I93
hm2/hm2_7i93.0: 48 I/O Pins used:
hm2/hm2_7i93.0:     IO Pin 000 (P2-01): Encoder #1, pin B (Input)
hm2/hm2_7i93.0:     IO Pin 001 (P2-03): Encoder #1, pin A (Input)
hm2/hm2_7i93.0:     IO Pin 002 (P2-05): Encoder #0, pin B (Input)
hm2/hm2_7i93.0:     IO Pin 003 (P2-07): Encoder #0, pin A (Input)
hm2/hm2_7i93.0:     IO Pin 004 (P2-09): Encoder #1, pin Index (Input)
hm2/hm2_7i93.0:     IO Pin 005 (P2-11): Encoder #0, pin Index (Input)
hm2/hm2_7i93.0:     IO Pin 006 (P2-13): PWMGen #1, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i93.0:     IO Pin 007 (P2-15): PWMGen #0, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i93.0:     IO Pin 008 (P2-17): PWMGen #1, pin Out1 (Dir or Down) (Output)
hm2/hm2_7i93.0:     IO Pin 009 (P2-19): PWMGen #0, pin Out1 (Dir or Down) (Output)
hm2/hm2_7i93.0:     IO Pin 010 (P2-21): PWMGen #1, pin Not-Enable (Output)
hm2/hm2_7i93.0:     IO Pin 011 (P2-23): PWMGen #0, pin Not-Enable (Output)
hm2/hm2_7i93.0:     IO Pin 012 (P2-25): Encoder #3, pin B (Input)
hm2/hm2_7i93.0:     IO Pin 013 (P2-27): Encoder #3, pin A (Input)
hm2/hm2_7i93.0:     IO Pin 014 (P2-29): Encoder #2, pin B (Input)
hm2/hm2_7i93.0:     IO Pin 015 (P2-31): Encoder #2, pin A (Input)
hm2/hm2_7i93.0:     IO Pin 016 (P2-33): Encoder #3, pin Index (Input)
hm2/hm2_7i93.0:     IO Pin 017 (P2-35): Encoder #2, pin Index (Input)
hm2/hm2_7i93.0:     IO Pin 018 (P2-37): PWMGen #3, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i93.0:     IO Pin 019 (P2-39): PWMGen #2, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i93.0:     IO Pin 020 (P2-41): PWMGen #3, pin Out1 (Dir or Down) (Output)
hm2/hm2_7i93.0:     IO Pin 021 (P2-43): PWMGen #2, pin Out1 (Dir or Down) (Output)
hm2/hm2_7i93.0:     IO Pin 022 (P2-45): PWMGen #3, pin Not-Enable (Output)
hm2/hm2_7i93.0:     IO Pin 023 (P2-47): PWMGen #2, pin Not-Enable (Output)
hm2/hm2_7i93.0:     IO Pin 024 (P1-01): IOPort
hm2/hm2_7i93.0:     IO Pin 025 (P1-03): IOPort
hm2/hm2_7i93.0:     IO Pin 026 (P1-05): IOPort
hm2/hm2_7i93.0:     IO Pin 027 (P1-07): IOPort
hm2/hm2_7i93.0:     IO Pin 028 (P1-09): IOPort
hm2/hm2_7i93.0:     IO Pin 029 (P1-11): IOPort
hm2/hm2_7i93.0:     IO Pin 030 (P1-13): IOPort
hm2/hm2_7i93.0:     IO Pin 031 (P1-15): IOPort
hm2/hm2_7i93.0:     IO Pin 032 (P1-17): IOPort
hm2/hm2_7i93.0:     IO Pin 033 (P1-19): IOPort
hm2/hm2_7i93.0:     IO Pin 034 (P1-21): IOPort
hm2/hm2_7i93.0:     IO Pin 035 (P1-23): IOPort
hm2/hm2_7i93.0:     IO Pin 036 (P1-25): IOPort
hm2/hm2_7i93.0:     IO Pin 037 (P1-27): IOPort
hm2/hm2_7i93.0:     IO Pin 038 (P1-29): IOPort
hm2/hm2_7i93.0:     IO Pin 039 (P1-31): IOPort
hm2/hm2_7i93.0:     IO Pin 040 (P1-33): IOPort
hm2/hm2_7i93.0:     IO Pin 041 (P1-35): IOPort
hm2/hm2_7i93.0:     IO Pin 042 (P1-37): IOPort
hm2/hm2_7i93.0:     IO Pin 043 (P1-39): IOPort
hm2/hm2_7i93.0:     IO Pin 044 (P1-41): IOPort
hm2/hm2_7i93.0:     IO Pin 045 (P1-43): IOPort
hm2/hm2_7i93.0:     IO Pin 046 (P1-45): IOPort
hm2/hm2_7i93.0:     IO Pin 047 (P1-47): IOPort
hm2/hm2_7i93.0: registered
Found file(REL): ./custom.hal
task: main loop took 1.162696 seconds
hm2/hm2_7i93.0: error finishing read! iter=550334

Shutting down and cleaning up LinuxCNC...
Running HAL shutdown script
task: 74018 cycles, min=0.000018, max=1.162696, avg=0.010069, 1 latency excursions (> 10x expected cycle time of 0.010000s)
hm2_eth: HostMot2 ethernet driver unloaded
hm2: unloading

Enable Auto Login

https://wiki.debian.org/LightDM#Enable_autologin

Look up these lines in lightdm configuration file, uncomment them and customize to your preference.

[Seat:*]
#autologin-user=
#autologin-user-timeout=0

be aware that the comments look very much like the actual configuration, make sure to change the correct thing.

⚠️ **GitHub.com Fallback** ⚠️