Mesa card emulation in microcontroller

More
20 Mar 2021 18:08 #203003 by nickom44
Hello All,

Has anyone experience with creating an emulation of the Mesa card on a microcontroller? I'm not expecting to be able to do actual stepgen at this stage.

From what I understand, and its all a bit confusing at the moment.

Traditionally Motion (within Linuxcnc) would use a stepgen to drive Parallel port pins.

But on a Mesa there is a driver interface in between maybe something like this:


Linuxcnc load the driver from the.hal file, then communicates with Mesa card to get its config; Linuxcnc then treats the external device as if its physically connected.

Any help is really appreciated
Nick
Attachments:

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

More
20 Mar 2021 18:56 #203011 by robertspark
why do you want to emulate it.... the hardware is not expensive compared to other motion controller offerings in the market?

I'd suggest going to the MESA website and downloading a manual as all is explained within the rear section of the manuals as to what packets it is looking for and how it uses them to control the various elements.

I'd suggest looking at something such as a MESA 7i76E/ED or 7i96 or 7i92 as they are ethernet cards.

store.mesanet.com/index.php?route=produc...83_85&product_id=290

ROUGHLY: All motion (step and direction) signals are offloaded to the mesa card which is sent to the mesa card from the planner and the mesa HAL component which interprets the motion controller packets and formats them the way that the MESA hardware requires them.

Just buy a card...... no emulation required! Plug it in, set it up, done.....

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

More
20 Mar 2021 20:09 #203025 by nickom44
Thanks Robert,

I have an Arduino working over ethernet working ok, latency seems ok approx 2 Millisecond without optimising the setup, I would like to see if I can the send motion msgs to the arduino , but i'm struggling to find out how to do it. My plan is then to offload the actual motion on the micro to an external step generator, maybe a DDS or something like that, maybe connecting these to the micro over I2C .

Any help is really appreciated
Nick

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

More
20 Mar 2021 23:16 - 20 Mar 2021 23:18 #203063 by BeagleBrainz
Not meaning to sound like a downer or rain on your parade or sound like someone being sour at what they can't do themselves.

With latency twice the servo thread you'll need to do some work there.

What you are proposing seems to be a slower way of doing what the mesa FPGA does.

Whilst intellectually it is an interesting project, I don't think it at the end of the day it would be a cheaper or more efficient way of doing things.

I think it might be best to work within the logic & framework of the existing hostmot2 driver. Or at least have a really good look at the hostmot2 code.

Anyways good luck. :)
Last edit: 20 Mar 2021 23:18 by BeagleBrainz.

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

More
21 Mar 2021 09:07 #203089 by nickom44
It really is just an exercise in understanding how this all works at this stage. I already use GRBL and G Code sender for a coil winder and it works really well.

From an architecture point of view separating the 2 time domains, Hard realtime (Stepgen) ,and OS scheduled commands sending buffered Gcode commands seems to be sensible.

The main limitation as you called it out is the latency on the Ethernet side of things and from what I can see the Mesa card doesn't really impact this other than process the command from linuxcnc and sending the response very quickly. Ethernet has a built-in latency that cannot be reduced other than reducing the sending, receiving, processing time as much as practically possible. (not ignoring point to point ethernet rather than through a switch) This is where the FPGA really helps.

Really appreciate your comments

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

More
21 Mar 2021 09:57 #203093 by robertspark
don't forget that the FPGA runs much faster than the microcontroller as the FPGA is not fixed to devices and is very code efficient and fast at processing digital signals through logic gates where as an Arduino (any microcontroller) requires many clock cycles.

if you were using this Arduino device, then that is another matter, but it's not very time or cost effective as other devices are available
store.arduino.cc/arduino-mkr-vidor-4000

(I know zero about FPGAs other than they are a totally different animal to microcontrollers and very code efficient, fast and flexible where as with microcontrollers you are fixed to internal devices requiring many clock cycles to transfer data and interpret it). grbl does not run very fast as I understand it (stepper speed that is).

I use marlin on my 3d printer but even that is using a 32bit / 150mhz chip and and uses inteligent (uart) stepper driver chips TMC2209 (I think) that do all their own processing and are not bit banging.

$119 + shipping, done (including breakout board (higher voltage and current than a native Arduino board would handle)
store.mesanet.com/index.php?route=produc...oduct&product_id=311

$89 + shipping, done .... more I/os than a run of the mill Arduino Uno/ mini/ micro)
store.mesanet.com/index.php?route=produc...83_85&product_id=303

no development time, little bug potential.

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

More
21 Mar 2021 11:01 #203105 by BeagleBrainz
If I have got things right, there appears to be a synthesised mcu core in the Mesa implementation.

I was originally going to use the 7i92 with a common BOB, but then I got a 7i76, then a 7i73 and 7i83. Probably way more than I need, but meh.

There is GRBL Advanced that runs on a STM32F411 Nucleo Board. Which looks interesting if you swing that way.
github.com/Schildkroet/GRBL-Advanced

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

More
21 Mar 2021 11:19 #203106 by nickom44
At the UDP data rate, the microcontroller should be capable of keeping up, actually, you would probably have to slow it down to minimise the risk of MAC collisions, and I think the messages would be coming in too fast for linuxcnc to process

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

More
21 Mar 2021 11:20 #203107 by nickom44
Thanks, I'll take a look

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

More
21 Mar 2021 12:14 #203112 by kwarup
i do not know if is this what you are looking for..

github.com/dlhenke/linuxcnc-esp32

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

Time to create page: 0.124 seconds
Powered by Kunena Forum