Hi,
sorry for the long text in advance, but i want to explain in detail what my goal is...
I want to build a CNC mill/router/whatever with homemade dc servo motors and homemade encoders. I am currently using ordinary dc motors, controlled by an Arduino, which controls them with a PID controller according to the encoder input. That's all working well, but my arduino is a replacement for GRBL, which means i am doing all G-Code parsing and trajectory planning myself, which i clearly shouldn't be doing.
It's time to take it to the next level. I started writing a program, which acts like a PoKeys Ethernet device and talks to Mach3, but that is also not a permanent solution. In the best case i would want LinuxCNC to do all the work, realtime motion control and servo tuning and my homemade board would only forward signals to the dc motor drivers and count the encoder pulses.
Specifically, i want to make an STM32 based board, which LinuxCNC talks to in the following way:
"Hey, set motor X to 50% power and tell me where axis Y is right now. BTW, is the emergency button pressed?"...
If that's not possible because ethernet is too slow or something similar, i'm fine with PID controlling the servos myself, but i still want LinuxCNC to tell me the current positions and ask for the actual positions.
I do NOT want LinuxCNC or Mach3 or any other software to generate Step/Dir pulses, as the STM32 would need to count those, which is ridiculously unnecessary.
Is there a way i can let LinuxCNC talk like this to my homemade board, maybe over ethernet or Beckhoff EtherCAT or the parallel port?
Do i need to write a custom HAL driver for that or is there something available?
Is there something like an ethernet mesa card driver i can imitate, so LinuxCNC thinks it's talking to a mesa card, but is really talking to my own board?
And last, but not least, can all of this be done without buying extra hardware, so it only uses ethernet or the parallel port?
Sorry for the long text, any help or ideas appreciated...
Regards,
Florian