In the next stage, Charles designed a DB25 connected interface board, with pin-outs matching the P2 and P3 headers on a 5i25.
I finally got hold of one of these interface boards, courtesy of the surface mount component soldering skills of Bas de Bruijn.
There was a comparatively simple way for me to test its capabilities.
I already had a turret knee-mill in my workshop, that I had converted to Machinekit and which utilised a 5i25 and 7i76 Mesa combo.
I simply needed to unplug the DB25 lead from the 5i25 to 7i76 and connect instead to the interface board P2.
I was utilising an encoder on the 5i25 second header, so I connected this to the interface board P3.
- First steps.
I already had a SD card image built by Michael Haberler to run the board and program the FPGA.
( These images are now deprecated, use:
You will need package bmap-tools to write this to SD and verify.
Then use gparted to expand the second (rootfs) partition to the full size of the remaining space on the card.
You could also create a swap partition if space allows, then edit /etc/fstab to use this.
- Setting up the image
Michaels gist deals with how to do this, via a UART connection into something like CuteCom.
You need to enter any keystroke whilst in the first stage of boot, set the environment to include the MAC address and then trigger a reboot.
=> env default -a ## Resetting to default environment => setenv ethaddr ba:d0:4a:9c:4e:ce => saveenv Saving Environment to MMC... Writing to MMC(0)... done => reset
At the second boot you will get a terminal prompt,
default user is machinekit, password machinekit
Do a sudo apt-get update and install any extra packages you require,
but do NOT apt-get upgrade if you are using this image, because there is a later one, and upgrading will overwrite its components and I could not get that one to work.
The only changes I needed to make to my config for the mill were at the top of the ini and hal files
CONFIG="firmware=socfpga/dtbo/DE0_Nano_SoC_DB25.7I76_7I76_7I76_7I76.dtbo num_encoders=2 num_stepgens=4"
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES tp=tp kins=trivkins
loadrt hostmot2 debug_idrom=1 debug_modules=1
loadrt [HOSTMOT2](DRIVER) config=[HOSTMOT2](CONFIG)
NB. if you copy & paste from the sample config, note that tp=tp kins=trivkins is commented out in that config
The eagle eyed amongst you may have spotted that I specified encoders=2 in the config line
Each header on the 5i25 and thus the Nano, only has 4 stepgens and 1 encoder, what this does is effectively enable the second DB25 header output socket on Charles's interface board (equivalent to the header P2 on the 5i25) and the encoder.01 can be accessed from that.
I use the second encoder solely for a hardware pendant MPG on this mill, all the IO for the switches etc on that pendant go onto the 7i76 and are dealt with on the primary header.
It really was as simple as that.
I ssh'd into the Nano from another computer, using X forwarding
(ie. ssh -X firstname.lastname@example.org.XX)
entered the /home/machinekit/machinekit directory which houses the pre-built RIP build.
Invoke `machinekit`, select the relevant config and it worked seamlessly, just as it had before.
This is a major achievement by Charles Steinkuehler, Michael Haberler, Michael Brown and Devin Hughes in particular.
Much kudos to them all.