7c80 install on rpi 4

More
14 Oct 2020 01:05 #186048 by jimhurlburt
I've been using emc/linuxcnc for upwards of 20
years, but up till now I've been using stepconf to
do the setup. With parallel ports becoming a
pain, I decided to try a mesa card.

I'm using the image from LinuxCNC 2.8.0 Raspberry
Pi OS based on Debian 10 Buster

linuxcnc-2.8.0-pi4.zip
Wrote it to a sdcard and boots with no problems.

I bought a 7c80 and am finding that documentation
for install and configure is scarce and obscure.

I made a short ribbon cable which seems to work
properly.

sudo mesaflash --spi --device 7c80 --addr
/dev/spidev0.0 --readhmid

Works although if I have loaded hostmot2, I have
to shutdown and restart since the pi is powered
from the 7c80.

Ran mesaflash with 7c80d.bit It appears to have
worked properly.

The board responds to hostmot2.

halcmd loadrt hostmot2
halcmd loadrt hm2_rpspi
prints a plausible response from 7c80


Question 1. I plan to hook stepper drivers
directly to the 7c80. Is this the correct bitfile
for the job?

I created a .hal and .ini file with pnCConf choosing 7i76e.

I then changed all instances of 7i76e to 7c80 and
hm2_ether to hm2_rpspi in the hal file. hm2_spi
did not work.

Sort of works. Linuxcnc will start up but throws
a lot of errors. Will not run the standard logo file.

hm2/hm2_7c80.0: hm2_read_pin_descriptors: invalid port width 27

The only reference to this error I found was for
the 7c81 with an error for 19 pins and the
solution seemed to be to modify hostmot2 to allow
19 pins.

Since others seem to be running the 7c80
successfully, this doesn't sound like the good
solution.

Question 2. How do I cope with this error?

Question3. Is there someone who would share
copies of hal and ini files for a xyz(a) stepper
machine using rpi4 and 7c80. If there are any
posted on line I haven't found them yet.

Thanks in advance,
Jim Hurlburt
Bend, OR

Please Log in or Create an account to join the conversation.

More
14 Oct 2020 01:27 - 14 Oct 2020 01:27 #186050 by PCW
Replied by PCW on topic 7c80 install on rpi 4
Pretty sure you need LinuxCNC 2.9 or a recent 2.8 to run the 7C80
Last edit: 14 Oct 2020 01:27 by PCW.

Please Log in or Create an account to join the conversation.

More
14 Oct 2020 05:42 #186065 by jimhurlburt
Replied by jimhurlburt on topic 7c80 install on rpi 4
it's the stable release of 2.8 from linuxcnc.org. Does it need to be further out than that?
If so what would you suggest.

Please Log in or Create an account to join the conversation.

More
14 Oct 2020 06:16 #186070 by jimhurlburt
Replied by jimhurlburt on topic 7c80 install on rpi 4
hostmot2 is version 0.15.
I spent a while trying to find if there is a newer version out there and found little or nothing.
I was unable to find what the current version would be on github.

Any clues? Comments?

Please Log in or Create an account to join the conversation.

More
14 Oct 2020 15:50 #186102 by PCW
Replied by PCW on topic 7c80 install on rpi 4
You probably need 2.9 (master)

Please Log in or Create an account to join the conversation.

More
14 Oct 2020 18:45 #186119 by jimhurlburt
Replied by jimhurlburt on topic 7c80 install on rpi 4
I'll try building a 2.9 version and let you know how it goes then
Thanks

Please Log in or Create an account to join the conversation.

More
20 Oct 2020 00:13 #186637 by jimhurlburt
Replied by jimhurlburt on topic 7c80 install on rpi 4
I have it running. Steppers turn in a plausible fashion. No smoke.
Next thing I have to do involves some serious construction so it will take a while before the next post.

What I did that worked.

I created .hal and .ini files with pncconf on a 2.8 install, selecting the 7i96 board.
I then changed all instances of 7i96e to 7c80 in the hal file
I changed the line
loadrt hm2_ether ... (not certain about the spelling of ether but something along that line.
to
loadrt hm2_rpspi config=" num_encoders=0 num_pwmgens=0 num_stepgens=6"

Using mesaflash I loaded 7c80d.bit

Per pwc's advice, after a number if trys that didn't work.
I did a clean write to a sdcard of linuxcnc-2.8.0-pi4.zip from this site

I ran
git clone git://github.com/linuxcnc/linuxcnc.git linuxcnc-dev

sudo apt-get install build-essential autoconf
libpth-dev libglib2.0-dev libgtk2.0-dev tcl-dev
tk-dev bwidget libreadline-dev python-tk
python-dev libgl1-mesa-dev libglu1-mesa-dev
libxmu-dev libudev-dev libmodbus-dev
libboost-python-dev libboost-serialization-dev
libboost-thread-dev libusb-1.0-0-dev libtk-img
blt-dev tclx mesa-utils libreadline-gplv2-dev
intltool yapps2

I then ran dpkg-checkdeps and installed everything else it wanted.

After doing that, the rest of the build process from the "building linuxcnc from source" page worked and I had a version of 2.9 pre0 that runs.

It will load the hal and ini files, and after hooking up the stepper motors, they run in a plausible fashion.
At the moment, the steppers aren't driving anything. When I get the next step or three done and have the steppers making the machine move and have a bit of testing and tuning done I will post a followup for others that may be trying to do something similar.

Jim

Please Log in or Create an account to join the conversation.

More
13 Dec 2020 19:56 #191898 by jimhurlburt
Replied by jimhurlburt on topic 7c80 install on rpi 4
Warning to others working on this setup -- The y
and y2 home switches do not work with the hal and
ini files attached. I haven't attempted to do the
x and z home switches.

I have a xyyz configuration running and am working
on home switches. The machine is a gantry setup
with a 4ft wide x axis and two motors on the y
axis.

Hal and Ini files attached.

I have the 7c80 powered by a 12V meanwell
powersupply. Linuxcnc 2.9.0 pre0 is running and I
can run gcode files in the sim setup w/o problems.

I have two home switches for the ends of the Y
axis hooked to tb1-2 and tb1-3 (input1, input2)

I have 12v+ hooked to tb2-1, home switches hooked
to tb1-2 & 3, thence to 12v-.

snippit from hal file
# --- HOME-X ---
net home-x <= hm2_7c80.0.gpio.000.in

# --- HOME-Y ---
net home-y <= hm2_7c80.0.gpio.001.in

# --- HOME-Y2 ---
net home-y2 <= hm2_7c80.0.gpio.002.in

# --- HOME-Z ---
net home-z <= hm2_7c80.0.gpio.003.in
*
*
*
net home-y => joint.1.home-sw-in
*
net home-y2 => joint.2.home-sw-in

When I put a voltmeter on my limit switches, I get
10.5 volts with the switch at rest, 0 when
activated. (Normally open switch)

Attempting to test the home switches, I home the x
axis (joint0) which does not have a home switch
enabled. Seems to work as expected.

Click on home for joint 1 (y axis) and joints 1 & 2
start moving on the DRO. Activating the home
switches manually has no effect that I can see.
On the dro, the joints continue to move.

I have attempted to use hal scope and so far can
see no response to moving the switches.

It seems likely that the problem is in the lines
above in the hal file.

Any notion of what I am doing wrong and how to
correct it? Other tests I might make to
troubleshoot?

Thanks in advance,
Jim Hurlburt
Bend, OR
Attachments:

Please Log in or Create an account to join the conversation.

More
13 Dec 2020 20:25 - 13 Dec 2020 20:29 #191902 by PCW
Replied by PCW on topic 7c80 install on rpi 4
The isolated inputs on a 7C80 would be

hm2_7c80.0.inmux.00.input-00
hm2_7c80.0.inmux.00.input-00-not
...
hm2_7c80.0.inmux.00.input-23
hm2_7c80.0.inmux.00.input-23-not
Last edit: 13 Dec 2020 20:29 by PCW.

Please Log in or Create an account to join the conversation.

More
14 Dec 2020 00:51 #191927 by jimhurlburt
Replied by jimhurlburt on topic 7c80 install on rpi 4
That worked. How -- intuitive?

Where might I have found the necessary syntax and names besides asking you?

That gets me to the next step which is making the actual hardware move as it should. Will likely take a week or more, I have some construction, then a lot of adjusting to do.

Thanks very much for the quick answer,
Jim

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.118 seconds
Powered by Kunena Forum