Advanced Search

Search Results (Searched for: )

  • seuchato
  • seuchato
06 Aug 2025 14:44

M1xx: Controlling Relays (solenoids) from within axis MDI

Category: Advanced Configuration

Hi all
I was looking for a way to control my vacuum table's vacuum pump from within axis. After reading the manual, searching linuxcnc's forums, I realised others were probably struggling with similar tasks (myst, dust extraction, ...), too. I could not find a proof cooked recipe. Below, you'll find what I am ready to go with. It is a proof of concept at the time. However, and since I use same/similar components the same/similar way in home automation, I am positive, it works in the real harsh world. Teaser wanted?
 
The KDialog message box is being called by M100, this reads the relays statii and displays as shown

So: let's go, just a remark: the editor seems to be disfunct, so I use my own marking:
Ingredients:
=====================================================
* github.com/ondrej1024/crelay
* a crelay compatible USB relay controller card, I used this one: 
* some time
Setting stuff up:
=====================================================
* follow the installation intructions of ondrej, should you fail (like me) at the first step (git clone git://github.com/signal11/hidapi.git), do this instead:
git clone github.com/signal11/hidapi.git
* If you'd like to have access to your relays over LAN. you can set it up as follows:cat /etc/crelay.conf  which crelay
 /usr/local/bin/crelay
sudo echo "user ALL=(ALL) NOPASSWD:/path/to/other/comands, /usr/local/bin/crelay" > user 
Replace "user" with the very username you run linuxcnc, check itcrelay 1
crelay 1 is on

That was a success, now get familiar with crelay:
crelay -i

Detected relay cards:
                                        #
#1    Conrad USB 4-channel relay card (serial 00633CF4) 
crelay 1 on
crelay 1
crelay 1 is on

I guess there is no comment needed, ondrej's work is just perfect, isn't it?
So we can set relays from command line, as user "user" (cnc in my case) and read their status. Howto do it from within g-code?

M1xx comes handy:

=====================================================

Place a script similar to attached M100 into the directory specified in the .ini file's [DISPLAY] section under PROGRAM_PREFIX = /home/cnc/linuxcnc/configs/cnc0/macros

My path above needs to be changed to your definition.
Maybe, there is some rebooting and logging in/out/in required. I did not make notes on this.

Things to consider:

=====================================================
This approach is not for real time requiring tasks. However, I think, for these tasks:
* clamping stock via vacuum
* starting dust extraction
* and mybe even myst
real time is not required


Hope that helps someone else, too
greez
chris



 
  • ihavenofish
  • ihavenofish
06 Aug 2025 14:33
Replied by ihavenofish on topic Mini wannabe datron build

Mini wannabe datron build

Category: CNC Machines

I am just using fusion for this.
  • besriworld
  • besriworld
06 Aug 2025 14:27
Replied by besriworld on topic Mini wannabe datron build

Mini wannabe datron build

Category: CNC Machines

Great job! What CAD program do you use for drawing? It looks very real.
  • PCW
  • PCW's Avatar
06 Aug 2025 14:21
Replied by PCW on topic vibration at lowspeed.

vibration at lowspeed.

Category: Advanced Configuration

Is your module real time? I have seen similar issues with non-real time
functions being affected by LinuxCNC periodic screen update. 
  • pommen
  • pommen's Avatar
06 Aug 2025 14:16
Replied by pommen on topic Encoder started misbehaving

Encoder started misbehaving

Category: Driver Boards

Yup, it was U15. I put a new one in and it works just as before.
Thank you again for your awesome support!

/Peter
Displaying 14131 - 14135 out of 14135 results.
Time to create page: 0.459 seconds
Powered by Kunena Forum