ESP32 Ground Control and Firmware in One

That might be a worthwhile effort…
make one of these:
image
into something like this:

The problem is we need one with continuous current above 1.5A and we aren’t going to pay $18 each for 3 on a system AND we need encoder feedback as well on that little board, so it would need to have its own micro also to generate a pwm or spi to drive the movement. It would need to accept direction and step movement and provide feedback that it had received and executed the movement. It would need to be synchronous. What would that mean for the firmware?

I think it would make a great design project for someone in engineering school. If I were to do one, I would probably mount the microcontroller portion on the underbelly of the board and put the motor controller on the top side. Add two small jst connectors on the top, one for programming the microcontroller and tuning the PID parameters, and another for connecting to the encoder. Then maybe a screw terminal for connection to an external power supply if the one feeding the main board isn’t sufficient.

If this can be accomplished, then only mods to grbl (or marlin or anything else) is the addition of kinematics. The upside is a bunch of people might buy the module for non-Maslow machines…

If it doesn’t fit, you can always just make it external and use a cheap ($2-$4) null board to connect to it… like one would do if you were to use external stepper motor drivers. Those do exist, at about $30-$50 a motor though… which is a bit expensive imo.

What would that mean for the firmware?

It wouldn’t need any ‘maslow-specific’ firmware, just a firmware that converts steps to PWM… so it’s more universal in that sense.

2 Likes

Isn’t that this:

?

There are a number of people that have done implementations. Does he have hardware available?

I’m thinking more of a super small form-factor that fits in the typical stepper driver spot.

No hardware. You build it and tune it yourself. It’s an Arduino connected to an H-bridge. I have built two for my desktop CNC and it works quite well. I disagree that it would be great to design an integrated module- if it was a good idea it would be done by now. I think it’s better to be modular (in this case).

I’m not sure with what you disagree with. Are you saying you disagree with the idea of a stepper driver sized module? Or something else?

Yes, I disagree that a stepper-sized module would be a Good Idea. However, I could be wrong:

Isn’t that exactly that?

Alright, I have the schematic for the board done. There are still a few items left before BOM is done, but nothing major.

You can check it out on my github repo here.
Sheets 2+ are repeats. They are the same file on-disk so I can change all at the same time.

Feedback is appreciated.

1 Like

No, that’s a controller bolted to a motor. I was talking about a module that plugs into a typical cnc control board. But we’ve digressed too far off @InvncibiltyCloak’s topic. Sorry.

I’ve uploaded gcode to the onboard sd card via WiFi and the web interface and run it on my grbl_esp32 board.

There’s no visualizer onboard, so I normally use a gcode sender, but you can do it

1 Like

Can the esp32 handle the 5v encoder inputs directly or does it need to be level shifted?

Good question.

I disassembled my motor, found the P/N of hall switch used in the encoder, then dug around the internet till I found the datasheet. The hall sensors themselves are okay with 3.3V. Their outputs are open-drain with a pull-up resistor to the supply rail which is now 3.3V. So no level shifting is required.

With the lower voltage there is a little more potential for noise. If that turns out to be a problem, it could be fixed by putting another pull up resistor.

1 Like

But there is one in the GRBL ESP32 roadmap so hopefully we will have one at some point.

1 Like

So the board layout is complete and I have ordered some boards.
I opted to get 2 half-assembled (all the basic parts + the IFX9201) and the remaining 3 unpopulated.

Should be arriving around the 20th. After I test it out a bit, I will offer assembled boards if anyone is interested. :dollar:

Otherwise you can go build your own. Shouldnt be too difficult to hand solder everything for the adventurous :wink: . The smallest components are only 0805s because I was originally planning to fully assemble it myself, but JLCPCB assembly is sooo cheap I decided it was worth it to get the more difficult items assembled.

Obviously I dont expect many people to be interested considering there is no software to run on this monstrosity. Hopefully I can fix that…

4 Likes

So I’ve started looking into the GRBL_ESP32 source code.

I didnt realize that they already have a web-based UI. Its missing the cut-path preview that WebControl has and it of course doesn’t have the Maslow-specific commands. But it seems to be a solid start. The creator is just starting on v3.0 of the WebUI in this github project if anyone wants to help him out and add in the cut-path preview stuff. The major constraint is the tiny amount of storage you have to work with. The whole thing needs to fit in 192 kiB of space.

I see 3 major things that need to get implemented on the GRBL side:

  1. Maslow kinematics, which will be quite easy. I will probably be able to copy most of the kinematics code from the current firmware and paste it into GRBL’s kinematics. The only thing left will be storing the chain lengths to flash.
  2. Adding support for DC motors, which will be difficult. The whole project is designed around step/direction motors, so this could get tricky.
  3. Adding support for motor control via SPI, because we are using the PWM driver to control the motors. Shouldn’t be too bad once DC motors have been implemented.

Last I will need to create the firmware for our ATmega328 PWM driver for the DC motors. This shouldnt be very difficult but might take a while to get everything implemented.

If anyone is wondering where they could contribute to this effort, I would recommend developing the WebUI.

1 Like

there are companies that sell stepper motors with worm gear boxes. I can get you some samples if that would make it easier. But then of course it would not be backwards compatable with exsisting kits.

steppers with worm gears also tend to be rather expensive.

David Lang

nothing in the maslow kit is really expensive, especially when ordered in bulk. I think the most expensive thing in our kits is the router and that is $55 wholesale. Above worm gear motors would add $20 to a kit price.

I actually found this to be pretty straight forwards when I explored it. Check out this github issue and associated conversation for discussion on how to do it:

1 Like

So the boards arrived today and I assembled them right away. The big Maslow logo makes them look pretty snazzy. I hooked it up to my bench supply so I could limit the current and prevent from smoking it on the first run. Fortunately, the board didn’t try to let out any smoke.

Unfortunately there are some problems.

  1. The motor connectors are not the right size. I put JST PH series (2.00 mm pitch) instead of JST XH (2.50 mm pitch). Not sure how I got them mixed up
  2. The 5V supply doesnt come on. I will need to debug this. If I cant fix it with some mod wires, I can bypass it for this initial board.
  3. The green LED is too bright - I put as much black sharpie on it as I could :sunglasses:, and now it is about the right brightness. The photo is with sharpie on the LED.
3 Likes