Arduino IO Expansion

More
29 Mar 2023 12:07 #267799 by AlexMagToast
Hi,
I want to share a little side Project i've been working on.
For my CNC Lathe Retrofit Project i was left with a couple of old Buttons, Knobs and Lights on the control Panel. I wanted to implement an easy and cheap option to connect all of them to LinuxCNC useing an Arduino.
This led to this Software here:
github.com/AlexmagToast/LinuxCNC_ArduinoConnector
I think this is quite a nice and skaleable solution, since it can handle as many IO's and Analog Inputs as i think one can ever need. It is however not in the RT Thread and is not intended for Timing or Safety relevant Stuff like Endstops or Emergency Stops.

Here is a short overview of supported IO Modes:
  • analog Inputs
  • digital Inputs
  • digital Triggered Inputs
  • digital Outputs
  • PWM Outputs
  • support of Digital RGB LEDs like WS2812 or PL9823
  • latching Potentiometers / Selector Switches
  • 1 absolute encoder input

To work with selector switches with many positions and lots of RGB LEDs i implemented "virtual Pins" which basicly are feed from one input and divided into different Hal Pins in LinuxCNC.


It uses Python-serial and the Python Hal module and works with 2.8 and above.

I think the software works very well but jet had no Feedback from Users.
So if you like it or have suggestions on how to make it better please don't hesitate.
Cheers,
Alex
The following user(s) said Thank You: tommylight, elovalvo, besriworld, panming, Unlogic

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

More
29 Mar 2023 16:58 - 29 Mar 2023 17:00 #267828 by HansU
Replied by HansU on topic Arduino IO Expansion
I always wonder why people always try to reinvent the wheel.
For me it looks very similar to this one forum.linuxcnc.org/24-hal-components/473...al-component?start=0
which is built on Jeff Epler's Arduino HAL (mentioned in the thread).
And also this one: forum.linuxcnc.org/18-computer/23166-arduino-i-o-with-linuxcnc
Last edit: 29 Mar 2023 17:00 by HansU.

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

More
29 Mar 2023 20:29 #267855 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion
i needed a custom solution to use the Switches that came with my machine and it kind of escalated from there.
The code is actually inspired by jet another project i can't find again right now.
I am not trying to reinvent the wheel, i just sharing my work, so others can take a look at it and maybe shed some Hours of work, just like i did.
Also i am quite proud of this because of all the stuff you can do with it and how easy it is to set it up.

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

More
08 Apr 2023 12:40 #268604 by besriworld
Replied by besriworld on topic Arduino IO Expansion
Can you add example configuration for arduino and linuxcnc. Thank you for sharing ! Nice project.

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

More
08 Apr 2023 21:58 #268631 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion
have you tried it?
I was hoping the documentation would be good enough.
I'm working on a Youtube Video, giving a better explanation.
The following user(s) said Thank You: besriworld

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

More
09 Apr 2023 15:10 - 09 Apr 2023 15:11 #268678 by besriworld
Replied by besriworld on topic Arduino IO Expansion
Not yet... I'll wait for a video clip.
Last edit: 09 Apr 2023 15:11 by besriworld.

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

More
02 May 2023 15:58 #270489 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion
Hi, I just updated the code, it now also Supports Matrix Keyboards.
I've managed to add functionality to input actual Keyboard inputs in Linux aswell as defining Functionality Keys to be included as Input Pins in LinuxCNC.
The downside is, that it only works, while LinuxCNC is running.

But - and that is why i added this feature -now the software should be able to fully support Professional HMI Devices like Heidenhein tnc420 for example.
I don't own one myself, but one out of my Community does. Eventually when the Setup is working i will implement the Config in the code for others to copy.

Link to repo:
github.com/AlexmagToast/LinuxCNC_ArduinoConnector

I am very open to feedback if you tested my solution or have questions / suggestions.

Cheers, Alex
The following user(s) said Thank You: 0x2102, besriworld

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

More
10 May 2023 21:26 #271134 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion
Hi,
i just released a video showing the Project i build the Arduino_connector for.
It is a custom control panel for LinuxCNC. It's not the explanation Video i promised earlyer in this thread, but i thought you might still be interested.

Cheers, Alex
The following user(s) said Thank You: billykid, tommylight, 0x2102, besriworld, onceloved, panming

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

More
11 Jun 2023 19:04 #273343 by tommylight
The following user(s) said Thank You: AlexMagToast

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

More
30 Sep 2023 08:29 - 30 Sep 2023 08:35 #281913 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion
In this Thread i was talking with @COFHAL about the use of Encoders and Joysticks, both are supported by the Arduino-connector, but i didn't think somebody would want both in one build. I want to move here, to keep the discussion there to the topic of the matrix keyboard.
Here is the link to the discussion: forum.linuxcnc.org/show-your-stuff/49606...ng-linuxcnc?start=40

@COFHAL, the Encoder and Joystick will generate different counters, with different values. Are you able to write HAL code to switch between them, to use two different Counter Inputs for one Axis?
Also the scale Value will have to be different, depending on the input.
Last edit: 30 Sep 2023 08:35 by AlexMagToast.

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

Time to create page: 0.097 seconds
Powered by Kunena Forum