Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Im confused
jaromir
Newbie
Posts: 11
Permalink
Post Im confused
on: May 12, 2013, 00:58
Quote

Hello,

I read through everything accessible from http://www.polargraph.co.uk domain and I'm a bit confused.

1, Hardware:
1a, I'm not interested in SD card/display, can I build it and use without it?
1b, What motor driver should I use? On instructables, there is adafruit driver, but you mentioned pololu driver too.
1c, Is beaded cord necessary? Could I use another cord type, or are there some pitfalls?
1d, Is servo pen lifter necessary?

2,PC software
2a, What can I do without actually having hardware? I tried running prebuilt software. As I load image, I see it on "board", I can resize it, but changing grid size or pixel scaling does nothing. I expected preview of what it would like to look in reality.
I looked into instructables section regarding software, but it seems to be slightly outdated.
2b, Sometimes the software goes mad - I'm using Linux32 version, on Lubuntu 12.10. Normally, changing the parameters is done by clicking on parameter and "dragging" it up or down. Sometimes, however, dragging the parameter button doesn't change the number, just moves the button away - it jumps back after mouse button release. Loading new image brings it back to normal.
Sorry, but I still haven't found reproducible way of generating this situation.

Well, that's is.
I really appreciate very much the work you put into the project, but the amount of information is slightly over my head 🙂

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Im confused
on: May 12, 2013, 10:41
Quote

Hi Jaromir, yes there's a lot of stuff, and bits of it are only relevant to certain designs, can get confusing!

The polarshield is an add on for an arduino mega. It uses pololu motor drivers, and a screen and sd card.

The adafruit motorshield can be used on an uno or a mega.

The instructable is probably the most "complete" guide, so that is building a machine based on an arduino uno, with an adafruit motorshield. I use beaded cord in my machines because I use a hanging counterweight so that the motors do not take the full weight of the gondola at all times, and that needs the sprockets to have a good "grip" on the cord - because the contact area is small. The same reason that der kritzler (and harvey moon's machine) uses toothed belts.

If you use regular bobbins instead of sprockets on your motor, you can use thin thread and just wind it up onto the bobbin. Pretty much every other hanging-v plotter uses this system. It certainly makes for an easier and cheaper build, because there are no unusual parts. The drawback is you can never turn it off without the gondola coming crashing down, and setup is a bit more awkward - the polargraph software doesn't have a "fast wind in" or jog feature. You could have a look at dan royer (marginallyclever.com)'s system for that - that's the model he uses on his machines.

Servo pen lift is necessary (well, sensible) if you are doing any vector plotting, but the machine will work perfectly fine without it - it just won't lift the pen.

The polargraph controller doesn't need to have anything connected. But once you've loaded your image, you need to use "select area" to choose the area that you want to convert to pixels, that will give you your preview.

Sometimes the software _does_ go mad, yes, I think it's a feature of controlp5 (which is the gui library I'm using) that it allows you to drag and drop the buttons around. It happens to me too. I can usually use the button correctly by holding down ctrl, or shift, or alt while clicking, but it never really gets back to normal. I have never figured out what triggers it.

good luck!
sn

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Im confused
on: May 12, 2013, 13:57
Quote

I just remembered that this step: http://www.instructables.com/id/Polargraph-Drawing-Machine/step21/Work-with-images/ shows the preview, and how to get it!

jaromir
Newbie
Posts: 11
Permalink
Post Re: Im confused
on: May 12, 2013, 19:04
Quote

Oh, great, thank you much for your detailed answer. I'll dive into it once again and come back with questions or results. I have most of the needed parts in my junkbox, so I'm eager to build it 🙂

Thumbs up your support.

jaromir
Newbie
Posts: 11
Permalink
Post Re: Im confused
on: May 14, 2013, 11:13
Quote

Well, here I'm again.

A bit of progresss: I made dedicated controller for polargraph
https://picasaweb.google.com/lh/photo/XkzkltcIAJmLTYVSLG7VCAWTSbRD7k9TLQ_tr14ds68?feat=directlink
and attached motors to it
https://picasaweb.google.com/111890741167251011072/Polargraph1?authkey=Gv1sRgCJSat9XL5IbxTg#5877770084245977714
After a long battling with arduino bootloaders I finally made the thing to load the polargraph code and communicate with controller. As you can see, it is basically arduino and motorshield with L293D on single board, and I use FT232 based USB-serial converter to communicate with PC. I can move motors from the controller by using "move pen to point" functions. So far so good.
Now I'm going to prepare pen holder and drawing board.

Even without pen/board motors should move - that is what I'd like to see for now.
I went through instructables again and understood it up to this point http://www.instructables.com/id/Polargraph-Drawing-Machine/step21/Work-with-images/ so I have preview like this https://picasaweb.google.com/lh/photo/XEydVGx5CAtIOSqq5xn5lQWTSbRD7k9TLQ_tr14ds68?feat=directlink

When I click on next page on instructables, it says about pixel style choosing http://www.instructables.com/id/Polargraph-Drawing-Machine/step22/Choose-a-pixel-style/ but I don't know how to choose pixel type. And then, where is button to actually start drawing?

Once finished, I'm planning to make some write-up about my hardware as well as beginners guide to help somebody starting from zero, as I did.

jaromir
Newbie
Posts: 11
Permalink
Post Re: Im confused
on: May 14, 2013, 11:20
Quote

Oh, how stupid. Nevermind.
I found out how to start rendering two minutes after I submitted the post above 😕

Now the motors are humming, moving as expected, queue is getting shorter and purple dot on image moves through pixels. Fantastic!

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Im confused
on: May 15, 2013, 13:44
Quote

Good news - thanks for persevering with it, would be great to see a better startup guide. Neat board too!

sn

jaromir
Newbie
Posts: 11
Permalink
Post Re: Im confused
on: May 18, 2013, 15:34
Quote

Well, I got further.
I built first iteration of drawing board, mounted motors and gears and after a bit of playing with it, it started to draw pictures!
However, the process freezes very often. I'm running linux32 version. It works and executes commands and then it simply stops, indicating being busy with a command - see attachment. At this point, application is completely unresponsive - I can't click on anything.
When I close and reopen application, I can normally start from zero (with another wasted paper) - but it will freeze sooner or later. In fact, I didn't draw a single complete A4 sheet.

Any ides what's going wrong here?
Image

jaromir
Newbie
Posts: 11
Permalink
Post Re: Im confused
on: May 18, 2013, 17:29
Quote

Oh how much I hate Java 😕
This time controller crashed in different way - see attachment. I tried to get more info from log, but I was not able to copy it.

I noticed controller takes 455MB of RAM and cca 60% of CPU time (my machine is G1610 with 4GB RAM). Is this normal?
Image

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Im confused
on: May 18, 2013, 19:11
Quote

It is pretty inefficient, so I'm not surprised, especially with that fine a grid. Java is a pig, and therefore Processing is too, unfortunately. That said, it isn't written very well either, so I am to blame too.

I haven't ever run it on linux before, so I don't have any experience of any foibles around it. I would suggest moving to the "queue" tab once you're running though, that is the least CPU intensive view, I know it makes everything go a little faster for me in that view. More noticeable now that comms is a bit quicker.

sn

jaromir
Newbie
Posts: 11
Permalink
Post Re: Im confused
on: May 18, 2013, 22:35
Quote

Just to complete things - here is error log from failed controller application
http://pastebin.com/puyxPQ8N
Honestly speaking, I don't understand that thing.

I'll give it another try with queue tab active and I'll also try another machine with Microcsoft Windows, however until now I thought Linuxis more stable on Java things (which I try to avoid as much as possible).

I also thought of writing something like "queue executor". Polarograph application would be used only to generate queue commands into text file - this process is human controlled after all, so I can tolerate crashes (sic!). But then, some simple lightweight (crashless) software would do the long tedious job - send this queue into server through serial line. I feel like bash script or a few lines in C should do the job.
Now I need to look into sources to understand how is the checksum computed.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Im confused
on: May 18, 2013, 23:16
Quote

The closest the dump comes to helping find a cause is mentioning Java2D, which (I understand) pretty much everything else runs under anyway. So it might be that the failure is at a higher level than the polargraph code itself, or it could just be being hidden. I suspect the Processing code for that is a couple of years old, and I get the impression that staying on the cutting edge has never been a priority for the project, so I wouldn't be surprised to find it was not great. And as I say, the polargraph code itself isn't very clever in a few places.

The CRC stuff is from java.util.zip.CRC32;

Checksum crc = new CRC32();
crc.update(lastCommand.getBytes(), 0, lastCommand.length());
lastCommand = lastCommand+":"+crc.getValue();

(in the polargraphcontroller.pde dispatchCommandQueue() method)

I guess you could write something shelly like you suggest, or adapt the export queue routine to append the checksums as part of the export

sn

jaromir
Newbie
Posts: 11
Permalink
Post Re: Im confused
on: May 19, 2013, 13:28
Quote

Well, it seems like running with queue tab active is workaround to the problem, thanks for that.
Now I'm drawing my first sheet, currently it is running about three hours with no problem. Previous attempts failed after 5 to 15 minutes from start.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Im confused
on: May 19, 2013, 13:30
Quote

Good luck!

jaromir
Newbie
Posts: 11
Permalink
Post Re: Im confused
on: May 23, 2013, 10:20
Quote

With queue tab active it looked stable, I made two A4 sheets. However yesterday it failed again... in about 80% of job, after three hours of drawing 🙁
Sandy, I really appreciate your work, but that damned java monster is totally killing it. 500MB of consumed RAM, lot of CPU time wasted, occasional crashes - unfortunately classical today's software.

Now I'm determined to write my own "sender program". I feel like I understood that checksum thing.
Basically I need to send command (one line in long list of commands + checksum) and hardware starts to execute it. How do I know it is safe to send another command, ie. the previous one is done?

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Im confused
on: May 23, 2013, 11:08
Quote

Ha yes no that's reasonable - it's a monolithic thing, and I suspect that the sugar that Processing adds to java does not help at all.

The polargraph machine will return a message READY (for arduino uno) READY_100 for arduino mega with adafruit shield and READY_200 for mega with polarshield, when it is ready to accept the next command.

It will also issue a RESEND message if the checksum fails.

sn

jaromir
Newbie
Posts: 11
Permalink
Post Re: Im confused
on: May 24, 2013, 13:10
Quote

At first I tried to adapt some Java code somebody posted here before, but I got sick of the dependencies of it.
So I wrote simple polargraph queue executor in plain C (some 150 lines of code), compilable by plain gcc. Result is 8kB executable. It seems to work, takes 1% of CPU time and 72kB of memory.

I'll do more testing on it and publish it.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Im confused
on: May 24, 2013, 13:57
Quote

Cool stuff!

jaromir
Newbie
Posts: 11
Permalink
Post Re: Im confused
on: December 10, 2013, 16:32
Quote

Well, here it is - http://jaromir.xf.cz/. It took a bit longer.

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