Connect linuxcnc with STM32 or ESP32
- TheRoslyak
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
04 Jun 2021 07:45 #211129
by TheRoslyak
Connect linuxcnc with STM32 or ESP32 was created by TheRoslyak
Good day.
Tell me how you can connect signals from the controller to linuxcnc.
I have the first controller with IMU that sends a bluetooth signal to another controller connected to linuxcnc.
Question number one: What is the best way to commute a controller with linuxcnc.
- Connect linuxcnc with com port and send value by UART.
- Connect linuxcnc with analog input by (Ethercat Beckhoff EL30** or analog input like MESA (if such exists)).
- Program the controller as USB HID and connect with linuxcnc
- Or etc
Can you give tips or guides on how to do something like this? And which way is better?
Tell me how you can connect signals from the controller to linuxcnc.
I have the first controller with IMU that sends a bluetooth signal to another controller connected to linuxcnc.
Question number one: What is the best way to commute a controller with linuxcnc.
- Connect linuxcnc with com port and send value by UART.
- Connect linuxcnc with analog input by (Ethercat Beckhoff EL30** or analog input like MESA (if such exists)).
- Program the controller as USB HID and connect with linuxcnc
- Or etc
Can you give tips or guides on how to do something like this? And which way is better?
Please Log in or Create an account to join the conversation.
- BeagleBrainz
- Offline
- User is blocked
Less
More
- Posts: 1437
- Thank you received: 570
04 Jun 2021 08:00 - 04 Jun 2021 08:05 #211130
by BeagleBrainz
Replied by BeagleBrainz on topic Connect linuxcnc with STM32 or ESP32
UART is pretty easy and has been discussed a while back.
forum.linuxcnc.org/18-computer/23166-arduino-i-o-with-linuxcnc
As a USB HID controller is doable, you need to find a USB stack for your MCU
I used LUFA USB stack from here www.fourwalledcubicle.com/index.php with an Arduino Leonardo a while back.
More Arduino related stuff
www.oz1jhm.dk/content/linuxcnc-and-arduino
emc2arduino.wordpress.com/
ESP32 with ethernet
You could try this github.com/Deotti-cl/linuxcnc-esp32
and modify the code to do just I/O rather than stepgen. Decide how you want to pack the data in a packet and off you go. Technically you could decide on how you pack the data and really whether you send it via blue tooth, UART, Ethernet or smoke signals would not matter.
forum.linuxcnc.org/18-computer/23166-arduino-i-o-with-linuxcnc
As a USB HID controller is doable, you need to find a USB stack for your MCU
I used LUFA USB stack from here www.fourwalledcubicle.com/index.php with an Arduino Leonardo a while back.
More Arduino related stuff
www.oz1jhm.dk/content/linuxcnc-and-arduino
emc2arduino.wordpress.com/
ESP32 with ethernet
You could try this github.com/Deotti-cl/linuxcnc-esp32
and modify the code to do just I/O rather than stepgen. Decide how you want to pack the data in a packet and off you go. Technically you could decide on how you pack the data and really whether you send it via blue tooth, UART, Ethernet or smoke signals would not matter.
Last edit: 04 Jun 2021 08:05 by BeagleBrainz.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
04 Jun 2021 13:37 #211156
by TheRoslyak
Replied by TheRoslyak on topic Connect linuxcnc with STM32 or ESP32
Ok Thank you so much.
I decided to go first way.
But I can't understand How to compile serialreceive.comp.
I try to compile this file and get this (pic1) -> then in *.hal I get (pic2)
I decided to go first way.
But I can't understand How to compile serialreceive.comp.
I try to compile this file and get this (pic1) -> then in *.hal I get (pic2)
Please Log in or Create an account to join the conversation.
05 Jun 2021 00:14 #211183
by scotta
Replied by scotta on topic Connect linuxcnc with STM32 or ESP32
You might be interested by Remora. It's LPC1768 based and uses SPI for the communication between LinuxCNC and the MCU.
github.com/scottalford75/Remora
remora-docs.readthedocs.io/en/latest/
github.com/scottalford75/Remora
remora-docs.readthedocs.io/en/latest/
Please Log in or Create an account to join the conversation.
- BeagleBrainz
- Offline
- User is blocked
Less
More
- Posts: 1437
- Thank you received: 570
05 Jun 2021 01:27 #211189
by BeagleBrainz
Replied by BeagleBrainz on topic Connect linuxcnc with STM32 or ESP32
Why did you stop the compilation process ?
I used the code from that thread and it went through halcompile ok.
As serialreceive is a userspace component you need to use loadusr not loadrt
I used the code from that thread and it went through halcompile ok.
rmurphy@thinkPad-t530:~/temp$ sudo halcompile --install serialreceive.comp
gcc -I/usr/include -I/usr/include/linuxcnc -URTAPI -U__MODULE__ -DULAPI -Os -o serialreceive /tmp/tmp5WG7oK/serialreceive.c -Wl,-rpath,/lib -L/lib -llinuxcnchal
serialreceive.comp: In function ‘user_mainloop’:
serialreceive.comp:49:17: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
As serialreceive is a userspace component you need to use loadusr not loadrt
The following user(s) said Thank You: TheRoslyak
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
05 Jun 2021 20:03 #211246
by TheRoslyak
Replied by TheRoslyak on topic Connect linuxcnc with STM32 or ESP32
Ok. Thank you so much.
Before these are all own components use "loadrt"
This made me think that there might be a USB-HID component. Someone probably used linuxcnc with a dualshock or xbox controller. I found this project hidcomp.sourceforge.net/
it perfect for me)
Before these are all own components use "loadrt"
This made me think that there might be a USB-HID component. Someone probably used linuxcnc with a dualshock or xbox controller. I found this project hidcomp.sourceforge.net/
it perfect for me)
The following user(s) said Thank You: Doogie
Please Log in or Create an account to join the conversation.
- BeagleBrainz
- Offline
- User is blocked
Less
More
- Posts: 1437
- Thank you received: 570
06 Jun 2021 01:09 - 06 Jun 2021 01:13 #211266
by BeagleBrainz
Replied by BeagleBrainz on topic Connect linuxcnc with STM32 or ESP32
That's not the easiest code to compile.
When I did use it I had to modify the make file and mess around with some libraries, unfortunately I can't find my notes.
There is also this:
linuxcnc.org/docs/2.8/html/man/man1/hal_input.1.html
And this tho a little old:
wiki.linuxcnc.org/cgi-bin/wiki.pl?A_New_...oypads_With_LinuxCNC
You can also use the forum search function, I'm pretty sure someone recently asked about using an xbox controller.
Might be some info here you can use.
forum.linuxcnc.org/38-general-linuxcnc-q...ne-controller#209884
Maybe if you add a post asking for some help the author may answer.
When I did use it I had to modify the make file and mess around with some libraries, unfortunately I can't find my notes.
There is also this:
linuxcnc.org/docs/2.8/html/man/man1/hal_input.1.html
And this tho a little old:
wiki.linuxcnc.org/cgi-bin/wiki.pl?A_New_...oypads_With_LinuxCNC
You can also use the forum search function, I'm pretty sure someone recently asked about using an xbox controller.
Might be some info here you can use.
forum.linuxcnc.org/38-general-linuxcnc-q...ne-controller#209884
Maybe if you add a post asking for some help the author may answer.
Last edit: 06 Jun 2021 01:13 by BeagleBrainz.
The following user(s) said Thank You: TheRoslyak
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
07 Jun 2021 09:31 #211410
by TheRoslyak
Replied by TheRoslyak on topic Connect linuxcnc with STM32 or ESP32
Thank you.
It was easy, I don't understand that others are tense.
The problem is the following:
"Tearing" speed - The robot jerks slightly at medium speed
I try to use filter kalman - It didn't help much.
If the way to smooth out the speed?
It was easy, I don't understand that others are tense.
The problem is the following:
"Tearing" speed - The robot jerks slightly at medium speed
I try to use filter kalman - It didn't help much.
If the way to smooth out the speed?
The following user(s) said Thank You: Doogie
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
28 Jun 2021 14:56 #213147
by TheRoslyak
Replied by TheRoslyak on topic Connect linuxcnc with STM32 or ESP32
hi everyone.
In the continuation of the conversation.
The next question is only partially related to linuxcnc. But maybe there are tips on how to implement it.
In globaly I want to make "Data transmission device".
The alignment scheme is shown in pic.
Question number 1:
How reliable will the uart package be if I send simple text. or maybe there are other options
Question number 2:
If the made devices that perform "HC-6 + Arduino Leonardo".
I do not understand how in such a device. I can set a fixed value for joysticks and buttons and etc.
And returning to the first question, what does this get at the input? ("Data Transmit" I mean)
In the continuation of the conversation.
The next question is only partially related to linuxcnc. But maybe there are tips on how to implement it.
In globaly I want to make "Data transmission device".
The alignment scheme is shown in pic.
Question number 1:
How reliable will the uart package be if I send simple text. or maybe there are other options
Question number 2:
If the made devices that perform "HC-6 + Arduino Leonardo".
I do not understand how in such a device. I can set a fixed value for joysticks and buttons and etc.
And returning to the first question, what does this get at the input? ("Data Transmit" I mean)
Please Log in or Create an account to join the conversation.
Time to create page: 0.135 seconds