Issues with Raspberry Pi4 and Mesa 7i96

More
02 Nov 2023 20:30 #284374 by mrcrankyface
Hello!

By issue I mean I'm most likely the problem and am just not seeing what's wrong.
First time ever using Linux and LinuxCNC so could be really obvious things, maybe we'll find out.

First issue:
Pncconf won't let me change a stepgen to pwmgen which I need to control my VFD.
I have this quote I've saved from somewhere, probably from this forum.=10.0pt"To load 7i96d_1pwm.bit you would need to fetch the 7i96.zip archive from Mesa,
extract the 7i96d_1pwm.bit bitfile and run these commands:
mesaflash --device 7i96 --addr [the cards current ip address] --write 7i96d_1pwm.bit
mesaflash --device 7i96 --addr [the cards current ip address] –reload" I'm guessing that's just something I write into the terminal thing? I'm so used to Windows so this is abit out of my depth.

Second problem:
In the configurator, when testing the axises/motors, nothing moves. I click enable and run but nothing happens. Do I need to do something more?

Third problem:
Possibly the cause of my second problem, who knows.
After finishing the pncconf I tried starting LinuxCNC but it refuses. This is the error message it throws:
File Attachment:

I'm guessing the main issue here is the "could not retrieve hardware address ..."
I'm fairly sure I've configured the Mesa card to respond to 10.10.10.10 but seems it's not working? I tried "ping 10.10.10.10" in the terminal but nothing happens for maybe 20 seconds after which I got "From 46.59.119.34 icmp_seq=14 Packet filtered" which seems like a weird response to a ping?

By chance I noticed that mousing over the wifi symbol in the taskbar shows some more info. This shows me that wlan0 is connected to our home wifi whilst eth0 is "Configured 169.254.201.82/16" which also seems wrong. It should show 10.10.10.10?
I did not manage to find anywhere I could manually set this(like the TCP/IP settings on Windows)

This is the Mesa card, as far as I can tell, the jumpers next to the "Power in" at the bottom right should be set to 10.10.10.10.


Any guidance on this would be much appreciated!

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

More
02 Nov 2023 20:57 #284376 by chris@cnc

By chance I noticed that mousing over the wifi symbol in the taskbar shows some more info. This shows me that wlan0 is connected to our home wifi whilst eth0 is "Configured 169.254.201.82/16" which also seems wrong. It should show 10.10.10.10?
I did not manage to find anywhere I could manually set this(like the TCP/IP settings on Windows)

 

The cause of the mess is that the network is not configured correctly.
I suspect that the IP in eth0 is still set to DHCP. And no, if your 7i96 is called 10.10.10.10, your computer must have a different IP.  Maybe 10.10.10.1.
You can set it by right-clicking on the network symbol in the settings. Or you can look here for relevant posts:
forum.linuxcnc.org/forum/search
as a search term perhaps interfaces. There you will find a lot to adjust your settings.
The following user(s) said Thank You: mrcrankyface

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

More
04 Nov 2023 18:10 - 04 Nov 2023 18:21 #284552 by mrcrankyface
Yep, should've realized that way earlier, the clash of IP addresses.
Been trying to sort this out for the last few hours...

Incase the raspberry was outdated I tried running sudo apt-get update and sudo apt-get upgrade but only gave me some "see apt-secure(8) manpage" error.
Whole bunch of googling to find that "apt-get update --allow-releaseinfo-change" solved it. Could finally install all updates.

A whole lot more googling to find out how to set the ip properly.
Added the lines 'interface eth0' and 'static ip_address=10.10.10.11/8' after using 'sudo nano /etc/dhcpcd.conf'.
Now I could finally ping the mesa card and get a good response!
I've tried setting this before in the GUI but didn't seem to work, granted I may have done something wrong without realizing.

So after that I've struggled for quite a while trying to install 'Mesa configuration tool 2', took me a loooong while to see that it doesn't work on raspian 10. Still not sure how to get around that.
Trying to understand how this works. Raspian10(Buster) is based on Debian10 and is basically the operating system?
LinuxCNC gets installed with the OS and is somehow bound to it and not just a "regular program"?
The image I downloaded from linuxcnc.org/docs/stable/html/getting-st...etting-linuxcnc.html is raspian10 hence doesn't work with the MCT2. 
linuxcnc.org/downloads/ links to LinuxCNC 2.9.1 based on 'raspian 12' so that could work but then requires some experimental kernel(which I have no idea what it is)?


Downloaded the zip of configs from mesa's website hoping maybe I can use that and not need the MCT2, that's my current step, trying to flash the one with a pwm output... To be continued.
Last edit: 04 Nov 2023 18:21 by mrcrankyface.

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

More
04 Nov 2023 19:36 #284558 by PCW
If you cannot get mesact to work, what I would do is
run pncconf but select 7I96S instead of 7I96
This will allow you to setup the spindle PWM

To get a working configuration for a 7I96, you now just need to
change the card name in the ini file from 7i96s to 7i96
The following user(s) said Thank You: mrcrankyface

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

More
04 Nov 2023 21:54 #284571 by rodw
Use the raspberry pi image for 2.9.1 on the downloads page. There is nothing experimental about it. It uses the official Raspberry pi kernel and Debian Bookworm and linuxcnc 2.9.1

2.9.1 is in the process of being released so some parts of the website still need updating but the downloads page is solid. the image follow on from an installer I built which has been available on the forum here for a while.
The following user(s) said Thank You: mrcrankyface

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

More
04 Nov 2023 22:59 #284578 by mrcrankyface
Stubborness pays off apparently. 
Managed to flash the mesa card using:
mesaflash --device 7i96 --addr 10.10.10.10 --write 7i96d_1pwm.bit
mesaflash --device 7i96 --addr 10.10.10.10 --reload

and then adding:
setp hm2_7i96.0.pwmgen.pwm_frequency 10000
setp   hm2_7i96.0.pwmgen.00.scale 1600 #max rpm
net spindle-output hm2_7i96.0.pwmgen.00.value
net spindle-enable hm2_7i96.0.pwmgen.00.enable
setp hm2_7i96.0.pwmgen.00.out0.invert_output true

Ontop of this I have a PWM to 0-10V module so step- of the pwmgen goes to the pwm module and then on to the VFD.
In the main hal file(if I remember correctly) I changed to 1 pwm gen and 4 stepgens.
I suspect this is the same result as selecting 7i96S and renaming it afterwards
Things seem to work now except VFD won't go into "gear", speed changes according to 'M3 Sxxx' commands if I manually ground FWD or REV on the vfd.

I can tell on the mesa card that it is switching output2 and 3 as it should, but something about my wiring must be off.
VFD ground is the same as the Mesa cards ground to make sure they're on the same level.
I'm guessing that maybe the lack of voltage difference could cause issues with SSR's or maybe I need a pullup resistor if the levels are possibly floating around a bit?


Will give 2.9.1 a try in the future! 
Attachments:

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

More
05 Nov 2023 19:28 - 05 Nov 2023 23:01 #284656 by mrcrankyface
Managed to sort the REV/FWD issue out. I think Output1 is stuck on, no matter polarity it instantly grounds my signal cable.
Changed over to use Output 4 and 5 instead, works fine now!

Next problem that has me quite stumped.
I've set my drivers to 1600 steps per revolution. They're geared 2:1(motor:screw) and for Z it uses a 5mm/rev screw.
This should equal 3200/5 = 640 steps per millimeter.
I however need to input 16000 steps to get a millimeter of movement. 
Similar on X where I need 5000 steps but should need 800.
Need to have a good long think about what could cause this.
Last edit: 05 Nov 2023 23:01 by mrcrankyface.

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

More
05 Nov 2023 23:24 #284669 by mrcrankyface
Well, user error is the fault. Long story short, the switches were not correct hence my steps were not correct.
Got that and a few other things fixed and now my lathe is up and running! Thanks for the help!
The following user(s) said Thank You: tommylight

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

More
25 Nov 2023 19:19 #286488 by mrcrankyface
Back at it. Was trying to use G71 but seems it didn't exist in the version I had installed.
This pushed me to install "linuxcnc-2.9.1-bookworm-rpi4.img.xz" from linuxcnc.org/docs/html/getting-started/getting-linuxcnc.html.
After having a bunch of issues(seems menu-config didn't correctly set locale) I managed to get it semi-working.

New problem is I'm getting "hm2/hm2_7i96.0: error finishing write!" which seems to make the mesa card throw an error and stop working.
This happens within a minute of starting LinuxCNC but also happens if I test the axis in PnCConf.
Only change here is that I've upgraded to 2.9.1, previously it worked fine even after an hour. So I suspect it's software related.

I've been searching the forum and found some threads but I'm not understanding things.
-From what I gather this could be due to latency spikes in the network communication?
-A possible 'fix' is to change what kernel I'm using, but how do I change kernel?
-Another thing I've seen mentioned is to increase servo period but does not seem to fix the issue?

Any help is much appreciated as I'm yet again stuck so close to the finish line.
 

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

More
25 Nov 2023 20:18 #286496 by PCW
You may have lost some latency reducing setup when you upgraded

On the RPI4 I think isolcpus 2,3 and force turbo mode are usually required

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

Moderators: cmorley
Time to create page: 0.143 seconds
Powered by Kunena Forum