• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Project guidance: Can I use Java to convert real-time sensor & pixel data into gcode?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello, I'm building a solar printer, which is basically a laser cutter that uses a magnifying glass pointed at the sun to burn images into wood. My hardware is essentially a 3d-printer platform with a print-bed that moves in the XY directions (controlled with steppers and GRBL) while the magnifying glass stays in a fixed position (with the help of a solar tracker). My goal is to use data from an image file to generate code that will move & pause the print bed and allow the sun to burn the image into wood.

I know there are lots of resources for converting images to Gcode. But these all assume the image is line-based vector art. But suppose I want to print a bitmap or etch a photograph... how would I go about doing it?

My thought is that I can use Java to open an image file, access the pixel data for a given coordinate, and use that to tell my steppers where to go and how long to rest there until my wood is burned to the proper shade.

It gets a little more complicated though. Typically, a gcode program (which is just a list of X and Y connect-the-dot type coordinates) is loaded into the GRBL controller software on a PC, which feeds coordinate commands over a USB COM port to the stepper motor controller once the previous command has finished executing. Basically, set it and forget it. However, because my power source is irregular (Sun, clouds, atmosphere, etc.), I need to be able to compensate for variable lighting conditions based on real-time sensor input and be able to adjust commands thereafter to ensure a consistent print. So if a cloud passes by, for instance, the computer knows to check for the right about of "burn" in that pixel location before telling the print bed to move to the next coordinate.

I've never programmed in Java before, and this is largely meant to be a learning experience in addition to the project deliverables. Any thoughts or advice would be greatly appreciated! TIA
 
Sheriff
Posts: 6127
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say you haven't programmed in Java, does that mean you've programmed in other languages?  This project isn't for a beginning programmer, I'm afraid.
 
Joshua Ruchty
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:When you say you haven't programmed in Java, does that mean you've programmed in other languages?  This project isn't for a beginning programmer, I'm afraid.



Correct, I have programmed in other languages (mostly Arduino stuff) and I've done some online lessons in have to familiarize myself with it.

I can figure it out. I just need to know that it's doable.
 
Marshal
Posts: 65108
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Until we work out which language you will be using, I shall move you to our General Computing forum. We might move you to another forum later.

I suggest you start by writing out some algorithms that you want to implement. The algorithms should look exactly the same irrespective of implementation language. Do yvau have any instructions for connecting to the hardware interfaces in Java®?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!