Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1] 2
Author Topic: Repetier version of Polar Graph
elmkom
Newbie
Posts: 14
Permalink
elmkom
Post Repetier version of Polar Graph
on: August 18, 2015, 02:54
Quote

Hi all, had a great time building and playing with this plotter. I created a new version of the firmware based on the 3D printing firmware Repeitier. I also wrote a compatible controller that runs in processing 2 or 3. You can check out the features and see some screen shots on git hub at https://github.com/RickMcConney/PolarGraph
The source code is also there.

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: August 18, 2015, 06:21
Quote

Wow, Rick, good work! I'll have to give it a try sometime. Wish I had an extra Mega/Ramps laying around.

I've been building GRBL controlled cartesian plotters lately, and I wish I was knowledgeable enough to write a controller for them. While there are plenty of ways of generating gcode from SVGs and images, they're all either overly complicated for pen plotting, hardware/firmware specific, or fatally flawed in some other way for my purposes. Life would be so much easier if I could do what you've done.

I see your pixel drawing has custom gcodes. Are the codes for drawing SVGs standard? Is there a way to save the gcode to a file, so I could try the output with one of my machines?

Again, well done. Much respect!
-k

elmkom
Newbie
Posts: 14
Permalink
elmkom
Post Re: Repetier version of Polar Graph
on: August 18, 2015, 13:26
Quote

Thanks, Yes the gcodes for the svg are standard, however to work on a cnc I would need to change the servo controls to move the Z axis instead of the M340 code I use today. I could make G0 move the Z axis up say 5mm then have the other G1-G3 codes move it back to Z=0. I do not have a feature at the moment to export the gcode but that would be easy to add. I will see what I can do. I also have built a Grbl based CNC so I should be able to see if the exported gcode works on that.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Repetier version of Polar Graph
on: August 18, 2015, 14:17
Quote

Beautiful! Kong is right there's a real lack of a simple g-code tool. Something in between typing g-code yourself and all-singing CNC software. This could be a useful tool for g-code and drawbot experimenters.

This looks great (and finally running in Processing 2 :)), but I have one request: Please change the name of this repo. It isn't a tool for polar graphs, and a polargraph is a specific thing made by me, not a generic term for hanging-V pen plotters.

cheers!
sandy noble

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: August 18, 2015, 20:38
Quote

@elmkom - Switching the code to use a stepper for z could be good for your v-plotter, too. On my cartesian plotters, I've been using cheapo 28byj-48 steppers for pen lift, and the silence is wonderful. Now, when I use my polargraph, the servo noise _really_ gets on my nerves because I know it could be made to go away if I was smart enough to code the change. (I've been doing stipple drawings on the polargraph, so the servo noise is constant....*ugh*)

If you could make your controller a simple, general purpose SVG to g-code tool for pen plotters, (GRBL friendly a plus), I'd kiss you full on the lips. Or rake your yard. Whatever.
-k

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Repetier version of Polar Graph
on: August 18, 2015, 22:08
Quote

Hey there's an offer I never got! Do you still trail wires (x4) to the pen lift? I guess the speed of the geared steppers isn't so much different to a servo?

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: August 18, 2015, 22:44
Quote

Sandy, it's only because I know there's a continent and an ocean separating us that I haven't made the same offer to you.

To answer the wiring question - on the drum plotter(s) I've made, I use the geared motor to tilt the whole x axis (y axis is the drum), such that it lifts the pen off the paper, so there's no need for wiring to the carriage. On the large format plotter, the pieces of which are scattered all over the floor behind me, the stepper wires do go to the carriage, looking something like a bowden tube. (That plotter isn't wall mounted; it's horizontal in use, so I can use india ink pens. Therefore, I can't have the stepper wires dangling onto the page).

For use on a polargraph gondola, I'd cut the 28byj-48's thin but stiff wires off and rewire using the floppy wires from servo extensions. (What is that stuff, anyway?)

Yes, the motors can lift the z as fast as a servo. They're strong enough to turn a custom horn that lifts the pen in an instant.

Sorry for hijacking the thread, Rick.
-k

elmkom
Newbie
Posts: 14
Permalink
elmkom
Post Re: Repetier version of Polar Graph
on: August 19, 2015, 13:44
Quote

Hi, no problem sandy, I have changed the name to PenPlotter here is the new link.

https://github.com/RickMcConney/PenPlotter

I have also added the export. Just load an svg file right click drag to position it relative to the origin and scale it to your liking and then hit export.

The zero position of the exported file is the center home position of the plotter. As the plotter's positive direction is down the page you may get a mirror image if your machine's positive direction is reversed. Also I move +5mm for a pen up and to Z=0 for a pen down. So please check you directions before running on your machine. I may need to add a safe height option to the parameters file if this is a problem.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Repetier version of Polar Graph
on: August 19, 2015, 21:04
Quote

Thanks, this is really great. I know it probably seems like I'm being a dick about the name, but I appreciate the change.

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: August 20, 2015, 00:17
Quote

Rick, thank you! I just plotted a simple drawing on one of my little drum plotters using code generated by your controller. Worked! I needed to update my geomeratrive and controlP5 libraries to the latest (I got a bundle of errors until I did that), but other than that, it was smooth sailing.

There is another issue -- the plot is flipped i̶n̶ ̶b̶o̶t̶h̶ ̶t̶h̶e̶ ̶x̶ ̶a̶n̶d̶ ̶y̶. along the Y axis. I know it's not my machine because the preview in Universal GCode Sender shows the same flipping. This isn't a huge concern for me because I can always flip my art in Inkscape.

Cool stuff!

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: August 20, 2015, 00:42
Quote

Yeah, only the Y axis is flipped:

Image

elmkom
Newbie
Posts: 14
Permalink
elmkom
Post Re: Repetier version of Polar Graph
on: August 20, 2015, 03:38
Quote

Yes this is what I mentioned in my comments as the pen plotter has Y down the page but most gcode machines have Y up. I could add a flip Y setting in the properties file. I will look at it more this weekend and see if there is a better way to do it.

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: August 20, 2015, 19:19
Quote

I guess I was so excited that you posted a version with export I only skimmed the last paragraph and dashed to Github!

Even with the flipping, using your controller is much easier than setting up the gcode tools in Inkscape, and I'll be using it. Like Sandy wrote, the ever-growing drawbot community could use a straight forward tool like this, so if you ever have any interest in developing it more, let me know how I can help.

Otherwise, I'll try not to pester you too much.

(Contrary to what I just stated) I tried to export a Windows exe, but always get a blank window when I launch the result. Anything I could can do about this?

elmkom
Newbie
Posts: 14
Permalink
elmkom
Post Re: Repetier version of Polar Graph
on: August 22, 2015, 02:42
Quote

Hi, I have added some buttons to flip the plot around the Y or X axis so you can just flip in Y before exporting. I have also added a cnc.safeHeight setting to the properties file so you can change it to what ever is a good height for you. The default is 5mm.

The application launch most likely failed because I forgot to initialize the safeHeight variable when creating the properties file for the first time.
I have fixed that and have added a windows 32 release in the git hub release directory.

If you are not connected to a plotter the plot button lets you step through the plot so you can see what order the paths are plotted in.

I also altered the path optimization routine to pick paths that both start and end near the pen first. I think this should in general give a better path.

Let me know if you find any other issues.

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: August 22, 2015, 21:09
Quote

I downloaded it, got it compiled, successfully made an exe, played with settings -- everything seems to be working great. I hadn't played with the handles (for setting machine width and height, and moving home ) before. Really cool! In the future I'm sure I'll have an instance of your controller for each of my drawing machines so I don't have to keep adjusting the sizes, but the until then, your UI is appreciated.

What's killing me is I have a bunch of work to finish this weekend, so I can't actually set up a drawing. I shouldn't even be typing this now. Arrgh!

Someday I'm going to want to make a special version of your controller that doesn't do short segment culling (my stipple drawings are made up of very short segments). Is there a threshold value I can change, or a block of code I can comment out?

Thanks again!
-k

elmkom
Newbie
Posts: 14
Permalink
elmkom
Post Re: Repetier version of Polar Graph
on: August 23, 2015, 22:51
Quote

I added an svg.shortestSegment setting in the properties file. I defaulted it to zero so no segments will be removed.

I also added support for drawing images in a cross hatched style similar to blackstripes MK1. This renders a much more detailed image but uses lots of pen lifts, Hope my servo does not give out.

Image

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: August 23, 2015, 23:38
Quote

Yes, Virginia, there is a Santa Claus, and his name is Rick "elmkom" McConney.

Gotta' get my work done so I can play!
-k

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: August 24, 2015, 19:38
Quote

I tried the new version late last night, and did a nice crosshatch drawing on my "toy" drum plotter (it's small and sloppy). This is so exciting!

The issues I've run into, using Processing 3
1. At launch, get following errors:

Use surface.setResizable() instead of frame.setResizable in Processing 3
Use surface.setTitle() instead of frame.setTitle in Processing 3

2. Flipping on the X doesn't work -- console says:

SEVERE: An error occured while forwarding a Controller event, please check your code at mirrorX

and then lists many problems

3. Flipping the Y works (no errors), but does not flip around the image's true center. As a result, part of the image goes out of bounds (of the green frame), and is thrown out (if you flip the Y back, the part of the image that was out of bounds is permanently lost. The lost area is drawn black by the pixel filter).

4. As seen in your crosshatch example, there's always a section (corner?) where the crosshatching fails to get drawn. Sometimes it's kinda' neato the way image starts to fall apart. It's the kind of bug that feels like the code is collaborating artistically.

Thanks again for the fun, Rick.
-k

elmkom
Newbie
Posts: 14
Permalink
elmkom
Post Re: Repetier version of Polar Graph
on: August 25, 2015, 02:16
Quote

The surface and title errors can be ignored. Processing 3 issues these errors but the code still works fine.

I have fixed the other bugs you found. Was sampling out of bounds on rectangular images. This also fixed the issues you saw with the hatch not going all the way to the corners of the images.

I also centered the image so the flip now stays in view. You may still need to drag the image with the right mouse button to tweek its position.

It is fun to play with the slides to see the effect on the image. I usually adjust the T1 slider to just leave a bit of pure white then stagger the other sliders to add shadows.

The pixel size slider can be used to increase or decrease the density of the lines.

Thanks for reporting the bugs.

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: August 26, 2015, 02:03
Quote

Plot done on my prototype "toy" drum plotter, using Rick's PenPlotter to generate the gcode:
Image
Image

Pages: [1] 2
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.033 seconds.