Welcome! Log In Create A New Profile

Advanced

Use 4 module relay with cnc shield for arduino

Posted by ghomghom59 
Use 4 module relay with cnc shield for arduino
April 07, 2016 03:59AM
Hello friends,

I explain my problem, so I use GRBL flashed in my arduino with CNC shield to control motor ( Axes X and Y) but the problem is for my axe Z I use pneumatic energy to control axe Z.

however, I une universal G-code sender from my PC to control X and Y and it's work perfectly.

so how I can do to control Z with 4 modul relays?

I must change GRBL code ? in which file ?

You found in attach file : CNC document et 4 module relays document

Thank for all reply

(sorry my english is bad )

From France...
Attachments:
open | download - cnc.jpg (187.8 KB)
open | download - relays.jpg (25.6 KB)
Re: Use 4 module relay with cnc shield for arduino
April 07, 2016 05:49AM
All axis have 3 control lines enable, step and direction

The firmware only knows about this.

Enable turns on the controlling driver
Step tells it to move one step
Direction tells it which direction to move in

So basically it enables, then sets the direction, then sends out enough step pluses to move the distance requested

The easy might be to make some hardware that takes these signals and applies it to your pneumatic control system.

But you needs to know the exact pneumatic control system... what needs to be turned on to do what, is there any positional information encoders and the like, any documentation??

The software approach is beyond me, but you will still need the documentation for your pneumatic control system
Re: Use 4 module relay with cnc shield for arduino
April 07, 2016 08:47AM
Now I control with my raspberry Pi 3 the Z axes with this code:

#!/usr/bin/python
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

# init list with pin numbers

pinList = [2, 3, 4, 17]

# loop through pins and set mode and state to 'high'

for i in pinList:
GPIO.setup(i, GPIO.OUT)
GPIO.output(i, GPIO.HIGH)

# time to sleep between operations in the main loop

SleepTimeL = 1.5

# main loop

try:
GPIO.output(2, GPIO.LOW)
print "Z HIGH"
time.sleep(SleepTimeL);
GPIO.output(2, GPIO.HIGH)

GPIO.output(17, GPIO.LOW)
print "Z LOW"
time.sleep(SleepTimeL);
GPIO.output(17, GPIO.HIGH)



GPIO.output(2, GPIO.LOW)
print "Z HIGH"
time.sleep(SleepTimeL);


GPIO.cleanup()
print "Finich"

# End program cleanly with keyboard
except KeyboardInterrupt:
print " Quit"

# Reset GPIO settings
GPIO.cleanup()


so I use raspberry with G-code sender to control Z axes...

now my question is how I can control Z with G-code sender???
VDX
Re: Use 4 module relay with cnc shield for arduino
April 07, 2016 11:19AM
... read my answer in your other thread for custom codes in the G-Code-file or modifying the G-Code parser.

For laser-engraving with common CAM-programs or RepRap-software I've embedded a small Arduino into the laser-driver itself, which reacts to analogue voltage set per G-codes or the STEP-pulses meant for the Z-motor ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Sorry, only registered users may post in this forum.

Click here to login