0
\$\begingroup\$

This is my very first big project. I have to build a laser engraving machine for date stamping. I'm using Arduino Uno microcontroller and a CNC shield with GRBL control.

Being fairly new to G-code, I looked up articles about writing one for daily date change. I found http://www.microtechstelladata.com/TextToNCcode.aspx where they convert date to G-code directly.

My concern is, how do I generate G-codes daily in an autonomous way? I am going to use another Arduino Mega for programming a keypad and an LCD screen and use it for controlling an RTC module for daily date update. Can I use the output of the RTC module somehow and feed it to the G-code generator in Arduino mega which will generate a G-code daily and provide it further to the other Arduino Uno board with the CNC shield.

RTC module (daily date update) --> Arduino Mega (generation of g-code for date provided by RTC module) --> Arduino UNO equipped with CNC shield and GRBL control --> stepper motors and laser diode driver --> laser engraving

Am I going in the right direction here? Any help will be appreciated.

Cheers!

\$\endgroup\$

closed as too broad by brhans, Finbarr, laptop2d, Bimpelrekkie, PeterJ Apr 5 at 11:40

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ Have you looked at the control algorithms used for 3d printers? \$\endgroup\$ – Solar Mike Apr 1 at 5:50
  • \$\begingroup\$ Yes, I have. Did not find relevant information though. \$\endgroup\$ – CyborgPanda Apr 1 at 11:12
  • \$\begingroup\$ Well, I am sure it’s out there - there were open-licence build your own plans with downloadable software... \$\endgroup\$ – Solar Mike Apr 1 at 11:18
  • \$\begingroup\$ I'll look it up some more. Thank you. \$\endgroup\$ – CyborgPanda Apr 2 at 7:36
1
\$\begingroup\$

G-code is vector based positioning. You can work in relative or absolute moves (I suggest the latter).

If you want to generate characters you'll need to find a vector (stroke) font you like and convert date text (from somewhere, the Arduino has no real-time clock) to G-code and then run a G-code interpreter to control the steppers and laser module.

Date information-> Date text -> Character movements for entire text-> G-code -> G-code interpreter-> Hardware

\$\endgroup\$
  • \$\begingroup\$ Thank you for the clarification. I will have to look it up, but now I know how to proceed. :) \$\endgroup\$ – CyborgPanda Apr 1 at 6:16
  • \$\begingroup\$ You could try to control the steppers directly, but the G-code interpreter will provide scaling, linear and circular interpolation etc. \$\endgroup\$ – Spehro Pefhany Apr 1 at 6:20
  • \$\begingroup\$ As for fonts, look up Hershey fonts; they are now publicly available, very pretty-looking vector fonts. \$\endgroup\$ – Richard the Spacecat Apr 8 at 15:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.