Can I use ESP32 WROVER-B with CNC shield v3.0?

Hi, I'm new with the NEMA17 type stepper motors, but now I have to control at least 3 of them with one ESP32 and my idea is to do it with a CNC shield v3.0, but as I see this is only for Arduino UNO. But as I seen an answer at "Use cnc shield without grbl - Using Arduino / Project Guidance - Arduino Forum" post's image:

If I connect those pins what should be connected to the Arduino UNO to the ESP32 then I can control all of the motors with just with the AccelStepper library and the pin numbers like in this example: Control Stepper Motor with DRV8825 Driver Module and ESP32 ?

So that we can help you better, I suggest you post a schematic of the
your supposed project.

This way we will better understand how you will make the connections and then we will be able to identify possible problems.

Yes, that should work.

I find that the MobaTools stepper library easier to learn and use.

Be aware that the CNC shield pulls pin 8 (stepper enable) high so the steppers are disabled by default. Either enable the steppers in software (set pin 8 to output and write pin 8 to LOW) or jumper the stepper enable header to ground.

Hi, thank you for your answer, here is a schematic about my idea how to connect the shield with ESP32. Based on what @groundFungus said, I included pin8.

What do you think about this?

You can wire the limit switches to the "Endstops" at the right, they are the same. (X+/X- go to LimitX, ...)

I'd recommend http://wiki.fluidnc.com/ - there's a config file for the CNC shild somewhere on github.

But the motors can be connected like this? I can connect the limit switches directly to the esp32, It's not a problem.

Looks good enough to me. Use NC switches, not NO switches for limits.

hi, how did you connect?

Hi, now my motor hat arrived, and I tried this code, with that schematic that I showed before

const int DIR = 5;
const int STEP = 4;
const int ENABLE_MOTOR = 14;

const int  steps_per_rev = 200;

void setup()
{
  Serial.begin(9600);
  pinMode(STEP, OUTPUT);
  pinMode(DIR, OUTPUT);
  pinMode(ENABLE_MOTOR, OUTPUT);
  digitalWrite(ENABLE_MOTOR, HIGH);
  Serial.println("MOTOR enabled");
}
void loop()
{
  digitalWrite(DIR, HIGH);
  Serial.println("Spinning Clockwise...");
  
  for(int i = 0; i<steps_per_rev; i++)
  {
    digitalWrite(STEP, HIGH);
    delayMicroseconds(2000);
    digitalWrite(STEP, LOW);
    delayMicroseconds(2000);
  }
  delay(1000); 
  
  digitalWrite(DIR, LOW);
  Serial.println("Spinning Anti-Clockwise...");

  for(int i = 0; i<steps_per_rev; i++)
  {
    digitalWrite(STEP, HIGH);
    delayMicroseconds(1000);
    digitalWrite(STEP, LOW);
    delayMicroseconds(1000);
  }
  delay(1000);
}

But the motor is still in the same position, not moving at all, if I remove it from the shield then the driver and the motor work perfectly, so, how can I use it with the shield?

Does it need just a `HIGH˙ sign at the start or I should send it in the loop?

The enable lines on the DRV8825s are active-LOW.

Can you give me a code snippet, how can I use it then?

digitalWrite(THE_ENABLE_LINE,LOW);

Still in the setup not in the loop, right?

Most likely if you only want to enable it once.

I have the same question about how to connect an Esp32 with a CNC shield v3. I want to use them as nema 17 motors.

The picture in post #4 should work.

I am using the dvr8825 driver

Change HIGH to LOW.

As for the limit switches, when implemented they serve to feed back the boundaries of the work area for homing and safety. Sometimes a particular axis won't need to be bounded, like the angle parameter of a polar plotter for example. In that case, just don't implement a switch; ie: put a jumper in place of the NC contacts. It's as simple as that. :grin: