Communication solution on my own CNC Machine

More
17 Mar 2024 22:17 - 17 Mar 2024 22:26 #296155 by srknyxl
This is my first post and first topic in this forum (the first forum I've joined other than my native language). Thanks to you, I learned a lot about linuxcnc and different topics. Finally, I registered to gather my thoughts and open a topic. Since I used translation while writing the article, there may be some problems. Please excuse me :)

I have been doing research on making a CNC machine for a long time. I have met many alternatives on the software side. Driving stepper motors with simple grbl software, slightly more advanced NC solvers such as fluidnc, ready-made control units, windows-based mach and finally linuxcnc.

Mechanically speaking, I have the following design in mind:
A router with a fixed bridge and a processing area of 60x40cm. This machine should be able to cut aluminum very easily. I am thinking of using epoxy granite casting and aluminum sheets for the body material.

Where I work now, there is a large machining center, lathe, 4kw fiber laser and twisting machine. These are all CNC and I know how to use them. I have the opportunity to use all of them for the weekends. Using these opportunities, I want to make permanent magnet ac servo motors myself, in addition to the body parts. Even though the power density in terms of volume is not as much as industrial servos, I think it can be a good start. I will laser cut the thin transformer sheets and bring them together to form the stator. Then I will do the copper winding. I will machine the rotor and body with CNC lathe and milling machine and place the magnets. There are many mechanical details.

I want to use odrive as Servo Motor driver. I will design the voltage and current of the motor I will build in accordance with this driver.

The Odrive project is a closed loop servo controller in itself. Although servo examples are generally made with low-power drone motors, it has a power potential much higher than what I need, such as 56v-70a 4kw. It is used in many applications for location applications. I can't see any physical impediment to it not being used on a medium sized CNC project.

Now it's time for the questions that come to my mind.

Odrive manages the motor and encoder connections itself. Since the pid cycle ends within the odirve itself, would it be enough to just give it pulse and direction commands? In this scenario, linuxcnc will know the current location from the signals it sends. If there is no error signal from the driver, where it thinks it is will be correct. I don't think I need the "mesa" card for this setup.

Can I use Raspberry Pi's own IO outputs without a MESA card? Or is it possible to use a current PC without a parallel output as a Linuxcnc PC and send commands to a Raspberry Pi via ethernet? Raspberry Pi will drive the io pins with commands from Ethernet. Just like a mesa with an ethernet interface. Is this possible? If we can send packets to an IP address from "linuxcnc" using the ethernet port, there is no reason not to make our own ethernet "mesa" card. For this purpose, cheap alternatives can be used instead of expensive raspberry.
www.crocuspi.com/zero_en.html

The software running on these cards connected to the Ethernet network will only convert incoming data packets into orders to be sent to the io pins. The Linux card with 64MB RAM in the link can do this job very quickly.

If it is possible to communicate with the TCP protocol over Ethernet, I would like to get one of these cheap cards and start working on this subject.
Last edit: 17 Mar 2024 22:26 by srknyxl.

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

More
18 Mar 2024 01:12 #296166 by cornholio
Unless you are bare metal programming the RPi generating the step and direction signals, you will need a real time kernel and that will add additional latency.
The most simple, reliable and long term proven way is to opt for using Mesa cards.
The amount of money you will spend designing and building will be more than a basic Mesa card. The cheapest of which is $49 usd and communicates via either SPI with a RPi4, RPi5 is not supported yet, or connects to a PC using EPP via the Parallel Port.
Or you can Mesa firmware on a Spartan 6 dev board, but this requires modifying the sources and building the firmware yourself as well designing and producing the electronics to convert the 3.3v of the FPGA to the voltages required to interface with your machine.
Building a reliable, accurate, repeatable and safe machine is not cheap.
Before going too far I would really spend a good couple of weeks reading through the forum, the forum members are far more than “hipster makers” but guys that actually use their machines to make money, real hobbyists that make real things and some really damn talented programmers that seem to have god like abilities.
You’ll get real advice and info here, not a bunch of keyboard warriors bragging about rapids.

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

More
18 Mar 2024 03:16 #296170 by tommylight
The "card" you linked to is a RPI clone with 512MB of ram, and that is not enough to run latest versions of Linux on it, although it might work, it will not be enjoyable.
Can you buy used PC's there, like HP, Dell, Lenovo, Fujitsu ? These are cheaper than RPI and much, much better for machine control.
You can find one such PC with parallel port and directly control the machine, so 50-100$ total.

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

More
18 Mar 2024 04:06 #296172 by cornholio
It's 512Mbit = 64MByte.

And I think the OP wanted this to receive step & dir data then generate the step & dir signals. As I said this may not work within the context of an OS and would require "bare metal" programming approach, ie no OS involved.
The following user(s) said Thank You: srknyxl

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

More
18 Mar 2024 08:13 - 18 Mar 2024 08:23 #296181 by srknyxl

cornholio post=296172 userid=35653
It's 512Mbit = 64MByte.

And I think the OP wanted this to receive step & dir data then generate the step & dir signals. As I said this may not work within the context of an OS and would require "bare metal" programming approach, ie no OS involved.


A simple program running on the operating system will open the packets coming from the Ethernet and send the signals from the packet to the motor drivers. Communication delay between devices <1ms. Think this delay doesn't give enough "immediate impression"?
Last edit: 18 Mar 2024 08:23 by srknyxl.

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

More
18 Mar 2024 08:22 - 18 Mar 2024 08:25 #296183 by srknyxl

tommylight post=296170 userid=17274
Bağladığınız "kart", 512 MB RAM'e sahip bir RPI klonudur ve bu, üzerinde Linux'un en son sürümlerini çalıştırmak için yeterli değildir, işe yarasa da eğlenceli olmayacaktır.
HP, Dell, Lenovo, Fujitsu gibi kullanılmış bilgisayarları buradan satın alabilir misiniz? Bunlar RPI'dan daha ucuzdur ve makine kontrolü açısından çok çok daha iyidir.
Paralel portlu böyle bir PC bulabilir ve makineyi doğrudan kontrol edebilirsiniz, yani toplamda 50-100 $.
 

Beni Yanlış Anladın. Amacım 512Mbit (64Mbytes) RAM'e sahip bu küçük bilgisayarı ana bilgisayar olarak kullanmak değil. Bu küçük bilgisayar, Linuxcnc çalıştıran bilgisayarın Ethernet üzerinden gönderdiği dönüş ve yön bilgisini IO'ları aracılığıyla motor sürücüsüne iletecektir.

Bunun gerçek zamanlı olmadığının farkındayım ama umarım çok büyük bir gecikme olmaz.

EtherCAT gibi Ethernet kablolarının uçlarına zincirlemek yerine, onları anahtardan çoğullayarak istediğimiz kadar minik io bilgisayarlara sahip olabiliyoruz. POE desteği de mevcuttur. Böylece LAN kablosuyla çalışan bir el çarkı fikri aklıma geldi.
Last edit: 18 Mar 2024 08:25 by srknyxl.

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

More
18 Mar 2024 08:26 #296184 by cornholio
You'll need to run a realtime OS your boards, as you are essentially using "software step" generation at the end point. Which is no different from using "software step" generation on the Linuxcnc machine. The operation system will add some latency, which when viewed via a scope will tend not to be a stable (regular) pulse train. Latency isn't really about "time or out right speed" but the ability to do things at regular intervals without a lot of variation.

There are some projects on the forum that use STM microntrollers, I suggest you check them out.

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

More
18 Mar 2024 12:12 #296188 by srknyxl

You'll need to run a realtime OS your boards, as you are essentially using "software step" generation at the end point. Which is no different from using "software step" generation on the Linuxcnc machine. The operation system will add some latency, which when viewed via a scope will tend not to be a stable (regular) pulse train. Latency isn't really about "time or out right speed" but the ability to do things at regular intervals without a lot of variation.

There are some projects on the forum that use STM microntrollers, I suggest you check them out.
 

Can you give examples of those projects in the forum? What kind of real-time communication is there between Linuxcnc and stm cards? Ethernet?

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

More
18 Mar 2024 13:31 #296194 by tommylight

It's 512Mbit = 64MByte.

That is miserable !!! :)
In that case, FPGA's are much better. Or even micro controllers.

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

More
18 Mar 2024 13:40 - 18 Mar 2024 13:42 #296196 by srknyxl
 
Do you think that 64MB RAM will not be enough to open the Ethernet packets coming from the main Linux computer and send them to the servo drivers via IOs? Or are you hesitant about real-time communication?

Is it possible to build this structure in Linuxcnc? Maybe it is cumbersome for axis management. But it will be a very practical solution for hand wheel or ATC management with ethernet interface.
Last edit: 18 Mar 2024 13:42 by srknyxl.

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

Time to create page: 0.272 seconds
Powered by Kunena Forum