Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: 1 [2]
Author Topic: Repetier version of Polar Graph
patricio.r-
ivera
Newbie
Posts: 12
Permalink
Patricio Rivera
Post Re: Repetier version of Polar Graph
on: August 29, 2015, 10:29
Quote

Hi! Great job Rick!

Im getting an error running from source on processing 2.2.1

https://github.com/RickMcConney/PenPlotter/issues/1

Thanks a lot!
Patricio

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

I run with 2.2.1 on mac and windows. It may be the version of the controlP5 library you are using. I have uploaded the versions of the libraries I am using to github here is the link https://github.com/RickMcConney/PenPlotter/releases. download and unzip the libraries.zip file in the processing/libraries directory. Then restart processing and see if it fixes the issue.

patricio.r-
ivera
Newbie
Posts: 12
Permalink
Patricio Rivera
Post Re: Repetier version of Polar Graph
on: August 30, 2015, 19:29
Quote

With the latest version of controlP5 works fine. Thanks.

And well... i ve been investigating this... and...
I edited configuration.h in repetier to enable a Full graphic smart controller and sd card features.

Everything seems to be ok, the PenPlotter starts to move... but... there is an issue (I'm not sure), with homing... or the scale of the objects... very strange behaviour.... (see pictures)

https://www.dropbox.com/sh/mypi8jow4ke19mm/AACdAKVjb8sxSRDt0SfQNblua?dl=0

It would be a great feature to print directly from a SD card without a pc!!!

Thank you!!!

Patricio

elmkom
Newbie
Posts: 14
Permalink
elmkom
Post Re: Repetier version of Polar Graph
on: August 31, 2015, 01:37
Quote

I do not have the SD card and screen. I hacked up the repetier code as I was only interested in the smooth path planner that gives smooth motion. I never tried using the SD card. I tried to change as little as possible. So it is very possible I missed some changes needed for the SD card support.

Here is a thought, I send two important commands at start up that set the machine size and home position. If you reboot and run from the SD card the file will not have these commands in it so the scale may be messed up. Try adding these two commands to the start of the file.

M4 X<machineWidth> E<penWidth> S<stepsPerRev> P<mmPerRev>

M1 Y<yhome>

replacing the <var> with your values.
eg.
M4 X2127 E0.5 S6400 P80
M1 Y400

The steps are the motor steps times the micro step setting
in my case 400*16 = 6400

When I get a chance I will take a look to see if there is something easy that can be done to support it. But as I do not have the SD card option I may not be able to fix it.

Homing is not supported. You just move the gondola manually to the home position and hit the set home button whilst connected to the ramps board. The Y home position needs to be set in the properties file or can be adjusted in the GUI by dragging the X axis handle. It must be set to the vertical distance in mm from the line between the motors and the home point. The machine width also needs to be set in the properties file or by adjusting the machine width handle in the gui. If set in the GUI remember to save the changes with the save button.

PS.

I just wiped and reloaded my arduino and found that the code posted was not working as expected. Was moving very slowly. I guess I must of had some settings in the eeprom that where not captured in the configuration file. I uploaded a new version that corrects this.

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

I have just posted a new version v0.6 of the Pen Plotter.
https://github.com/RickMcConney/PenPlotter/releases

The new version is a significant rewrite. I have refactored the code into a cleaner class structure.

The restructuring now allows for all image treatments (with the exception of the diamond pixel, as it uses non standard gcodes) to be exported into gcode files.

I have also added a square pixel and stipple treatment that uses only standard gcodes. The stipple treatment is taken from the stipple gen program. The stipple code has a new dependency on the toxi library. I have included it in the libraries.zip file of the release.

Here is a screen shot of the stipple treatment.

Image

kongorilla
Pro
Posts: 358
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: August 31, 2015, 04:19
Quote

You are a coding beast!
-k

patricio.r-
ivera
Newbie
Posts: 12
Permalink
Patricio Rivera
Post Re: Repetier version of Polar Graph
on: August 31, 2015, 08:58
Quote

I Agree with Kongorilla. You are a master!

1) Before you write to you, I studied the behaviour of the controller, and I realized that, so I tried adding the code you mention directly to the file, without success. I will continue trying. Print from SD card is a great feature, I use it in all my 3d prints. Faster and secure, without hardware attached.

Im using http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller

Just set #define FEATURE_CONTROLLER from 0 to 11

and in our case: #define UI_LANGUAGE 0 (english)

Home it manually, plug the SD, press the encoder and you are now drawing!

There would be another option: use only a SD breakout like this:
http://www.polargraph.co.uk/2012/02/state-of-the-art-tangle/

And then just "print from card" from a button in the controller.

2) To avoid your EEPROM issue, I suggest to change to 0 this
#define EEPROM_MODE 0

In your version 0.5 is set to 1.

3) There is a feature to consider: change the start and finish point degre of the servo arm. I changed them hacking your code at:

void sendPenUp()
{
send("G4 P250\n");
// send("M340 P3 S2350\n");
send("M340 P3 S1300\n"); // my servo value
send("G4 P250\n");
showPenDown();
}

and the same for sendPenDown() with its specific value.

Thank you very much!!!
Patricio

patricio.r-
ivera
Newbie
Posts: 12
Permalink
Patricio Rivera
Post Re: Repetier version of Polar Graph
on: August 31, 2015, 12:34
Quote

Rick! I am testing v0.6... the movements of the motors are perfect now. Like a melody!

Well... the great news for me: i am able to print directly from SD!!!

It could be silly, but the problem was that de gcode exported is different that the sent by the controller to the interpreter!!!

I tested copying the gcode shown at the java console, clean it from their "ok 0" responses, copy all to SD card and print it like a charm.

The only problem (by now, until forked your repository 🙂 ) is that i have to disconnect the power, simulate a print and when it finish, do manually the procedure of cleaning and setup the gcode.

Congrats to you!

PD: could you please explain the why of this output difference between export option and "direct print"?

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

The difference most likely is due to the pen up down commands. I use a dwell and servo commands when talking directly but I change this to Z motion commands when exporting to gcode. This was done to support other cnc machines that do not have sevo motors. I guess I should add an option in the properties file to control this. I can also add an option to set the servo values that you had to change. Here is a quick workaround until I get a chance to fix it.

Change the sendPenUp and down functions in the Export file to send the same codes as the sendPenUp and down commands in the comm file and this should fix your problem.

Eg change this in Export.pde
public void sendPenUp() {
send("G0 Z"+cncSafeHeight+"\n");
}

public void sendPenDown() {
send("G0 Z0\n");
}

To This

public void sendPenUp() {
send("G4 P250\n");
send("M340 P3 S2350\n");
send("G4 P250\n");
}

public void sendPenDown() {
send("G4 P250\n");
send("M340 P3 S1500\n");
send("G4 P250\n");
}

Glad to here its working for you.

PS. I just realized another difference. I change the origin of the exported commands so that the home position is 0,0 instead of its large value of say 400,400. So this will move your print. So you will need to remove all the -homeY and -homeX from the send calls. I will add an option in to fix this.

patricio.r-
ivera
Newbie
Posts: 12
Permalink
Patricio Rivera
Post Re: Repetier version of Polar Graph
on: August 31, 2015, 16:06
Quote

Yes, you are right. Now the outputs are the same but still remaining these 2 g codes at the beginning in the exported file: G21 (metric/imperial) and G90 (absolute/relative modes).

While, I add these (you mentioned they are important):

writer.write("M4 X" + machineWidth + " E" + penWidth + " S" + stepsPerRev + " P" + mmPerRev + "\n");

writer.write("M1 Y" + homeY + "\n");

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

I have upload a new version to github that should fix your issues. You now have servo.dwell, servo.upValue and servo.downValue in the properties file that you can adjust your servo settings.

I have added a file type in the export dialog. You can now choose between cnc and pen plotter. The cnc will change the servo motions to z motions and move the origin to 0, 0. The pen plotter option will keep all the commands unchanged and add the machine spec commands to the top of the file. So this should be the one you want if you run it from the SD card. The default is pen plotter format.

One side effect is that if you try to reimport a pen plotter file it will now be offset from the origin by the machines home positions. So if you plan to export and reimport use the cnc version instead.

I now also send the extra gcodes you mention to the arduino it should not hurt to set the units and mode to absolute.

patricio.r-
ivera
Newbie
Posts: 12
Permalink
Patricio Rivera
Post Re: Repetier version of Polar Graph
on: September 3, 2015, 08:48
Quote

I am feeling like the genius and the lamp.

Drawing like a charm.

It could be a great idea to change paper size from the GUI. In my case I edited: pWidth and pHeight in drawPaper() to fit my usual size.

Thanks!
Patricio

patricio.r-
ivera
Newbie
Posts: 12
Permalink
Patricio Rivera
Post Re: Repetier version of Polar Graph
on: September 3, 2015, 18:12
Quote

Another idea: It's always good practice to insert a comment header at the beginning of the gcode to remind you settings, position, etc!

elmkom
Newbie
Posts: 14
Permalink
elmkom
Post Re: Repetier version of Polar Graph
on: September 5, 2015, 20:57
Quote

All good ideas. I have added the ability to adjust the paper size from the GUI just drag the handles to the right and bottom of the paper. The adjusted size is saved in the properties file if you hit the save button.

I also add some comments to the exported gcode file. So you know what the original file was and what the treatment and settings were when the file was exported.

I also messed with the communication code to try and resolve the issue you reported on github. It may fix the issue but I could not reproduce it on my end. Most likely because my defaults in ramps are the same as the specs I send so missing that command for me has no effect.

I moved the size and location of the gondola to the bottom status line so it no longer gets hidden when zooming. The plot progress is now also shown on the status line.

Thanks for the feed back, makes it better for every one.

patricio.r-
ivera
Newbie
Posts: 12
Permalink
Patricio Rivera
Post Re: Repetier version of Polar Graph
on: September 6, 2015, 19:32
Quote

Thanks a lot. I will try it soon.
What version of repetier are you using for this project? 0.91 or 0.92?

Thanks!!!!
Patricio

Edited: 0.91 sorry

kongorilla
Pro
Posts: 358
Permalink
kongorilla
Post Re: Repetier version of Polar Graph
on: April 19, 2016, 02:07
Quote

More PenPlotter fun:
BirthdayDrawings

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