Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grbl + (2 Stepper motor) + (standard servo) = Mugbot. #220

Closed
EmmanuelAdetutu opened this issue Apr 15, 2013 · 22 comments
Closed

Grbl + (2 Stepper motor) + (standard servo) = Mugbot. #220

EmmanuelAdetutu opened this issue Apr 15, 2013 · 22 comments

Comments

@EmmanuelAdetutu
Copy link

@EmmanuelAdetutu EmmanuelAdetutu commented Apr 15, 2013

Awesome !! Now I have the GRBL flashed and works like a charm controlling my X,Y axis on my mugbot/painter like I want.
Now I need to make it control a simple standard servo for the penlift "http://www.adafruit.com/products/155 " . Any info/direction on how to do this will be well appreciated!!.

@csdexter

This comment has been minimized.

Copy link

@csdexter csdexter commented Apr 15, 2013

RC servos are controlled via a PWM-type signal and Grbl (on the ATmega328p) hasn't any resources left to do that for you.

It should be possible to make a frequency-to-PPM/PWM converter from a few analog components (so that you can use the speed of the third axis to control the servo), but that's a job for an analog electronics genius and I'm not it :-(

@derFrickler

This comment has been minimized.

Copy link

@derFrickler derFrickler commented Apr 15, 2013

There is a mod/fork of an old 0.8 grbl version which can use a servo on the Z-Axis:
https://github.com/heise/GRBLDRILL
It was done by the german ct magazin for a small PCB drill.
Unfortunately there is not much documentation about that, as far is i remember the servo does a full movement if you drive Z-Axis from 0 to +5mm via gcode. This can be changed somewhere in the code.
Just try the hex file from the github: https://github.com/heise/GRBLDRILL/blob/master/GRBL/grbl.hex
with a servo connected to analog4 on the Arduino.

Here is the link top the article, but you'll have to buy ist:
https://www.heise.de/artikel-archiv/ch/2012/03/068_Dreiachs-Motorsteuerung-mit-Arduino

@EmmanuelAdetutu

This comment has been minimized.

Copy link
Author

@EmmanuelAdetutu EmmanuelAdetutu commented Apr 15, 2013

HMMM..
@csdexter did I get you? , I mix a couple of components together then have a circuit which accept the steps/dir of z axis and on the other end moves my penlift servo. ...(I have a few soldering skills and should be able to do the mixing, if only I had the diagram....searching).

@derFrickler I'll give the hex a try, so to move my servo that will be Z5,"down" and Z0 "up" ... hope it works.

@scottrcarlson

This comment has been minimized.

Copy link

@scottrcarlson scottrcarlson commented Apr 15, 2013

@tutuemma2001 How about using an ATTINY45 to drive the servo? Am I right to assume the Penlift only has two position states? If so you could use one of the spair pins on TINY45 for command input from grbl. Lift, Engage... Not sure if that is helpful, but cheap alternative to hacking the grbl code.

@shapeoko

This comment has been minimized.

Copy link
Contributor

@shapeoko shapeoko commented Apr 18, 2013

@tutuemma2001 did you get this working? What was your solution? I tried flashing the forked grbl (with servo support on pin 4) to 3 or 4 different arduinos and none of them would work. They all came up with a verification error... can anyone verify that hex file is not corrupted?

Thanks!

@derFrickler

This comment has been minimized.

Copy link

@derFrickler derFrickler commented Apr 18, 2013

I can try it this evening or tomorrow.

@EmmanuelAdetutu

This comment has been minimized.

Copy link
Author

@EmmanuelAdetutu EmmanuelAdetutu commented Apr 18, 2013

No luck yet!!, I did email the German guy " GRBLDRILL" for some english explanation on how I can use it. If any one try please let me know. to get my stuff up n running I will replace the servo with a spare stepper (though a waste but avoid heads banging!!).

@rawkstar320

This comment has been minimized.

Copy link

@rawkstar320 rawkstar320 commented Apr 18, 2013

what about just using a tiny stepper motor? see: https://www.sparkfun.com/products/10551

But I have seen smaller/cheaper ones before.

Or maybe a solenoid would work better: https://www.sparkfun.com/products/11015

@shapeoko

This comment has been minimized.

Copy link
Contributor

@shapeoko shapeoko commented Apr 18, 2013

Using a tiny stepper isn't a bad idea. For my application, if I could find
one small enough I could probably mount it in the horizontal position then
simply attach a flapper to it, effectively creating the same functionality
as the servo.

The solenoid is probably more in line with the idea of a binary position
than the stepper. However, driving it would still require some grbl
hacking. I have a pretty tiny one drom mcmaster but believe it requires 24
volts to drive, meaning i would have to setup a relay of some sort.

My other though is to just use a second arduino to drive the servo. I could
tie into the z dir pin and poll for its state. If z is going in the
positive direction, I think zdirection is HIGH if its going negative, I
think it goes LOW.

I'm going to spend some time layer and try compiling the existing modified
grbl with servo support to see if that clears up the hex file issue. Then
decide where to go from there.

-Edward

Sent from my iPhone

On Apr 18, 2013, at 6:32 AM, rawkstar320 notifications@github.com wrote:

what about just using a tiny stepper motor? see:
https://www.sparkfun.com/products/10551

But I have seen smaller/cheaper ones before.

Or maybe a solenoid would work better:
https://www.sparkfun.com/products/11015


Reply to this email directly or view it on
GitHubhttps://github.com//issues/220#issuecomment-16571300
.

@rawkstar320

This comment has been minimized.

Copy link

@rawkstar320 rawkstar320 commented Apr 18, 2013

Good call, a second arduino is pretty expensive...check out the Digispark: http://digistump.com/

At ~$10 per Arduino, it looks perfect to me. You dont really need the 30 pins an Uno offers.

@derFrickler

This comment has been minimized.

Copy link

@derFrickler derFrickler commented Apr 20, 2013

Just tested the hex file with the servo option on an arduino nano - works fine.
It an old 0.8 version, but if i fire Z5 or Z0 the servo on analog4 moves from one end to the other.
Maybe you had a problem on the download. my Link to the hex just pointed to the download page, not the actual hex file (so you saved the html page as hex which causes the corruption error). This is the right link to save as hex file: https://github.com/heise/GRBLDRILL/raw/master/GRBL/grbl.hex
right-click, save as and flash it via avrdude.

btw, you can get an arduino for 6USD:
http://www.banggood.com/Wholesale-New-Ver-Pro-Mini-ATMEGA328-328p-5V-16MHz-Arduino-Compatible-Nano-Size-p-68534.html
Buy a USB to TTL adapter once and use cheap and small arduino nanos afterwords as you wont need the usb connection in most of your cases after programming.

@EmmanuelAdetutu

This comment has been minimized.

Copy link
Author

@EmmanuelAdetutu EmmanuelAdetutu commented Apr 22, 2013

Hi guys thanks!! , been ill a few days... but this morning I tried out the correct hex file @derFrickler with the servo on analog 4 works ok. @shapeoko just use the hex file and you should be fine. Once I clean up all my cabling, I'll post a movie/files of it working. Comparing all the other option this is simply the best, simplest and cheapest.

@derFrickler

This comment has been minimized.

Copy link

@derFrickler derFrickler commented Apr 22, 2013

good to hear!
So if i ever want to convert my laser-engraver to a pen plotter, i can just use that firmware and an additional servo ;_)
http://der-frickler.net/technik/lasergravierer

@shapeoko

This comment has been minimized.

Copy link
Contributor

@shapeoko shapeoko commented Jul 23, 2013

It's been quite a while since I chimed in on this thread, but I thougth I'd post back with an update:

1.) Thanks for the file derFrickler! That did the trick.
2.) I picked up one of the dual stepper driver shields from iteadstudio in hopes of getting it working with grbl (Steppers on X&Y, servo on Z). However, because of the hardwired pinouts on the shield, I'm having a heck of a time getting it all tied together.

Here is a link to the shield's data sheet and pinout. ftp://imall.iteadstudio.com/IM120417015_Dual_Step_motor_driver/DS_IM120417015_Dual_Step_motor_driver_shield.pdf

Can anyone take a stab at what needs to be done to make it work with grbl? So far, I have tried remapping the pins in config.h to match the shield, BUT I'm afraid that some of the other pins are messing with the functionality of the build. Most noteably:

  • Digital pins 4&5 are hardwired to XMS1 & XMS2 and the same for 8&9 for YMS1 & YMS2. I cut the traces for XMS1&2, which seemed to solve the problem, but to no avail on the Y.
  • plugging in the servo to Analog 4 puts the arduino into a reset loop, which is still stumping me.

Any thoughts on any of this?

-Edward

@metropt

This comment has been minimized.

Copy link

@metropt metropt commented Nov 11, 2013

ANy news on it? cOuld you elaborate how a solution with a attiny could work? Thank you

@natevw

This comment has been minimized.

Copy link

@natevw natevw commented Jan 16, 2015

I came across Z-Axis servo driver today. It looks like a very simple circuit to wire and uses a cheap ATtiny to convert stepper signals output from GRBL, to servo PWM.

@DmitryZlato

This comment has been minimized.

Copy link

@DmitryZlato DmitryZlato commented Jan 19, 2015

Hello guys! Sorry for stupid question, how to flash the firmware what @derFrickler and @shapeoko says about? I mean this https://github.com/heise/GRBLDRILL/raw/master/GRBL/grbl.hex . I see in a repository archive a bat-file for AVRDude, but it is not working. Of course, I changed com-port name to actual name. I have no any programmer device, just connect my Arduino Uno r3 to PC via USB. Could you help me, please. Oh, I forgot, AVRDude says "avrdude: stk500_getsync(): not in sync: resp=0x00"

@robottini

This comment has been minimized.

Copy link

@robottini robottini commented Aug 12, 2015

I write a GRBL 0.9i change to support a servo motor with M03 Sxxx and M05 command. The link is: https://github.com/robottini/grbl-servo

@afingrut

This comment has been minimized.

Copy link

@afingrut afingrut commented Oct 28, 2015

I'm looking into the possibility of diving more than one servo using grbl. Has anyone encountered this? Is there a straight forward solution?

@eatyone

This comment has been minimized.

Copy link

@eatyone eatyone commented Mar 9, 2016

robttini, i've tried your code, many thnx. I've just have a problem, when i send M03 S010 for exemple, the motor start, but never stop... (uno R3 and a parallax servo). Any idea?

@eatyone

This comment has been minimized.

Copy link

@eatyone eatyone commented Mar 9, 2016

(it was a continous servo, not a servo) have to find a real servo now.

@aldoeuge

This comment has been minimized.

Copy link

@aldoeuge aldoeuge commented Aug 14, 2016

hello, i have a problem when using GRBLDRILL, the y axis sometimes moves back and forth , and some other times it only moves one way, and it doesnt really work, ive tried using the regular grbl v.9 and it works perfectly, both axis move perfectly. so its a grbldrill problem, anyone has solved this?? thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.