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

Needs a button toggle to suppress the image while drawing. #14

Open
Shornone opened this issue Feb 12, 2018 · 15 comments
Open

Needs a button toggle to suppress the image while drawing. #14

Shornone opened this issue Feb 12, 2018 · 15 comments

Comments

@Shornone
Copy link

Shornone commented Feb 12, 2018

I think it is just a resource thing having to render the image and draw the command trace while plotting. The pen plotter controller bogs down with complex files or larger files. Frame rates can get down to 1-3 fps which is just too slow for smooth drawing as it waits to update the command queue until after the rendering update is complete.

A toggle button, like the pen up/down feature, that suppresses the image and leaves the command queue would free up the processor.

@Shornone
Copy link
Author

Just a follow-up. I have been running this on a Raspberry Pi 3 B and the constant screen updates for larger vector files just eats up the processor and eventually everything grinds to a halt. When I resize the PenPlotter controller so that the image is not visible I get at least a 2x increase in drawing speed, but it doesn't hold true from start to finish. Based on this experiment I believe being able to suppress the loaded vector image and only displaying the drawing progress would help immensely.

I have been able to add the button, but not being very good with the software I can't quite seem to get the function correct to hide the original image and only show the plotting updates.

image

https://twitter.com/ShornOne/status/975131151563018240
https://twitter.com/ShornOne/status/975130168103641089

@Shornone
Copy link
Author

Perhaps a standalone command queue sender running in Python is the ticket. It really is a great controller having done about 20 drawings, if I can get the resource need down for the raspberry pi it will be golden. Limited to simple line drawings for the time being.

Thanks

-Shorn

@RickMcConney
Copy link
Owner

Unfortunately the processing programming environment is designed to update the screen in a continuous loop. Now it may still be possible to optimize the code or skip some drawing I am not sure this effort would be worth while on a Pi. You may instead be able to run the program on a laptop and export the gcode then use something like octopi on the pi to send the gcode to the plotter. Your plots look great.

@Shornone
Copy link
Author

Thanks for the feedback. Sandy Noble's Polargraph controller has a toggle for suppressing the original vector which is what I was inquiring about to replicate in your controller. Not the generated plotting code overlay or actual drawing in progress feedback.

Also, I was able to modify Sandy's standalone command line sender to talk to the Arduino and send commands but something is still amiss.

The Pi is desirable because I set up the machine in art galleries and leaving a laptop tethered is risky.

Thanks again for responding. I will check out octopi. I think getting a command line sender is probably the best for the Pi. If I make any progress I will share back as a courtesy.

Thanks again for taking the time! - Shorn

Another example of the more artistic drawings I do with the machines - 1933 Plymouth Racer

dy-tg9vvaaayblz

@RickMcConney
Copy link
Owner

RickMcConney commented Mar 23, 2018

I added a feature that you can try to see if it solves your speed issue. If you hit the 'n' key it will go into a nodraw mode hit the 'd' key to resume drawing. All the changes are in the main PenPlotter.pde file. The routine to look at is called draw I have added a boolean called draw that if false will skip the drawing calls. At the moment all drawing is skipped. Let me know if this helps. You can adjust what parts of the drawing are skipped by including or excluding those parts with the draw boolean. If you get it adjusted to the way you like it I can add a button to set the boolean.

@Shornone
Copy link
Author

Sweet! When I get home (... I...should... be working right now...) I will definitely give it a try first thing. Thanks!

@RickMcConney
Copy link
Owner

I have added the draw no draw button. The changes are in PenPlotter.pde, cp5Gui.pde and two new icons in data/icons (draw.png and nodraw.png).

@Shornone
Copy link
Author

Shornone commented Mar 23, 2018

Works Great!

~21 fps with no file loaded
~4 fps with file loaded
And a solid 30 fps with draw suppressed.

Drawings are much faster and smooth.

Much much thanks!

I offered on Twitter a CanaKit Raspberry Pi 3 B+ to anyone who could make the changes.

https://twitter.com/ShornOne/status/976981890891526144?s=19

It is yours if you want it or I can donate to the local high school.



Thanks you again and let me know about the CanaKit.

-Shorn

@Shornone
Copy link
Author

Ran the stress test and it worked like a dream. Held 30+ fps for the entire drawing. Draw time under 2hrs. Couldn't even finish the drawing before.

Thanks again!

@RickMcConney
Copy link
Owner

Glad it worked for you sorry I did not notice your post sooner. Thanks for the offer of the Pi but I do not need one I am swimming in them here at work.

@jsecondo
Copy link

Wow. That stress image is amazing. Can you share it! Thanks

@Shornone
Copy link
Author

The SVG file I used came straight from Wikipedia. Smith Chart SVG. I just downloaded it, scaled it and then printed it.

https://commons.m.wikimedia.org/wiki/File:Smith_chart_gen.svg

@jsecondo
Copy link

jsecondo commented Apr 17, 2018 via email

@mshaub
Copy link

mshaub commented Apr 18, 2018

Yes, thanks for the link!
I just ran the same Smith Chart file (without pen up/down working) and didn't have quite as beautiful results. It looks a little like when I try to write with my left hand ;) but certainly better than that. Any guesses about what settings need to be tweaked to smooth this out? The drawing is about 16" in diameter.
https://www.dropbox.com/s/3fmfm4ndcucpul7/Photo%20Apr%2018%2C%208%2005%2030%20AM.jpg?dl=0
photo apr 18 8 05 30 am

@Shornone
Copy link
Author

Without more information about your setup, it is hard to diagnose. From my experience, most issues like yours are related to the gondola/pen holder but I just can't say for sure without more details of your system.

On my twitter account, you can see my setup in operation. I have videos and images that you can reference.

https://twitter.com/ShornOne

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants