ReplicatorG - How do I run the tool path backwards (top to bottom)

182 views
Skip to first unread message

WMc

unread,
Jan 27, 2013, 2:28:22 PM1/27/13
to make...@googlegroups.com
Hi All,

Would anyone be able to tell me how I could get my Makerbot Replicator to run the tool path in reverse (I assume using ReplicatorG for the base code).  I.e. Starting in the final location and ending at the start location with the build plate starting distant moving towards the extruder.  

I already hear people asking why would you want to do that?  Don't despair, there is method to this madness, but I don't want to look like a fool too early on ;)

Would really appreciate some help from a coder out there.

Thanks in advance,

Wes  




Jetguy

unread,
Jan 27, 2013, 6:05:34 PM1/27/13
to MakerBot Operators
Why code it? It's text gcode. Just get some word app that can reverse
lines in a text document. You'll have to copy only the gcode and not
the start and end codes as you need the steup to home the bot and get
the initial startup correct.
Ha, just do it online as I described
http://textmechanic.com/Sort-Text-Lines.html

Outlien would look like this:
start gcode
actual gcode
end gcode

Copy the actual gcode to the site, use the reverse function to re-
order the lines,
Past back into the gcode after the start gcode.
Ensure the end gcode is in place and appropriate for you machine.

Justin Leone

unread,
Jan 27, 2013, 6:20:45 PM1/27/13
to make...@googlegroups.com
I know you said there was a reason, and implied we shouldn't ask, and said you weren't ready to give an answer, but I simply cannot not ask:  Why do you want to do this?  What madness drives you?  Are you involved in unsanctioned time travel activity that should be reported to some authority?

WMc

unread,
Jan 27, 2013, 6:40:06 PM1/27/13
to make...@googlegroups.com
Cheers for the advice and link, it is kinda what I was thinking but wanted some assurance.  Was really trying to figure out where the breaks were between the start, actual and end code.  The end code is very clear, Ta-Da! :

(******* End.gcode*******)
M73 P100 ( End  build progress )
G0 Z150 ( Send Z axis to bottom of machine )
M18 ( Disable steppers )
M104 S0 T0 ( Cool down the Right Extruder )
G162 X Y F2500 ( Home XY endstops )
M18 ( Disable stepper motors )
M70 P5 ( We <3 Making Things!)
M72 P1  ( Play Ta-Da song )
(*********end End.gcode*******) 

Start code end I'm not as confident with.  I assume the red text means "commented out"? My guess is I take everything from (<layer> 0.1 ) down as the actual code.  Is this right?  

(<procedureName> carve </procedureName>)
(<procedureName> preface </procedureName>)
(<procedureName> inset </procedureName>)
(<procedureName> fill </procedureName>)
(<procedureName> speed </procedureName>)
(<procedureName> raft </procedureName>)
(<procedureName> jitter </procedureName>)
(<procedureName> comb </procedureName>)
(<procedureName> cool </procedureName>)
(<procedureName> dimension </procedureName>)
(<procedureName> alteration </procedureName>)
(<procedureName> export </procedureName>)
(</extruderInitialization>)
(<crafting>)
;M113 S1.0
;M108 R22.5
(<layer> 0.1 )
(<rotation> (6.12323399574e-17+1j) )
(<nestedRing>)
(<boundaryPerimeter>)
(<boundaryPoint> X-10.0 Y-10.0 Z0.1 </boundaryPoint>)
(<boundaryPoint> X10.0 Y-10.0 Z0.1 </boundaryPoint>)
(<boundaryPoint> X10.0 Y10.0 Z0.1 </boundaryPoint>)
(<boundaryPoint> X-10.0 Y10.0 Z0.1 </boundaryPoint>)
(<edge> outer )
G1 X-9.8 Y-9.79 Z0.1 F6000.0
G1 F1200.0
G1 E1.0
G1 F6000.0
................
.........
etc

An alternative thought is can you give the Z values in G code a -ve value?  Maybe throw a -1 multiplier in their some how?  Then, shift the Z zero plane 100mm high of the build plate and print as normal but reverse the Z axis so it prints down not up?  Alternatively can you just reverse the connector on the Z stepper motor to achieve this more simply? Simplicity is the key.

Cheers

Jeremy Green

unread,
Jan 27, 2013, 6:41:50 PM1/27/13
to make...@googlegroups.com
I've never looked through the gcode in depth. Are there any relative moves or tool offsets? Seems like that could cause trouble.

-Jeremy
> --
>
>

WMc

unread,
Jan 27, 2013, 6:51:36 PM1/27/13
to make...@googlegroups.com
The truth is my Rep2 sucks balls, it never extrudes properly so wtf, I figure printing nothing in reverse will be an exciting change ;)  

WMc

unread,
Jan 27, 2013, 6:55:55 PM1/27/13
to make...@googlegroups.com
Yih, now you're feeling my concerns.  I guess the worst that happens is a smash my Rep2.  If I manage time travel I'll let you in on the secret. Time travel's awesome! 

Jetguy

unread,
Jan 27, 2013, 7:09:40 PM1/27/13
to MakerBot Operators
Well, I was mildy joking about just reversing the gcode order. You
should explain what your thought or idea is rather than just ask a
loaded and somewhat bogus question.

Read up on Replicator-G and Skeinforge which is what creates the
gcode.
One of the main things is that if you go into edit profile, you have
several options for profile type:
Milling- probably the one you want. Why else would you start at the
top down? http://www.thingiverse.com/thing:1743
Cutting-not sure what the difference is but assume laser cutter
Winding- not sure either but sounds interesting.

On Jan 27, 6:55 pm, WMc <wesleymcco...@gmail.com> wrote:
> Yih, now you're feeling my concerns.  I guess the worst that happens is a
> smash my Rep2.  If I manage time travel I'll let you in on the secret. Time
> travel's awesome!
>
>
>
> On Monday, January 28, 2013 7:41:50 AM UTC+8, Jeremy Green wrote:
>
> > I've never looked through the gcode in depth. Are there any relative moves
> > or tool offsets?  Seems like that could cause trouble.
>
> >    -Jeremy
>
> > On Jan 27, 2013, at 6:05 PM, Jetguy <barry...@hotmail.com <javascript:>>
> > > --- Hide quoted text -
>
> - Show quoted text -

Andy

unread,
Jan 27, 2013, 7:33:03 PM1/27/13
to make...@googlegroups.com, make...@googlegroups.com
The extrusion, E values, are relative to one another. If you just flip the "craft" gcode, the e values will also need reversing. Using SF retraction creates extra G1 E# commands, so you might want to properly handle those as well.

-Andy
> --
>
>

WMc

unread,
Jan 27, 2013, 7:58:10 PM1/27/13
to make...@googlegroups.com
Jeremy, Andy,
Thanks for your ideas.  Looks like I need to go away and learn every line in the code and then I'll be able to reverse it.  If not it seems I'll find trouble.

Jeremy,
Definitely not trying to rub you up the wrong way mate.  I'm not working on anything top secret but I didn't want to open up a discussion on cutting, routing milling etc.  You are right this is why you would start from the top down.  What I didn't want to do is open myself up a barrage of criticism on how am I planning to do this, that and the other because the answer is I don't know yet.  

I am just trying to conceptualise the possibility of using my makerbot with interchangeable tooling heads.  printing, milling etc.  Because my machine doesn't print I figured it was worth a try at making something else out of it.  

My flexible shaft dremel was one of my ideas. 

Looks like I'm goosed for now.  Will have to do some reading on the code and the intricate details. 

Cheers,
Wes
Message has been deleted

Jetguy

unread,
Jan 27, 2013, 8:35:56 PM1/27/13
to make...@googlegroups.com
Wes, I wasn't trying to give you too hard of a time.
Sometimes, you just have to take it in stride and it's been a
relatively boring day on the forum.

That said, there are a bunch off issues with milling on a
Replicator2.
Attaching the toolhead is the least of your problems. The X-Y and Z
are just not sturdy enough to support much is any load from milling.
Most mills are screw drive, most printers are belt drive.

I'm not trying to outright shoot the idea down,but at least
acknowledge that in 3 years of MakerBots, somebody else has tried
milling. http://www.makerbot.com/blog/2011/05/23/modding-a-makerbot-for-pcb-mi...
You aren't the first with this idea, but to date, nobody else has
succeeded and it wasn't good enough for more than 1 or 2 people to try
it and give up. Maybe the Replicator-2 is the magic one to work, but
just think about the milling dust alone getting into the linear
bearings and realize destroying your bot may not be worth the
experiment. The key to keep in mind is that the Cupcake and the
Replicator share a common belt drive. The same backlash problems will
be present. Notice a proper mill (take that with a grain of salt) uses
screw drives http://store.qu-bd.com/product.php?id_product=45

Here is good info on creating the gcode though:
http://makerbot.wikidot.com/roboteernat-s-mill-documentation-page

WMc

unread,
Jan 27, 2013, 9:27:28 PM1/27/13
to make...@googlegroups.com
Jeremy,
Boring day on the forum eh, sorry to disappoint.  There are way worse things in life than trashing a Makerbot.  Never the less I hear what you're saying and concede defeat on the milling application. I was also thinking of trying a 1-5w laser to cut shapes from a piece of polystyrene.  Hope your day gets more interesting!  I'm out for now,
Cheers   
  

  

Justin Leone

unread,
Jan 27, 2013, 10:54:49 PM1/27/13
to make...@googlegroups.com
Why doesn't it print?  Probably easier to get it to do what it's supposed to than try to make it do something it's not.  I've learned in my first month of printing that these machines (when they work) are a marvel of precision mechanics and sophisticated computing, but are otherwise remarkably simple.  There's just so many things that can go wrong with them, and any malfunctioning part can be fixed/replaced.

Martin Read

unread,
Jan 28, 2013, 12:27:29 AM1/28/13
to make...@googlegroups.com


On Sunday, 27 January 2013 23:51:36 UTC, WMc wrote:
The truth is my Rep2 sucks balls, it never extrudes properly so wtf, I figure printing nothing in reverse will be an exciting change ;)  



Hi, I don't want to side track your discussion, but have you tried one of the spring loaded extruder mods ? It's what finally made mine reliable.

cheers

Martin
 

WMc

unread,
Jan 28, 2013, 5:06:47 AM1/28/13
to make...@googlegroups.com

Justin,
Thanks for pointing out the obvious, and I have built the Mk8 upgrade.  I even modified it to include an adjustable tension spring using a nut and bolt.  I've also read every post there is on Replicator extruder problems.  Makersupport have sent me a new nozzle.  Basically it just doesn't extrude properly and I'm sick of trying things.  

It's either going to become a cool laser cutter, a trashed milling machine or a smashed Makerbot when I throw it off my balcony.

I really wanted to keep this topic focussed on how to change G code, reversing it in particular.  Seems that focus is lost.
Cheers,

         


Jetguy

unread,
Jan 28, 2013, 7:32:36 AM1/28/13
to MakerBot Operators
Back on topic, You do present an good question to understand how gcode
works now that we know what you intended to do.

If we look back to the days of DC extruder motors, the gcode was much
simpler. We couldn't run acceleration (BTW something you cannot do
when milling, you need constant fed rates), the old PWM commands for
the extruder were simply on/off after the initial setting the PWM rate
in the start.gcode. In that case, reversing the lines of gcode should
actually work. There was just a lot less to deal with and gcode in
gneral was much simpler. It was just sseries of movements, way less
comments, and way less extruder commands that don't matter.

The issue then is, you must run without acceleration, something the
newer firmware has. You can turn it off and in theory run straight
feedrates. We don't care at all about E numbers for the extruder, it
doesn't matter, we aren't using them. With a mill, you simply turn the
cutter on manually anyway at the start and let it run until finished.

So really, trying an older version of Rep-G like say older than
version 23 with SF classic desingned for DC extruders would create
suitable gcode. THe problem is, the machine.xml and the profile for SF
are not going to be able to connect to a bot that didn't exist back
then.

Going to the PCB creation I linked, you would be creating the gcode
external anyway via the plugin for Eagle CAD, and then printing it
with rep-g so no need for reversal of the lines. Just ensure
accelleration is off in the firmware.

And now for a gentle scolding. One reason I was midly annoyed was you
intentionally had an idea and didn't want to share it but wanted help.
MakerBot and this group was founded on sharing of ideas (AKA Open
Source). Some of us are really hacked off at MakerBot industries and
the CEO Bre Pettis who pledged Open source and preached it, but then
closed the source on your very Replicator-2. This prevents us from
being able to engineer fixes for that machine from a community of
owners. In other words, we have invested time and money into this
hobby and have shared a huge amount of knowledge freely but then
others are not willing to share. In the future, please take this into
perspective and share your ideas up front. It helps us a give a better
answer and it highly improbable that you came up with something that
hasn't been tried before. Sure, you added a twist that it was on a
Replicator 2, but that also means there have been a number of changes/
technology (acceleration for one) to actually hinder what you are/
were trying to do. Again, for you to have an idea and hold it back but
still want our help as if you might somehow make money on the idea is
somewhat rude. You should share openly. We would give you credit,
that's part of the rules of open source. It doesn't mean you lose all
rights to it, it just means you share in full disclosure since you
needed our source to get your product/idea to work.
Reply all
Reply to author
Forward
0 new messages