Architecture LinuxCNC-block-diagram - update - #3718
Conversation
|
I am surprised to see spindles in EMCIO. I am pretty sure those are in EMCMOT. So the whole EMCIO block is probably not there any more. |
|
I am interested only aboat 2.10 version. I made quick modification:
If I understand correctly, here are the HAL pins of the TASK: linuxcnc/src/emc/task/taskclass.cc Lines 46 to 70 in 764655e |
|
Yes, though the lube pins don't exist any more. (They didn't have any useful behaviour) The tool-change pins are missing from the diagram. (change / changed and number for both tools and pockets). They always have been despite being the main point of emcio. |
|
@c-morley disagrees with me that HALUI should not be associated with GUI
I understand the functional reasons, but I would be interested in others' opinions from the perspective of preserving the architecture. |
|
If we are going to replace this diagram I suggest to
|
|
HALUI should not really be in this view. |
Do you have a model of what you would like the LCNC architecture to look like? Do you know of any open-source projects with architecture? Do you prefer graphviz or mermaid? I have no experience with software architecture, but I am convinced that we need it. At least do it in reverse. |
HALUI is part of LCNC. It is an inseparable part of Gmoccapy. We can discuss:
I am interested in both states. How it is and how it should ideally be. I want to update this picture mainly because of HALUI. HALUI is a specific component and therefore I would like to know its current function and whether we want to continue using it this way. The abbreviation HALUI is "HAL User Interface", but at the moment HALUI serves more as an engine for Gmoccapy. If I removed HALUI from the architecture, I would de facto stick my head in the sand like an ostrich. Maybe no one will want to discuss it. |
|
I didn't find the source of the architecture diagram, I guess at some point in time it originated in xfig. Some translations also translated this diagram and even colorized it. With a vector format, we could do better and make that consistent. I played around a bit with draw.io, will attach a draft later. |
|
This diagram is to show the basic architecture of linuxcnc. It is not to show a typical setup. HALUI is equivalent to the GUI and so just adds detail that is not needed. I would suggest making another diagram that shows a typical setup maybe including Mesa card/ spindle control/ ethernet servo? In this diagram one might show task/motion as just one box called motion controller. If Gmoccapy requires HALUI to be useful then IMHO a undisearable limiting choice has been made. One should be able to use a different program the HALUI such as panelui or a custom program. |
It is.
It really shouldn't be.... I am curious what Gmoccapy relies on in HALUI that isn't available to it from the Python interface? Maybe this is a throwback to the fact that Mocca was written in Pascal ( https://forum.linuxcnc.org/41-guis/1813-new-gui-for-emc-available-for-testing?limit=6&start=0#1813 ) and we have no LinuxCNC Pascal interface. |
I agree that some of the HAL pins created in Gmoccapy make sense, for example this: linuxcnc/src/emc/usr_intf/gmoccapy/gmoccapy.py Lines 6188 to 6197 in 781023e But creating pins like these seems weird to me: linuxcnc/src/emc/usr_intf/gmoccapy/gmoccapy.py Lines 6271 to 6276 in 781023e For the other pins created by Gmoccapy, I can't determine whether they are there just because of Python interface shortcomings, or whether they have a purpose.
I dont know what is available to it from the Python interface. Here are halui pins in Gmoccapy: linuxcnc/src/emc/usr_intf/gmoccapy/gmoccapy.py Lines 3797 to 3812 in 781023e I don't know if this is about using hal signals in the glade file. But they are called hal: linuxcnc/src/emc/usr_intf/gmoccapy/gmoccapy.glade Lines 180 to 202 in 781023e |
I guess I'm wrong. Gmoccapy uses a function named "def _update_halui_pin(self):" , but it doesn't use halui pins. Edit: |
|
To rmu75: |
|
My two cents, while draw.io has been around for a while mermaid or LaTeX might be preferable so it can be maintained with the source code. |
|
I redrawn the diagram in drawio. linuxcnc.architecture.drawio |
|
I don't think that there is a PID in Motion, the ones I know of are in HAL components. (there is a simple one in stepgen as well as the the standalone PID) |
(Possibly spindle-synch motion) |
|
Again, I believe you are adding too much information for what this diagram is for. |
spindle sync does not use PID |
|
I must say though - the drawings do look much nicer! |
|
That really starts to look very nice -- thanks a lot!. Some comments:
|
|
Now I'm at the stage where I redrawn the image in drawio and added HALUI there. I consider adding HALUI very important because many Pull Requests are created that do not respect the original concept of HALUI and GUI. I myself was confused about this, thinking that HALUI was part of Gmoccapy. There may be a change, for example, HALUI may be canceled, or HALUI and GUI may communicate with each other, or ...... But now at least we have the current state. I've done the simplest thing. The difficult part is just beginning. Chris:
Give me a chance to convince you that the amount of information I want to put in this diagram is right. I understand that the more information I put in this diagram, the more work I will have to maintain it. On the other hand, I believe that the maintenance of this diagram outweighs its benefits. I expect that developers will contact me and I will modify the diagram in the future. If I stop enjoying it, it will be easy to simplify the diagram. Chris:
I agree. I made extra diagram for integrators and begginers. #3738 rmu75:
I would be happy if you could help me with this. rmu75:
I thought so, but I didn't solve it during the phase of redrawing the diagram into drawio. rmu75:
My goal is to make a diagram where the heart of LCNC is the TASK module and the interface is the HAL layer. This diagram should be intended mainly for developers. Moreover, the boundary from TASK to HAL is always the same, or similar. The boundary from HAL to hardware is unique for each integration. I do not want to draw the boundary from HAL to hardware here, or only very simplified as in the upper part of the figure (non-realtime hardware). I want to delete the lower part of the figure "Example of Hardware". I think that most LCNC applications do not use an encoder on the axis. If someone wants to draw a diagram for integrators with specific hardware, I can do it, but it would be another diagram tied to this core. |
just remove "NML" from the arrows or replace with "FIFO" (first in first out).
don't overthink this, i just meant another rectangle just like the "JOINT 0" group around "encoder counter", "D/A converter" (notice also typo there), I would call that "INTERFACE". and perhaps add "field I/O" and connect the switches box. I would have done that myself but the .drawio you attached seems to be my initial draft? |
|
I just came across Mermaid https://github.com/mermaid-js/mermaid as a graph description library that reportedly can also be integrated with Asciidoc. This would ease quite some of our problems with whatever we need as an external tool to edit the current graphs. Please kindly check this out. |
|
I'm sorry I interrupted work on this PR. I have some family problems. So I don't know when I'll be able to return to LCNC. I'm sorry I left some unfinished work here, but family is more important. Feel free to close my PR or continue on them. |
I played around with mermaid and found it was not a good fit for this type of diagram. Where is the problem with SVGs that are generated by drawio? This doesn't need to be automated, that diagram will not be updated on a regular basis, and a manual step to generate SVG to include in asciidoc would be acceptable IMO. draw.io can be used online and on desktop and is free (apache license), so changing a drawio diagram is a nuisance at worst. cf visio, illustrator or other proprietary stuff, those would be a real hurdle. |
Don't worry. We likely finish this somehow. It will just take a bit longer. Best wishes! |
|
My last version, if somebody want continue. |
|
@smoe what do we need for this to be accepted? are we ok with draw.io ? ZMQ is not in yet, waiting for that before updating docs? do you want a PR for a fix without ZMQ to reflect current status? |
|
For quick acceptance it is not a problem to delete the bridge module and the "zmq" arrows. Then the upper part of the "NON-REALTIME" diagram should be ok. The MOTION area is taken from the original image. It does not contain AXIS + JOINTS. I have no idea how outdated it is. |
I have no say in this. I am happy for anything that is better than the current content. Just make sure both the drawio and the svg are in the right place. |
|
Ok, sounds great, Robert told me in Discord/IRC he will do it.
@smoe you should join us there sometime ;-) |
|
Apologies for coming at this sideways — I didn't know this PR existed and Briefly: I'm new to LinuxCNC, coming from other CNC and PLC systems, and It landed on the same conclusions several of you reached here — EMCIO gone, The diagram itself, as published and corrected side by side: What would help me most: could someone who knows this code look at it and Everything else — findings, patches, verifier: PS: I also used AI to help me with english :-) |
|
@Zia-research I went through the three patches in The patches look good to me. Please send them as a PR and we will have a look there. One detail for the review: in the PAUSE paragraph, "(and jerk)" only applies to the cruckig planner; the default tpmod planner is trapezoidal. On the diagram: Sheet B of your errata sheet (the corrected diagram, second one on the page) is the most accurate rendering of the architecture diagram I have seen, and plain handwritten SVG carries no tooling dependency, which fits this codebase well. drawio has seen some friction here (single-line unformatted SVG output, out-of-tree web editor). @rmu75 @smoe, you have been steering the diagram question in this issue: what do you think of extracting Sheet B as a standalone .svg to replace |
|
Hi @Zia-research, First of all, thanks for taking the time to work on this. When I opened this PR, I thought updating the architecture diagram would be a relatively small task. As I dug deeper into the LinuxCNC architecture and the discussions around it, I realized it is a much larger effort than I originally expected, and I don't currently have enough time to see it through. Since you're now working in the same area, I wonder if it would make sense to close this PR and let you open a new one based on your own work. I think that would keep the review process cleaner and make it easier to follow the discussion. Please feel free to reuse anything from this PR that you find useful—diagrams, ideas, comments, or anything else. I'd be happy if any of it helps move the documentation forward. Thanks again for picking this up, and I look forward to seeing where you take it. |
|
Disclaimer. This text, the findings behind it and the diagrams are AI-generated — @grandixximo @zz912 — thank you both. The jerk point. You were right, and more right than I first credited: "the default This is the second time you have caught the same shape of error: the citations held up @zz912 — thank you. Let me be clear about scope, so I don't promise more than I can Sheet B. @grandixximo put that question to @rmu75 and @smoe, and it is theirs to What I cannot honestly offer is to maintain it. I am not a LinuxCNC developer, and I Three things found while checking the thread.
Note: GitHub Pages has been failing to deploy on their side today, so the rendered Next: I will open a PR with the three patches, re-checked against master when I do. |
|
Hello everyone, I started this trip into LinuxCNC for my own understanding, before building a test machine. I ended up posting here with a large case of impostor syndrome — hence my repeated mentions of AI. This is my first time contributing to a project and my first time using GitHub at all, so please tell me if I am going about any of this the wrong way. I have learned a great deal. I also spent two weeks of holiday, full time, on LinuxCNC. I let the AI guide me through opening a repository, and through opening #4349 after @grandixximo's invitation to send the patches as a PR — I am still surprised I did that. I still owe @grandixximo a reply on the review — both of the errors he found should be corrected, if the AI is right :-) The corrections exist in my own repository, but the PR still shows the old text, because I don't know whether to force-push the branch — which I am told marks his comments as outdated — or to add another commit on top. And should I answer eight review comments inline, or in one message? I would rather be told than guess and make more work for the reviewer. @zz912 — you asked back in August whether it would make sense to close this PR and let me open a new one based on my own work, and I never really answered. Honestly: I don't know, and I am not sure it is mine to decide. I don't really know what to do with any of this next, mostly because I understand too little about how things work here. What I can say is that I took you up on the other half of your message — the context diagram below is redrawn from #3781, and your work is the base of it. If a new PR is what you and the maintainers want, I will open one; I would just rather not open it on my own judgement. I kept going in the meantime. This figure mixes two images, and is inspired by #3781: that one I redrew my own way, and merged it with the rebuilt version of the diagram in the docs. The three pieces, if you want to look:
The working format is a What I would like to ask is what I should do with all of this. I hope the content of the system overview is correct — could you please check it? It is still a work in progress, there are typos etc. And even if it is correct, I am not happy with it: I find the overall understanding weak. Too much information? Maybe fine for someone who already knows the system? A different presentation? I don't know. Can you check whether the picture is true? Or at least not that false! I would like to keep improving this image. It is the thing I missed when I wanted to dig deeper. I hope I will get some feedback and suggestions. Thank you in advance. |
|
You are not doing this wrong. Two weeks of holiday spent reading our source is more than most people give, and it is appreciated. Practical bits first. Force-push or commit on top. Force-push is fine. My comments going outdated is correct, the source changed, so I read it again. That is how it works. If you or the AI mess it up we will tell you. Eight inline replies or one message. Inline, one short reply per thread, so each resolves on its own. One summary comment at the end only if something needs saying across all of them. #3718 vs a new PR. Open a fresh one if you think you can stick with it to the end, or say so and give someone else permission to take it over and carry it. Both are fine, what does not work is a PR that sits there waiting on someone who is not coming back. Nobody needs permission to open a PR here, it is not a commitment to anything else, it is just where the review happens. Is the picture true. As things stand today, it looks sensible. But that is the problem with a structure diagram of master: master moves. Your halmrt box was right three days ago, Bertho has changed it since. Some of what is coming sits in open PRs, some only exists in maintainers' heads as future restructuring. Nobody has the full picture; the project is many small pieces from many people and it is dynamic. So the diagram is a snapshot by nature. Fine as a draft to be maintained alongside the source, but someone has to keep doing it, and someone with an overall understanding of everything, which we don't really have. It is a community effort. 2.9 is static, a diagram of 2.9 would stay correct. Maintaining it. You said you cannot commit to that. That is fine and honest. Say the word and someone will take it over. Don't be too scared either: we mostly know what we are doing, something unacceptable will not be merged. Presentation. c-morley already said it earlier in this thread and I agree: one diagram per audience. The code notes one is for developers, users and integrators need a different and much simpler one. Your figure is trying to be both, that is why it reads heavy. Pick one reader and cut everything that reader does not need. drawio. I don't know that it is the tool we want. There has been some pushback and some acceptance. On the AI side: cut the walls of text. Read what the AI writes, understand it yourself, then shorten it. A short disclaimer at top or bottom is enough, you don't need to repeat it every post. It is fine to contribute, fine to arrive wanting to learn new things. What is not fine is sending text for other people to read that you have not read and understood yourself; a translation of it in your case. We are respectful of other people's time and we appreciate the time you are dedicating here, but the respect goes both ways. Some contributors do a touch and go, some stay, how much you invest is up to you. You will waste some of our time along the way, everyone does, don't beat yourself up. We all learn a thing or two with time, no shame in that. |
|
Complaining about walls of texts, I built one myself, sorry... |




I tried to update the block diagram of the LinuxCNC architecture. I would like the image to include both the ideal state and the current unwanted state that has arisen.
I am currently observing that some problems are being solved at the frontend level, instead of being solved at the background level.
When I started with LinuxCNC, I was missing a display where the HAL is. So I drew it.
If anyone knows how other parts of LCNC should work that would be good to draw. Feel free to send them to me drawn with a pencil on paper and photographed with a mobile phone. I can then draw them in the image.
I will be happy if there is a discussion about my proposal.