LinuxCNC for automation

More
28 Jul 2020 08:29 #176227 by tdon
LinuxCNC for automation was created by tdon
Hello,

I'm new to LinuxCNC and I've got a general question:
I want to control a machine using Linux. It consists of several motors that need to be controlled depending on measured values from different sensors. It would be nice to put the program structure in C/C++-Code and not G-Code. Furthermore I would prefer ton use Mesa-Cards as an interface to the hardware. Is it possible to do this with LinuxCNC or is there a better way/tool?

Thanks for your help!


Best regards,
Tobias

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

More
28 Jul 2020 13:17 #176243 by andypugh
Replied by andypugh on topic LinuxCNC for automation

I'm new to LinuxCNC and I've got a general question:
I want to control a machine using Linux. It consists of several motors that need to be controlled depending on measured values from different sensors. It would be nice to put the program structure in C/C++-Code and not G-Code. Furthermore I would prefer ton use Mesa-Cards as an interface to the hardware. Is it possible to do this with LinuxCNC or is there a better way/tool?


Yes, that is all very possible with LinuxCNC. In fact for such a job LinuxCNC would be _my_ first choice, but then if your only tool is a hammer....

If you are not already familiar with LinuxCNC then it might not be the best choice for you.

LinuxCNC can run happily without G-code. It is quite common to make a custom GUI that operates on the HAL level (generally using Python code, but I think that C++ and QT is an option). There is also a built-in PLC (classic ladder) and you can write standalone HAL components in a C-like language called .comp.

What sorts of sensors are being used?

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

More
29 Jul 2020 08:49 #176342 by tdon
Replied by tdon on topic LinuxCNC for automation
Thank you for all the information! That's exactly what I was searching for.
Most of the sensors deliver a 0-10V signal (strain gauges, temperatures,...) and I have one rotary encoder.
Is there any example how to build a GUI operation on HAL level with C++/QT? Thanks!

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

More
29 Jul 2020 10:36 #176346 by andypugh
Replied by andypugh on topic LinuxCNC for automation

Thank you for all the information! That's exactly what I was searching for.
Most of the sensors deliver a 0-10V signal (strain gauges, temperatures,...) and I have one rotary encoder.


There are SPI A/D cards available cheaply, search eBay for ADS1256 (I _think_ that the unpopulated spaces on the boards are for potential divider resistors to handle higher voltages.) You might have to bit-bang the SPI interface, though.

For a more ready-to-run solution, there is the Mesa 7i87 (But note that requires an FPGA card and an interface adaptor card, (combined in one on the 7i94, or as two cards such as 7i64 and 7i44) and I think that General Mechatronics have modules too.


Is there any example how to build a GUI operation on HAL level with C++/QT? Thanks!

Have a look at forum.linuxcnc.org/41-guis/36768-qt-c-code-samples
But if youa re prepared to use Python in the back-end then that is a more-travelled path.

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

More
29 Jul 2020 12:43 #176382 by tdon
Replied by tdon on topic LinuxCNC for automation
Many thanks for your help! I really appreciate it!

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

More
03 Aug 2020 21:04 - 03 Aug 2020 21:06 #177093 by Grotius
Replied by Grotius on topic LinuxCNC for automation
@Tdon,

For a c++ linux cnc example i did some work today.

It's a Qt c++ example and runs on a linuxcnc rip.
It's a nice starting point to build your app. Attached the project files.

Attachments:
Last edit: 03 Aug 2020 21:06 by Grotius.
The following user(s) said Thank You: tommylight, tdon

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

More
04 Aug 2020 06:15 #177179 by tdon
Replied by tdon on topic LinuxCNC for automation
Thank you very much! That helps a lot and is exactly what I was search for.
This forum is great!

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

More
05 Aug 2020 00:50 #177324 by Grotius
Replied by Grotius on topic LinuxCNC for automation
Today did some work on the opengl, source code attached.

The toolpath preview (simulator) is doing a very nice job so far.

For gcode preview i have to write some extra code.

Attachments:

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

More
05 Aug 2020 03:33 #177340 by Himarc3D
Replied by Himarc3D on topic LinuxCNC for automation

Today did some work on the opengl, source code attached.

The toolpath preview (simulator) is doing a very nice job so far.

For gcode preview i have to write some extra code.


Hey, Grotius.
Can you recommend some tutorial, book, documentation to learn QT with C++?
Thank you

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

More
05 Aug 2020 21:36 - 05 Aug 2020 21:50 #177425 by Grotius
Replied by Grotius on topic LinuxCNC for automation
Hi Himarc,

The buckie videos on youtube are nice to follow.
If you compare buckies examples to my code style, you will see i use header only if possible.
Most of time i use a header file to do calculation's instead of a class wich contains a .h and .cpp file.

Private, public and so on don't interest me. The only thing that interest me is a compact program that does the job.
The downside of header only is, sometimes you cannot include a header twice in the same program.

Qt, look at : refractor -> rename under cursor
Qt, auto indent selection

For documentation i learned to use the standard c++ library (std) as much as possible. So when i can avoid a qt library i do so to
make program's more cross platform compatible.
If i need to know something about c++ i google for a example.

Warning: Spoiler!


Good luck. What will you write for a program, will it contain a graphical interface with opengl?
Last edit: 05 Aug 2020 21:50 by Grotius.

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

Time to create page: 0.114 seconds
Powered by Kunena Forum