Message: previous - next
Month: June 2019

Re: [trinity-users] Re: RPi + TDE + 7i90HD

From: Gene Heskett <gheskett@...>
Date: Thu, 13 Jun 2019 07:05:53 -0400
On Thursday 13 June 2019 04:17:27 am Nikolaus Klepp wrote:

> Hi Gene!
> Anno domini 2019 Fri, 24 May 08:56:41 -0400
>  Gene Heskett scripsit:
> > On Friday 24 May 2019 04:48:50 am Dr. Nikolaus Klepp wrote:
> > > Hi Gene!
> > >
> > > (This is not directly a TDE question, so it might be of no
> > > interest to a lot of readers, but anyway ...)
> > >
> > > If I recall correctly, you have mentioned somewhere that you have
> > > a RPi + TDE + 7i90HD running. Yesterday a 7i960HD ended up on my
> > > desk. Now I want to build a new CNC with RPi + TDE + 7i90HD, but I
> > > am stuck at how to flash the correct firmware to the card. I
> > > understand that I need mesaflash to  flash 7i90_spi_svst4_8.bit
> > > (
> > > from a pc via what? Centronics cable? Do you have a link to the
> > > needed cables? And maybe a working linuxcnc configuration?
> > >
> > > Nik
> >
> > i bought a roll of 26 wire cable and a bunch of connectors 26 on one
> > end and db25 on the other, and then discovered /I had to peel one
> > wire off the far edge of the cable.  So it fits the parport on the
> > pc, and the 26 pin socket on the 7i90.  I'd had some cable failures
> > since, 2 or so, mainly from inadequate smunch when assembling the
> > cables.  I have never used the terminator board for a mesaflash
> > session, but you'll need one at the pi header.  Get it from OSHPark,
> > Jon at Pico systems can give you the oshpark part number. 3 of those
> > is less than a tenner. You'll need 3 little grain of sand surface
> > mount 120 ohm resistors per board, a  40 pin shrouded male connector
> > that fits the pis header on one side of it and a 26 pin shrouded
> > male socket on the other side. The termination is simple, src term
> > but does allow slightly longer cables, but I mounted a fan from a
> > video card under the pi and mounted it upside down so the heat sinks
> > are right over the fan. Turning the pi upside down put the pi's gpio
> > hearder on the lower edge, which allowed me to use a cable about an
> > inch long.
> >
> > Now, the 7i90 is a 3 volt card, and ANY noise will blow things.  So
> > get 3 7i42TA's, a 6 pack of 50 pin scsi connectors to fit the
> > sockets on the 7i90HD, and a hunk of old 50 wire scsi cable you can
> > cut up to hook the 7i42TA's to the 7i90. The 7i42TA's contain the
> > noise absorbers that protect the 7i90HD, allowing the 7i90HD to work
> > in 5 volt circuits, and they give you rows of the green screw
> > terminals to greatly simplify hooking all this up.  I made a stack
> > useing most of a standoff kit and stairstepped them on top of the
> > 7i90HD, so none of my 50 wire cables are over 5" long.
> >
> > I've got a hal file from hell, lots of gingerbread and have made a
> > much slower thread than 1 khz servo-thread, something in the 100 to
> > 200 hz range is working well and I put all the hand controller stuff
> > in that thread, else the servo-thread would be too long to make 1khz
> > work. TDE I always figured needed more iron than a pi had to spare,
> > so mine is still running the default raspian xfce4 for a gui.  With
> > only a gig of dram, my thinking was that the pi would get bogged
> > down in swap. Video refresh in real time is but a dream, 5-7 frames
> > at best using xfce4. You do eventually get used to it.
> >
> > You'll need to locate a 3.4-9-rtai-686-pae=3.4.0 kernel and mark it
> > with a *hold to keep apt from replacing it. It has one major bug, so
> > the first thing you do after bootup is find the keyboard/mouse
> > setting uttility in the menu, and make a change so it will be saved
> > so that key repeat is limited to 15 cps or so. It boots up at about
> > 1500 cps and that floods the usb port nearly everything but the spi
> > and wifi goes thru to get to the outside world. Put bluntly, that
> > causes the pi to lose key-up events, leaving the machinery you just
> > jogged, jogging until you hit the key quickly, sending a keyup
> > before the repeat kicks in or it hits something.  Thats broken quite
> > a few carbide tools by running then into the workpiece when the
> > spindle isn't turning.  There are a couple later kernels, but they
> > all have this same bug. They may work now that we know how to fix
> > it. Until the after boot thing is done, use very quick pecks on the
> > keys.
> >
> > How big is the lathe?  And how will you drive the spindle?  I toured
> > the local recycle places and found a pair of 1hp 3 phases on a 50
> > year old air compressor that came in from the local horsepistol
> > during a remodel, and a 50 dollar bill got the hoses unfurled to cut
> > them off the pads. I ordered bearings and replaced them in one
> > motor, saveing it as a spare, and put the other on the end of the
> > cables from a 1.5 horse rated vfd, and have a 30 amp corfam brick
> > wall filter near the vfd output and another at the vfd's input, and
> > radiated noise has not been a problem. I used a mesa spinx1 to
> > translate the pwm to analog controls for the vfd. I can run this
> > motor at 10hz with this vfd for around an hour before I need to let
> > it cool. Obviously I set a current limit in the vfd to not exceed
> > the motors FLA, and its all Just Worked.
> >
> > Having spare i/o's, so I also have a pair of 40 amp SSR's rigged to
> > turn off all motor power when motion is disabled by the F2 key.  So
> > I can leave power on the pi full time. I also have a pair of the
> > MPJA dials mounted on a replacement apron, and thats more
> > gingerbread x2 in the hal file, but that gives me a 5 speed jog that
> > works just like the hand cranks used to for manual control. Down to
> > .0002" per click.
> >
> > My compound was smashed by a fallover sometime in its pre-gene
> > history, so its a solid block of cast iron carved from a free sprue
> > from the foundry that makes wheels for whites large cars (they are
> > here in town) now (linuxcnc _is_ the compound as it can drive both
> > to get any angle you need to a higher accuracy than you could ever
> > set a compound to, so neither of my lathes have a compound today.)
> >
> > The same fallover that broke the compound, came to a sudden stop
> > hard enough that the weight of a mounted chuck bent the spindle just
> > a tad so I had to regrind the MT5 in it by about 5 thou, and regrind
> > the backplates to get the chucks running true again. And I've put
> > screw comp in the hal to compensate for most of the bed wear,
> > diddling X by up to 3 thou depending on Z position.  So I can turn a
> > pretty good cylinder now. I've also made clamps to prevent
> > unscrewing a chuck with the belt yelping turnaround's that rigid
> > tapping demands. Turning around a 40 lb chuck at 250 revs takes
> > quite some power. :)  I've got some hal to tell me how far it
> > travels AFTER the reversal command has been given, and I shorten the
> > tap depth in the G33.1 accordingly.
> >
> > I hope some of this saves you some time and headaches in running
> > machinery with a pi.
> >
> > *hold, here is the contents of my /etc/apt/preferences.d/kernel.pref
> > file:
> > ================================
> > Package:linux-kernel
> > pin: version 4.4.4-rt9-v7+
> > Pin-Priority: 1001
> >
> > Package: linux-headers
> > Pin: version 4.4.4-rt9-v7+
> > Pin-Priority: 1001
> >
> > Package: raspberrypi-bootloader
> > Pin: version 1.20170427-1
> > Pin-Priority: 1001
> >
> > Package: raspberrypi-kernel
> > Pin: version 1.20170427-1
> > Pin-Priority: 1001
> > =================================
> >
> > Good luck Nik.
> >
> > Cheers, Gene Heskett
> How did you get the firmware onto the 7i90? Is there a commandline
> switch for the mesaflas-program to tell it to use the correct
> /dev/tty?
Thats a one way street Nik. The 26 pin connector is the parport interface 
used to program the 7i90 but if you program it for spi, you must power 
cycle the card to put it into effect after which you'll need the adapter 
and terminator card to make the cable interface jumper from the pi's 
gpio connectors to the 7i90. Recommended by gene as its faster than the 
parport, which has a maximum bandwidth of no more than 5 megabytes/sec.
And while building a new master 2.9.0-pre0
The spi, from rpspi.ko, is faster, writing 32 bit packets at 42 
megabits/sec, and reading the responses from the 7i90 at 25 
megabits/sec. My cable is about 2" long, the pi is upside down so the 
pin order matches, and long standoffs with a video card fan blowing on 
all the heat sinks. Stable, uptimes from power bump to power bump.

If you want to revert a 7i90 to a parport once programmed for spi, there 
is a jumper that must be moved, powered up, and moved back after 
powerup.  I've done it once, it worked. See the docs, mine are currently 
in the machines tool drawer in the garage.  Docs are available at Peters 

> BTW, this nice device will only drive only a lot of RC servos dor an
> adaptive mirror assembly, so I'm quite sure it will work as intended.
> Next thing for CNC will be a 7i76e :)

That variation I have no experience with. I've used 2 of the D versions, 
which sink an external signal to enable. Works well. In fact I've rigged 
some medium sized rail mount relays to control the spindle pump, the air 
valve for the mister, and the lights over the machine when either the 
spindle is on, or machine motion is enabled.  Neat, I can shut down lcnc 
and walk away as nothing is powered but the computer and inferface box. 
I need to do the same to the light over the lathe too. Just have to find 
my round tuit. That way the switch on the 4 square can shut off the pi 
and interface, and fireing up the pi and starting lcnc will control it 
all.  Should save around 50 watts of 24/7 power that way.  I don't mind 
turning off the pi, but anything with spinning rust in it runs 24/7 
here. Drives last till the rapture that way.

Have fun Nik, I am building a new master for my pi as I type. But there 
apparently no way to skip the foreign languages I don't read or speak, 
buildpackage just bailed out, couldn't find the french, cryllic, polish, 
& spanish translations, damn.  And I didn't want to load up the u-sd the 
pi boots from with all that tex stuff, probably 3 to 4 gigs worth.

> Nik

"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <>