ESP8266NodeMCU To Arduino : Grbl doing random movements

I am working on making my sand Art design wifi enabled with ESP8266MCU board

The ESP is connected to the SD card which has the GCode stored, it reads from the SD Card and transmits serially (using SoftwareSerial) to the ATMEGA328 which has the GRBL code execution.

the speed of Serial is 115200 and the ESP is connected to the webserver which does nothing but turn on and off the system.

The code is being read by ESP from SD, transmitting to the ATMEGA and the device is working properly upto a random point (The homing works perfectly).

The design is being drawn properly upto a particular point and suddenly the head move horizontally or vertically (Again random) to a certain distance (again random) and comes back to the same position and starts the design fro the same position and continues....

and again at a different point it does the same thing.

I have tried reducing speed of data F is 2500 (tried 1000,1500,2000...) all same.

tried reducing serial speed to 57600, still same problem

unable to determine what the problem is .

When I replace the ESP with another ATmega328 as the master to read SD card data and send to Atmega-grbl the system works perfectly.

So it appears that the communication between ESP and ATMEGA is where the problem is.

Serial communication is done like this:
ESP reads a single line from SD card, sends to GRBL and on OK from GRBL the ESP sends the next line. So no issue regarding Buffer overload

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