Other ways to interface with LinuxCNC
I suspect its not clear to you that Linuxcnc IS_THE_MOTION_CONTROLLER so everything to do with motion happens on the PC, not on an external board.In many of my projects, having a fully featured CNC controller core like LinuxCNC (with trajectory planning, PID tuning, homing cycles, etc...) would be very useful and I am not aware of LinuxCNC alternatives that are this advanced.
Please Log in or Create an account to join the conversation.
- HerrNamenlos123
-
Topic Author
- Offline
- New Member
-
- Posts: 17
- Thank you received: 2
I think I am close, actually, I wrote a HAL component using a .comp file, compiled with halcompile, and loaded using loadrt. I can already manipulate position commands and axis velocities in C, which is exactly what I wanted. Now, (given that the Arduino connection can keep up of course), will this be just as fast as any other hardware, allowing for high-precision motion, or is this halcompiled realtime component still slower than a real parallel port?
Please Log in or Create an account to join the conversation.
- HerrNamenlos123
-
Topic Author
- Offline
- New Member
-
- Posts: 17
- Thank you received: 2
I think my back story would help you understand my projects. In the past years I build CNC mills by doing EVERYTHING myself, using salvaged motors, hand-made encoders, and writing a custom GRBL clone because GRBL does not support real servo motors, only stepper hybrids. So I did everything myself, including G-Code parsing, trajectories, PWM generation, etc. Not the best, but it worked.
What I am hoping from LinuxCNC is that it will be a step up, by moving the core logic from the Arduino to the PC, while keeping the hardware almost identical. Having anything to do with ready-made Mesa cards or anything like that would be a step back from the perspective of my projects since my goal is not to simply have a working machine, my goal is to BUILD the machine. (as cheaply as possible).
EDIT: Oh right, to explain what I meant with controlling anything: I was talking about homemade servo motors. Plugging a bought servo into a servo card would be boring
![:) :)](/media/kunena/emoticons/smile.png)
Please Log in or Create an account to join the conversation.
The FPGA options I mentioned, including Mesa (here we have etherent, EPP and SPI interfaces for coummunicating from Linuxcnc, then the FPGA can extend this via SmartSerial interface and some others), are very configurable, and to be honest if you use the Mesa supplied hardware there are just 2 files that need editing. Using a generic Spartan 6 board it comes to 3, as you need to create a pin file to suit the hardware.
Litex-cnc (initially ethernet, but a SPI interface is being talked about). Linuxcnc-RIO (this can be via SPI or an Etherent to SPI bridge) & LiteHm2 (etherent) only really require editing a single config file for the hardware.
There's nothing to stop you adding extensions to the FPGA solution if you are fluent in VHDL or Verilog (there is a guy that used a Mojo board and added a plugin to talk to the on board MCU to get analogue readings). That is something you may not be, but then again not everyone can program an Arduino.
Give it a shot, but just make sure that you aren't trying to reinvent the wheel, so to say.
Please Log in or Create an account to join the conversation.
Linuxcnc still talks to the parallel port via a realtime component\driver. Each external piece of hardware as their own realtime component\driver that is used for back & forth communication. Before jumping of the deep end I suggest a read of the docs maybe an idea. Almost all of the hal components are described.I am aware of that, which is why I would probably use an SPI Ethernet board to communicate with the Arduino. But the point is that it does not need to be an Arduino, as soon as the program works.
I think I am close, actually, I wrote a HAL component using a .comp file, compiled with halcompile, and loaded using loadrt. I can already manipulate position commands and axis velocities in C, which is exactly what I wanted. Now, (given that the Arduino connection can keep up of course), will this be just as fast as any other hardware, allowing for high-precision motion, or is this halcompiled realtime component still slower than a real parallel port?
Please Log in or Create an account to join the conversation.
- HerrNamenlos123
-
Topic Author
- Offline
- New Member
-
- Posts: 17
- Thank you received: 2
When forgetting about all bad ideas in my head and facing the reality, I have a homemade CNC mill that was build for almost no money at all, constisting of DC motors with handmade encoders, hand soldered pcbs, DC motor drivers, and an Arduino that is running a custom GRBL clone, closing the loop on all 3 servos, and the GCode is streamed via USB via Universal G-Code Sender. (realtime not required as the PC only sends G-Code in advance). It might sound really sketchy and it is, but given the circumstances it works amazingly well and I already milled amazing parts, while having spent close to zero money for the machine.
This is the reality. Now, ideally i would like to upgrade this by putting LinuxCNC on the PC and letting someone else do the heavy work, while most likely moving to an Ethernet connection and minimizing the Arduino code to only put power to the motors. As said, buying specialized hardware would at this point defy the point of having the machine in the first place, and I would not know of a board that talks to my handmade encoders
![:) :)](/media/kunena/emoticons/smile.png)
Please Log in or Create an account to join the conversation.
Did you go for somethings other than a quadrature output ?
Please Log in or Create an account to join the conversation.
- tommylight
-
- Offline
- Moderator
-
- Posts: 18562
- Thank you received: 6218
There is everything regarding arduino with LinuxCNC, even directly controlling stuff like motors and IO made by DaBit, a member here and the same nic on youtube.
There is SPI stuff for RPI and 3D printer boards, Remora and some other projects also here.
To find stuff on this forum and website, use google:
arduino usb site:linuxcnc.org
That returns only stuff from this website containing arduino and usb.
Still, as mentioned above, do not get your hopes high about arduino, it is still crippled by the USB interface and the inherent latency.
edit
some links to cheap servo drives
forum.linuxcnc.org/show-your-stuff/31742...for-2-motors?start=0
forum.linuxcnc.org/27-driver-boards/3867...i92-firmware-request
Last one is for parallel port or Mesa boards.
Please Log in or Create an account to join the conversation.
github.com/rene-dev/stmbl
Please Log in or Create an account to join the conversation.
- HerrNamenlos123
-
Topic Author
- Offline
- New Member
-
- Posts: 17
- Thank you received: 2
You are right, we are getting somewhere. Now that I think about it, there actually isn't anything weird about my hardware. I was just so hyper focused on my past attempts that I did not think it is plausible that any ready made hardware would work well for me.
Time for some specs:
I am using BTS7960 DC motor drivers like shown here: www.amazon.com/HiLetgo-BTS7960-Driver-Ar...urrent/dp/B00WSN98DC. 43A and I got them for around 8€ each. IIRC there are 2 direction pins and 2 PWM pins, but I chained them together to have one pin for right direction, one pin for left direction, and one common PWM pin. All 5V. Additionally there is a Current-Sense pin but I did not use them.
On the other hand, I have the encoders, they consist of IR leds and sensors, and a very simple PCB that rectifies the signals to be a sharp 5V quadrature signal. So yes, quadrature. Reference mark is yet to come.
In the past, I did not find any boards that are good in decoding quadrature inputs and that are still cheap and not part of a massive system, so I was trying to read the quadrature signals with the Arduinos directly. The Interrupts were too slow, so I used the Arduino MKR Vidor 4000 which has an FPGA as well as an MCU, and used the FPGA to decode the quadrature signals, and to do the PID loop at a very high frequency.
That being said, yes, if there was a LinuxCNC compatible board that takes in 5V quadrature signals and puts out PWM and direction signals for the BTS7960, I would spend money on it. It would still allow me to experiment with my own encoders and the concept of reference marks, and so on... Open to board suggestions, thank you
![:) :)](/media/kunena/emoticons/smile.png)
Please Log in or Create an account to join the conversation.