Operation opinion - Involving motor, WiFi, operation procedure

Working on a sort of CNC type of machine that will operate 5 stepper motors, and a few distance sensors (sonic).
The operation will involve Atmega with ESP8266 onboard receiving instructions through WiFi.

The instructions will be in sequence example of motor1 go "x" steps, motor2 go "y" steps... until project is complete. Motor instructions can be as simple as few instructions or it can get complex involving up to 10000 of sequence of motor movements until project is complete.

All instructions will be generated from a separate software and transmitted over WiFi.

Looking for opinions and technical solution.

  1. Should I send a single bulk instructions to the board through WiFi and wait for it to complete the project OR should I send smaller chunk of instruction segments to the board through WiFi having the external software control the project steps until project is complete?

  2. Reliability opinion is there a higher potential that things can go wrong if all instructions will be sent in one bulk rather than smaller chunks?

  3. Since each WiFi call to the board may trigger a new process, how can I instruct the control board to issue a "busy" statement while still in operation and then "available" when project is complete?

Hey Mas, should this be in a different section? Motors, Guidance, Programming? One of the ones closer to the top that are about projects, rather than general Arduino stuff.

Ask a mod to move this to Project Guidance.

mastool:
3. Since each WiFi call to the board may trigger a new process, how can I instruct the control board to issue a "busy" statement while still in operation and then "available" when project is complete?

Why not turn things round and only send a new instruction when requested?

...R

Thread moved as requested.

Good point made by Robin2. Although I was considering data send/request from multiple host/servers which makes things more complicated, it is possible to redirect all traffic into a data flow management script.
Thanks!

mastool:
Although I was considering data send/request from multiple host/servers which makes things more complicated, it is possible to redirect all traffic into a data flow management script.

Based on that very limited description I can't see why it would be more complicated. Servers can generally deal with hundreds of requests.

If you provide an overall description of the project you are trying to create with all of its parts and its proposed working system it will be much easier to give a useful answer. At the moment this is a typical XY problem

...R

[quote author=Coding Badly link=msg=4146145 date=1555919415]
Thread moved as requested.

[/quote]ty

I would send the instructions in phases, so it's do the deed, eyeball and evaluate, until I knew every single step worked right one at a time, then in order.

a step through mode for the first use, then a production mode when you know you have it nailed

if you don't step through the process, how will you know where you went wrong?

youtube search term cnc fail, cnc crash, for what happens when you don't

Going back to this thread. And after testing a few ideas and retesting some procedures. This is what I found.

// This is a readout loop from an output of a file online (WiFi connectivity)
//eot = special character signifying the end of a stack readout (end of project)
while ((client.connected()) && (client.available() > 0) && (c != eot)) {
c = client.read();
content += c;
//delay of 50 seems to be ideal in my testing, however it may not suit other projects
delay(50);
}

I have discovered that reading C only return segments at a time until loop is terminated. However, content (AS STRING) is also limited in its data capacity and only allow about 1000 characters and anything more then that fails. I did not accurately count the max number of characters but it sure did not take in all the information I sent to it.

As a result I have concluded that the best approach is:

  1. Initiate a readout loop of smaller segments at a time.

  2. Letting a web page based (+database if needed) control both a work order number with segment index so it can track the progress of the readout in smaller stacks.

  3. Once the "job" is complete issue an end notification so both the web based page process initiates the next project and the control board awaits its next set of instructions starting a new project as well.

I wished there was an easier way but it seems to be the only solution.

Most Arduinos don't have much RAM, so the idea of loading 10,000 commands into memory is questionable. You've made it worse by using a String object to collect the characters.

A more conventional approach is to have the Arduino simply run the motors and other hardware and read the commands one at a time. GRBL is often used in this way. You may want to ask for the next command while you're executing the current one or perhaps buffer several.

If you need to manage multiple job requests, I'd suggest that you submit them to another device to handle the queuing. A Pi would do and it then issues commands to the Arduino as it indicates that it needs them.