PDA

View Full Version : Help!, request: Example HAL for a Mesa (7i76E) spindle encoder set-up



Doddy
02-01-2020, 09:42 AM
I know there's a couple of LinuxCNC gurus here, if anyone can help with advice to stop me doing my noggin in...

Basic config: Lathe, LinuxCNC (2.7.14, Debian 9 Stretch install). Mesa 7i76E controller.

I've added a spindle encoder to the machine with 36 detents and an index pulse - standard A/B/Index (differential drive).

26979

(plenty of naked boards going free if anyone is interested - pm me)


I do have a problem getting a working config to read RPM from this. What I'm really asking for is any example HAL file for a Mesa-based spindle encoder. My existing HAL is so far removed from the Mesa configuration wizard format that I'm hacking the HAL directly.

Where I've got to so far is examining the HM2 Encoder component and the resolved velocity, but that seems to increment until the index pulse is received then resets and so-on. I've included the Encoder component as a thread into the HAL, but I think that's an error on my part by mixing LinuxCNC components from the Mesa FPGA functions. I'm randomly cut/pasting examples into my HAL from the internet where similar questions on dissimilar hardware is being discussed and worried that I'm adding more bloat/non-functional content into the HAL.

So, if anyone has a similar setup and a working HAL for a Mesa board I'd be grateful if you can post details here.

Also, related, using the Axis front-end, one rabbit hole I got locked in yesterday was trying to display the RPM - using cut-paste code. Am I right in thinking that you need to add a XML panel to the Axis configuration to include the spindle-speed as a displayable quantity? Again, this is newbie stuff but there are so many examples in the wild that present information without explaining the LinuxCNC interdependencies. I'm consciously backtracking out of that rabbit hole for now until I'm confident that I have a RPM value that I want to display.

Muzzer
02-01-2020, 10:19 AM
Have you posted this question on the LinuxCNC forum? That seems the first place to ask.

Clive S
02-01-2020, 02:51 PM
Am I right in thinking that you need to add a XML panel to the Axis configuration to include the spindle-speed as a displayable quantity? A

Yes you use some XML code to get a VCP panel on the gui in axis. Pm sent.

Doddy
02-01-2020, 03:12 PM
Many thanks Clive - It would appear there's numerous learning curves attached to LinuxCNC and any one of which can result in start-up exceptions being thrown. Your answer for the XML helps me to disregard that aspect of displaying data for now until I understand the fundamentals better. Thanks for the PM - I'm going through that now whilst the shed warms up.

Mike