A new open-source motion controller based on ESP32

Skip to first unread message

Willian M.

May 19, 2023, 2:36:04 PMMay 19
to OpenPnP
Hi to everyone! 
I am building an open source all in one machine that does it all (5 axis cnc, pcb factory, pick and place, 3d printer, laser cutter and knife cutting) and I am thinking on using OpenPNP to be in charge of the pick and place part of the process. My goal is to develop a solution that is deeply documented so that everyone can easily adapt to match their own requirements, such as low cost or form factor. 

For that reason, I decided to design my own motion controller for the pick and place and interface it with OpenPNP. But I am really new to OpenPNP. I have had some struggles to find the right directions that I should follow to develop it. 

Could someone try to explain me or point me some basic steps towards interfacing my own embedded software with OpenPNP?
I've seem most of them use g-code. I am really lost. From what I could understand, the interface is made through the UART. But how would be the first steps? to make a driver to receive the commands from OpenPNP? 
does anybody have a list or can point out the commands that I am going to need to handle to interface with my side of the firmware?

I imagine that they wouldn't be so many. I guess those commands are arrow up, down, left, right, speed and also the pick and place head movements such as moving up and down, pump, rotating the head, etc. Am I right?

Also about the process. Do I have a diagram flow to understand the requirements to fully support OpenPNP on my motion board?
I'll take a look at some motion controllers source code to better understand, just wondering if anybody would maybe be familiar with this process so I could have a better start..

thanks to all in advance for the help
Willian .M

bert shivaan

May 19, 2023, 7:42:21 PMMay 19
to ope...@googlegroups.com
William, maybe you will be better to try and understand what gcode is and how it is used. When you get that, then you will understand what the controller needs to do. Honestly, I personally LOVE to code and play with PIC32MZ uC. But the reality is there is no benefit to making my own outside of the satisfaction I get from doing it. We can get off the shelf controllers right now that can control any number of axis using CAN buses, 8 axis built right into the board. All completely capable of driving a machine

SO, first questions for you are what makes your use case unique that you want to build a special controller?
next - assuming you do, what part of machine control do you already know? - if none then this might not be the area you want to start with.

Having said all that, if you still want to (which I wouldn't blame you if you do) there is no diagram/guidelines for the firmware from openPNP. openPNP at its core is developed to work with almost any controller out there.
You simply need to assign a code (usually some non normal M code) to do things on your machine. Then interpret G-codes to tell your controller how far to move what axis and at what speed. Your firmware needs to then move the machine based on that.

You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/961c01cf-7e1d-4088-987a-ceb0c588013dn%40googlegroups.com.

Roland Exler

May 20, 2023, 6:02:57 AMMay 20
to ope...@googlegroups.com
What I'm wondering about: a CNC mill will have to be much more accurate than a pick and place, but at the cost of speed. If you end up with let's say 10 to 20 mm/s which might be typical for a spindle drive it does not make much sense to use that for a pick and place machine.


Jarosław Karwik

May 21, 2023, 4:56:07 AMMay 21
to OpenPnP
You may have a look at this:

This is my implementation of full featured OpenPnp controller - both software and hardware. It uses ethernet as its main port.

I have so many distractions that it is not fully tested - but it performs basic interactions for my CHMT36VA machine.

Harjit Singh

May 21, 2023, 7:09:35 PMMay 21
to ope...@googlegroups.com
Is really like to see the schematics. Any chance you can put schematic in PDF format? Thanks.

Jarosław Karwik

May 22, 2023, 2:39:17 AMMay 22
to OpenPnP

This is my hardware - dedicated one. But the software can be run on any STM32H7 Discovery boards (easy adaptatation, e.g. STM32CubeIDE creates symbloic links for GPIO ) , with small work also on STM32F boiards and a bit bigger for  NXP eval boards ( supported by MCUExpresso)

Willian M.

May 22, 2023, 3:26:13 AMMay 22
to OpenPnP
well, I agree on this part, but imagine a full solution that manufactures the entire PCB by milling, drilling, removing solder mask from pads to expose them, printing labels, applies solder paste, pick and place components, reflow and gets the finished PCB out of the way to a pile of already assembled, then it gets another raw PCB material and starts all again. For let's say, small batches of 100 parts, this would be ideal. And the speed will be a bit faster than normal CNC routers because the motors will be dimensioned for that. 

Willian M.

May 22, 2023, 4:05:37 AMMay 22
to OpenPnP

Thank you so much! that's going to be very useful to better understand how it communicates with OpenPnp. By the way, how long did you take to develop it? was it easy or complex? I was looking into the code, seems like quite a lot. 

mark maker

May 22, 2023, 4:55:43 AMMay 22
to ope...@googlegroups.com

When I started my interest for PnP I first toyed with the idea of "dual-using" a mill/router, because I thought I wanted both, initially. Having only very limited space in my workshop was also a factor.

What really threw me off, was not so much the slow speed, but the sheer dust and dirt involved in milling, especially if you add lubrication and/or cooling into the picture. Once I really starting reading up about this, I knew it was impractical. It might be less dramatic if you strictly just mill PCBs (and not wood and aluminium, as I wanted to), but I still guess it would be hard to keep everything clean and free of tiny copper shavings and dust, that might otherwise lodge under small pitch SMT parts and short them out. In any case you'd probably need a strong and effective dust collection system. And that, together with USB lines for cameras, vacuum lines for the nozzles, filament pipes for 3D printing, heavily shielded power and signal electronics, etc., makes the supply conduits to the head complex and bulky.

I guess a single "universal tool head" is almost impossible to make. Think about a spindle, a 250°C hot-end, two nozzle motors, vacuum valves, a power laser, knife holder, all crammed together. It would be gigantic in size and weight, extremely complex, very hard to make mechanically stiff, and a major pain to service.

So I assume you think of an "interchangeable tool head". But then all the various connectors would be very difficult to make.

Once you have a design in mind, try to imagine (realistically, honestly) how long it will take to exchange a tool head, and clean everything for the subsequent task. How reliable will the connectors be, if they are frequently disconnected and connected again? How likely will you not break anything doing so? How can you uphold precision and repeatability without having to re-calibrate the whole machine after each exchange?

The heated bed would be in the way of sunken PnP camera and feeders.

Also I'm not sure if you realize that a PnP machine must be quite large because feeders take up a lot of space, at least for anything more complex than a "blinky". That kind of size makes it harder to get the precision for the mill side of things, assuming you want to engrave PCBs for quite small component and lead dimensions.

I honestly doubt, that given the required kind of engineering, you would save any money in comparison to buying/making all separate machines. I guess you could quite easily combine a laser and drag knife with the mill, but otherwise I would reconsider.

Note, you're also not the first dreaming of this.




Granted, this project also failed due to it being a Delta robot and not achieving required precision.



May 22, 2023, 6:41:37 AMMay 22
to OpenPnP
I think that the P&P is very special case as you don't have to activate force while working. So if you design the inertial profile carefully, you will not "lose steps" while working and can work with weak steppers and in openloop mode. Miling/routing is another story.
for a good performance I would have use BLDC motors with good optical position feedback device...


Jarosław Karwik

May 22, 2023, 7:15:49 AMMay 22
to OpenPnP
Well, P&P is even more relaxed - my controller supports connection to encoders/linear scales and it is trivial to implement as you are interested in 99.9% case of final path destination only.
So my software synchronises encoder feedback only at the end of motion ( this is still under implementation)

So you can reasonably priced magnetic scales, glue the tapes and enjoy their resolution with whatever kineamtic system you choose.

Zdendis J

Jun 8, 2023, 12:38:40 PMJun 8
to OpenPnP

Dne pondělí 22. května 2023 v 14:15:49 UTC+3 uživatel jarosla...@gmail.com napsal:
Reply all
Reply to author
0 new messages