PNP – Building an OpenPNP machine – Part 1 – Getting started

I recently started to look into OpenPNP and decided to build my own Pick & Place machine! I will base the machine on LumenPNP (or IndexPNP as it also is called), but I have already started making changes of my own based on what I see done by others. The first job is to understand how a PNP works so i know what I am doing – that is actually an easy job these days due to all the folks posting hours by hours of youtube movies building one. So, here I am having ordered components for a pick and place machine that will cost me less than 1000.- USD.

My primary objective is a machine that can achieve 0603 components and build my prototypes in a hours rather than me sitting here days soldering prototypes manually. My secondary objective is to achieve 0201 components and a small prototype-production line.

First things thirst – before you start a project like this you need to be prepared for a few days of watching youtube and learning from others. Watch, learn and make up your own mind. You can’t just build and hope for the best, you need to understand the impact of the decitions you make – and the key question is – why is it hard to achieve 0201 components? If you understand why you also know the solution! Below is a picture of LumenPNP borrowed from their website found here LumenPnP (v3) – Opulo

This is a classic OpenPNP machine with many custom changes/improvements and you can buy this as a kit for ca 1800.- USD. I have no opinion if this machine is better/worse than other OpenPNP machines, but it was key to get me started. The entire project is on github and they use FreeCAD for 3D, so it is good as start as any other machine I guess. But, what is wrong with it? Why can’t it handle more than 0603/0402 components ? Bare in mind a majority of older machines or commercial machines also struggle with 0201, so what do we need to do different?

My first choise was to use NOKI Noozzle rather than Samsung CP40 – the main reason is because NOKI actually provide a nozzle capable of handling 0201 components + it was decent cost and seems to be far more used by makers. But, having a nozzle that can handle 0201 is only the first step. A far more important decition is the robustness and accuracy of the CNC machinery – which in case of LumenPNP have made a few decitions I do not like – that said I ordered parts before I realized so I will build this as is to get started.

Examing the pictures from this and some pictures of other machines you will instantly notice the lack of steel, weight and robustness – don’t get me wrong – it looks very robust, but to achieve 0201 you will depend on a machine that do not move at all. This machine will need some weight added. I might also considering adding a more robust frame or even weld a custom frame, but that is for later – my first point is the work-plate – I want this different to cover the entire 600x600mm frame. As pointed out in some videoes the frame also move a little, so I will add a 15mm tree plate supported by blocks of tree under to prevent any movement and add a thin work-plate of aluminium (or something) on top of that. This will add weight and give me a much larger plate. Obviously I also need a plate at the very bottom that can host a possible cabinet (above and under) – I can easily build a glassed cabinet later to prevent the machine from dust.

A more important decition is about accuracy of X,Y and Z axis. The current design uses belts, while it would be very easy to replace those with long metal threads and steppers that drive the threads. The advantage is that the thread act as a worm-gear giving a more accurate, robust and steady movement – I think this is one of the key changes needed to achieve 0201. But I also want to look at camera quality and designs.

Lets see what we can achieve – A PNP is at the end only a CNC machine and the accuracy and robustness of it’s movement is doomed to decide the accuracy of the entire machine IMO. I also believe that having a clear opinion about how to achieve 0201 is half job done – that said, I have never build one of these before!

As for now I have to wait 4-6 weeks on parts – I had some from before, bought parts for 350.- USD and probably need to spend another 300.- USD. So the total price will be closer to 1000.- USD for a machine with a single head and no feeders. As a hobbyist I am not so conserned about feeders because I have very few rolls of components – a strip holder will do fine. A single head means a slower machine with nozzle changes, but again – that’s fine for an entry level machine.

 

 

BSA – 4 Module Motherboard

The 4 Module Motherboard grew to 51 x 100mm as I decided to add the power connectors (seen on right above) outside the module area. You can also see two 5V regulators on the motherboard. Each SPX3819 deliver 500mA and I can feed of 6-8V or 12V with jumpers, but I could also add a small watchdog with 4 x SPX3819 and capability to switch power on/off on each module. Regardless this motherboard is a proto, we can modify it later.

I might create a new version later with a watchdog and power on/off relays on the side – space under will be to tight, but I can switch on/off 5V using 4 x SPX3819 regulators. For 8V, 12V and 24V I need proper relays and drivers for these. Power lanes on the board is a bit tricky as well. I benefit from using 4 layers here, but I am not sure about high speed RS485 and CAN-FD from board to board. We will find out. CAN-FD and RS485 connectors can be added to the other end for 1 module or 2 module motherboards. I need to make the 1-module motherboard to support stand-alone modules as a minimum. Not sure about 2-module yet, but I do want larger motherboards.

PLC – Chosing a cheap, small MCU

My first choise for a MCU for the I2C/SPI Adapter card was STM32F042F6 since I have 4 of these in my stock, but buying these now is a nightmare. Looking at MCU’s I really would like to use STM32G0B1KE, but price difference between ST and Digikey is a 3 x. so what I decided to fall back on is a prototype made with STM32F105Rx MCU’s. I purchased a lot of these some years ago and I need to use them for something. These MCU’s was purchased from Aliexpress, so I might be wasting my time – but, this is for a prototype I can optimize later. Using a LQFP64 rather than a TSSOP20 is a big difference in size, but it will do as a prototype.

The only know issue I have with these MCU’s is that I have not been able to get USB working and while ST say these are 64K I believe mine is of the older 32K batch – but, who cares. They have CAN, I2C, SPI and UART and plenty of juice for this job + I get rid of my stock of 50 or so STM32F105Rx MCU’s – which are too expensive these days!

I can get hold of STM32G0B1KE MCU’s that are 7mm LQFP32 size, but for a price closer to 8.- USD while ST give budgetary price of 1/3 of that. Digikey gone greedy. I bought STM32G491Rx earlier this year for ca 8.- USD, while they now cost 12.- USD on Digikey. Digikey is quick and reliable, but their pricing are extreme these days. I do hope the current semiconductor shortage will come to an end.

One of the drawbacks with these older MCU’s is that you need external crystal. I attempted a USB/CAN converter with this MCU some time back and never got USB working. Firstly I did the istake of not having a crystal, secondly it just never worked – that said I never tried to much either so I don’t know if this was bad batch or design error or something else. I would primarly like to use CAN on this adapter, so I think it is wise to dig up some old cards and see if I can get CAN working first.

The MCU’s I got is mostly RB which is 128Kb Flash, but I also have some 107Rx and 105RC that are compatible. Adding a LQFP64 I probably have space for both CAN and RS485 – it will be nice to use up this stock anyway.

PLC – I2C/SPI Sensor Adapter

My next module is a TOF sensor that detect distance to objects, but those modules are based on I2C and I might need some distance between detector and PLC, so I have 2 options.

  1. I can move a PLC module close to the I2C device
  2. or I can use a separate RS485/CAN Interface.

It sound a bit overkill to create a module that basically convert RS485/CAN to RS485/CAN, but the RS485/CAN on all modules are IPC designed for high speed, short range that don’t need isolation. If I want to communicate with adapters 2-5 meters away I need some isolation, power and slower speeds + I would like to connect to multiple devices. I use RS485 in this example because that allows me to use cheaper MCU’s on the Adapter. CAN is more ideal, but harder to align and require MCU’s with CAN Interface. That said I will create both because I like CAN.

I2C or SPI on the other hand is TTL logic and will not survice mutch cable dispance.b Below is a typical Laser/TOF sensor with I2C.

PLC – PowerServo Isolation

I want to add TVS or Photo couplers to the PowerServoe and looking at the PCB lanes above you can see it is only five lanes crossing from left to right and I have plenty of space. All the caps are leftovers from PWM3 and can be partly removed if needed. This one is easy to make fully isolated. The only problem is that the opto couplers require some space and these boards are small… lets see what we can do.

PLC – Power Key

I decided to go with a Power Key, meaning the motherboard will provide 24V, 12V and 6-8V on 3 separate pins. The module then decide what power it need by pin usage as illustrated below. The top image is my Power Servo Controller, while the lower one is PWM3. If a module need to select between 12 and 24V it can provide it’s own jumpers. The objective here is plug & play with minimal options to making errors.

 

PLC – PowerServo

This is a 2 x Power Servo module I just made based on the PWM3. The circuit is very similar except I removed the DRV8313 and 3 of the current sensors. Controlling a servo is about sending a pulse at 50Hz between 500uS to 1500uS – and I have some 60Kg Servoes that can drain up to 6.5A – so I kept the 6P connector and made 2 power servo connectors that actually can support the currents needed. I need to add TVS (or opto coupler) on the servo signals and this is done – most of the routing was kept from PWM3.

In this draft I have suggested to re-use the 24V pin as 6-8V pin – I will probably modify that because I woudl need jumpers on the motherboard for this and it would be a disaster if I plug in a module on the wrong slot – I kept the capacitor bank from PWM3, but have plenty of space to move that onto. I might even consider opto-couplers on signals on this one.

Current usage on a RDS5160 is rated to 3,5A on 6V and 6,2 at 8.4V – I have ca 10A in total on this module and those header pins will support ca 16A – it is the PCB lanes that limit the currents. But, it is a current sensor on all the power consumers because the real budget will be what the motherboard supports.

Three different modules mounted above – I need to finish the motherboard and the real modules have some text, but looking at PWM3 and teh PowerServo it would be easy to do a mistake – so I will stick to the plan of separate pins for different voltages.

PLC – Module Space Usage

I have just made both these boards, but strugled far more to route the PWM3 board than Ethernet board – looking at the two I got a bit surpriced – On the top board (Ethernet) you can see the same infrastructure components as on the bottom outlined – the top has an extra SPX3819 and SPI-Flash, but notice the difference in density – how much space they occupy. I will order these regardless, but I do notice that on top layer I use ca 60% for MCU and on bottom layer ca 30% for standard ecostructure. Basically I have marginal space for IO as is.


But, keep in mind that this design allows for larger modules – double height and double width as well. It does however question how many of my modules that I can do as 25 x 45 mm size. It also make me consider increasing the minimum module size – that said I am as hesitating to increase as I was to decrease size – I want to give it a try first – collect experience. There will guaranteed be a revision 1.1 of these boards anyway.

One concern is that the W5500 breakout pins get to close to 24V power pin – I will leave that as is, but it might need attention later.

A bigger concern is the need for 24V, 12V and 5V for IO. I have som 60Kg servoes and would like to connect them as well – they need 5 or 12V – so what I am thinking is to extend the 2 pin header with GND, 24V to a 4 pin with GND, 24,12 and 5V – you simply only provide the pins you use. The header pins are good for ca 10A and the PSU is not the modules problem here (motherboard or extern module).

For now I will just add a simple 5V PSU for MCU on the motherboard and use an external PSU as power driver, but I will need all 4 layers to deliever power here because motors and servoes are suckers to power up – servos have a tendency to start and align a position as you power up – and for 12 small servoes I needed ca 10A in peak. Power usage once started is smaller and can be controlled in software.

I am thinking two different servo modules – one for 2x power servoes, and one 6 channel. I might also make a double width module with 16 channels etc – lets see.

Servo and/or Distance TOF interface is my next module(s). The TOF is needed for robotics being able to sence their surroundings and I will start with my own car because I lack distance censors in back and front.

PLC – 3xPWM Finally Done

86 components on 25 x 45 mm – it don’t look like much in 3D, but it was actually quite hard to route even on 4 layers.

  • MCU STM32G491RE
  • DRV8313 for 3 x PWM
  • 4 x Current Sensors
  • 1 x DC Input Sensor
  • 1 x CAN-FD Tranceiver (IPC)
  • 1 x RS485 Tranceiver (IPC)
  • 32Kb FRAM
  • SW controlled terminators
  • 8 – 24V support
  • 300uF capacitance on 24V on-board.

Some of you will recall that I made a similar module before (below). This was 20 x 50mm and 2 layers. It has a 60V DC/DC that worked with a tweak and hall sensors that I never tested – but it was components on one side only. The motor driver worked well – it was CAN here as well. I never used F303, I just used F103 instead. But, it is a 48 pin version of the MCU, No FRAM and no current sensors on this – and it lack capacitanse on-board.  This old board was tested with 50ich Volt, but  I  realized later that  some  of the  capacitors  did  not  hold the speck  – fake  Chinese  crap.  The new  board  will  not  be using components  bought  on AliExpress  – lesson  learned!

Having done an Ethernet Module and a PWM module I want to just get those assembled and evaluate the format as I go. Looking at the module above you can see that is no space for 2 extra SOP8 circuits and 4 current shuts – the circuit above is 40 components, while the new one is 86 components – I literally have no free space on the new one.

 

 

PLC – 3 x PWM Module

Showing 3D of the 3 x PWM Module. I had to reduce Voltage to 24V due to capacitors, but 12V or 24V should be ok. I added a 2-pin header for PWM Voltage and a capacitor bank as well as the 4 current sensors. The TSOP28 has a PAD so the middle of the top layer needs to stay clean – I will look into getting 48V supported, but 24V is ok for this little module.