Hello all, I want to do a CNC plotter to type what a person says, using GRBL and g-code, I have a voice recognition module connected to one Arduino, and another Arduino connected to CNC shield connected to CNC machine, I downloaded GRBL code on the Arduino connected to the shield, and the other has the voice recognition code, so my idea was to specify the commands which are taken from the voice recognition (since they are not a lot) and translate them to g-code manually and make a database for them, then send that g-code to the plotter to pint it automatically from the database I created, but I have two problems the first one is how to communicate between the two Arduinos since that the plotter Arduino have a non modifiable code, and the second one is how to send the g codes to the main GRBL library code since I don't know another way than using softwares like universal g-code sender
Are You trying to make gramophone records in a new way?
How much have You done by now?
The hardware controlling Arduino works from the receives Grbl.
Draw a block diagram showing the intended configuration. Your post makes no sense. It looks overcomplicated.
That would be a challenging stand-alone project and a great learning experience, so get that working first. How will you handle errors, for example when the words are misinterpreted and the wrong G-code is produced?
The plotter part is easy in comparison. Be sure to post your progress!
do you have any way to make it more simple ?
I guess I didn't explain it well, the voice recognition module can only recognize 80 pre-heard commands, for example I say Hello and record it in place 0 in the module memory, when I say Hello another time he recognizes it and outputs to me in what record the word hello is, in this case in record 0. So I will have generated g-code for the word hello stored in some place, then when hello is heard the project will take the g-code specified for it and send it to the machine to plot it.
so my problem is not in the words I guess.
Make a block drawing showing the logical and physical blocks/parts.
Good to know that the voice recognition problem is solved.
Next step: read the Serial Communications Basics tutorial on the forum, to learn how to send serial data between two Arduinos.
A more proper explanation is that "generated g-code" should be replaced with "stored g-code" as no generation is being done... you are simply doing a one-for-one output.
So, IF you speak "A" the return match may be pointer "0" and "B" may return pointer "1" ...
Essentially this is nothing more than a switch-case control:
switch...case - Arduino Reference
Just be certain to store your serial.Print g-code stream using the "F-macro" .
Serial.print(F(“Hello World”)); - Using Arduino / Programming Questions - Arduino Forum
The obvious ramifications to the above are 1) you are going to use serial to connect to the second Arduino, 2) the BAUD and other serial parameters much match what the second Arduino expects, and 3) you must manage all preambles and closing control statements in your g-stream program.
Yes, my bad.
And yes its only a switch, why to use "F-macro" ?
can you please explain more about the third point
I will explain the "F" macro but I should not have to do this as the link fully explains; because you want the regurgitated g-code to be in flash memory and not SRAM.
Any common opening and closing g-code that is common to more than one sequence can be efficiently managed by only storing that string once rather than including it multiple times. Depending on what you intend to do, this may not apply to you.
this is helpful no doubt, now the other problem is just how to send g-code to the Arduino what should I do or what code should I write if you know what I mean.
I "know" that you should be able to figure this out without assistance; that is you are,
- going to use a serial channel, RxTx
- You must set-up serial UART
void setup() {
Serial.begin(9600);
- You are going to have switch...case and within each case, some G-code (example only)
Serial.print(F("G01 X247.951560 Y11.817060 Z-1.000000 F400.000000"));
See post #7.

