CNC and arduino UNO without PC

Hello, this is my first post, I want to make a machine that moves a structure with a single motor. I am using Arduino UNO + Cnc Shield v3. I put two limit switches on it to make the machine stop and install GRBL ver 0.8c as Firmware. My idea is that the machine activates the movement with a push button until the end of the first end of the car and when pressing the same button changes the direction of the motor to the other end of the car, I need help on how to program it since I learned the basics of Arduino and I don't know where can connect the button for program action the motor might give me a hand from I already appreciate it.

PS: my idea that I can control this machine without having a PC connected.

This is the English section of forum.....

thanks clarification

I think moderator will move Your post when he finds it.

What device is going to feed the "G" code statements to GRBL? Are you going to have something other than your PC connected to the GRBL controller? Do you have any "G" code statements that might do what you propose?

1 Like

GRBL is general purpose firmware that expects to get G-code supplied to it from an SD card or a PC. It allows a machine such as a 3D printer to do many different jobs. If your machine is going to do a single specialized task, GRBL is probably overkill, although you could likely hardcode the G-Code to command it in progmem.

For your purposes, you can just command the stepper directly and read the buttons and micro-switches in code much simpler than GRBL.

A while back I helped someone here to program a device doing something similar. You might be able to adapt the code, but even if you don't use it directly, it'll illustrate the concept.

Read about it Here.

Thanks, the truth is that I didn't install GRBL at first but the engine fluids weren't correct, it was shaking a bit and with GRBL it moves fluidly but I have a problem that cnc shield I want to replace one of the pins with a button so that the engine can start after it reaches the end of the race When pressing the same button, return in another direction until the first end of run, the power of the arduino programming I am giving it when it is definitive from the same 12v source, reducing it with a transistor to 9v continuous input so that it does not depend on a PC that feeds from USB.

9 VOLTS is only just enough.
10-24 volts is often more appropriate.
Part of that does of course depend on the stepper motors being used.

GRBL 1.1F is also a better choice as it will allow for a couple of extra commands.
However GRBL takes up almost all the memory available on a board.

As @wildbill states you need to feed the g-code to the board in some fashion.
You can choose from Wi-Fi, bluetooth, serial, etc. but you do need a second device.

Some sender programs also allow for wait states to be invoked so that you can pause at certain point by way of a pseudo macro.

Without knowing exactly what your project is for GRBL may be overkill.
Many other projects use the CNC shield but without GRBL which means that you can have pins spare for such as buttons etc.
Camera sliders are just one such example.
Celestial trackers are another.

If you want more fluid but simple movements then be aware that timing is critical in such operations. use of Delay commands can have effects that cause jitter when improperly used.
Use of Micros and other timers are recommended.

Sample link for NON GRBL approaches
https://www.google.com/search?q=cnc+shield+program+"without+grbl"&rlz=1C1CHBF_enCA923CA923&biw=1069&bih=508&sxsrf=ALiCzsaUbJTDffhWpOHRfGpVAi14k3Z0yQ%3A1653131927954&ei=l8qIYobtOYzjtAbvl5CwCw&ved=0ahUKEwjGlNSqvPD3AhWMMc0KHe8LBLY4ChDh1QMIDg&uact=5&oq=cnc+shield+program+"without+grbl"&gs_lcp=Cgdnd3Mtd2l6EAMyBQghEKABMgUIIRCgAToHCAAQRxCwAzoECCMQJ0oECEEYAEoECEYYAFChCVi1FmChHGgBcAF4AIABrwGIAcMDkgEDMC4zmAEAoAEByAEIwAEB&sclient=gws-wiz

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.