RTFrame – Designer

I am currently only focusing on HMI design, creating a new C++ HMI Designer and generating code. I am close to finish so will soon switch to actual PLD diagrams again. RTFrame Designer replaces the previous BSA developed in C# and I am amazed over performance and how fast development in C++ is once I created the SDK. Below is a few pictures of progress.

The new HMI Design allows you to create a specification of a user interface and then generate source code for a selected target. In this case I have also added two Precentation Objects which are rectangles on screen to select content – see next picture for usage. These rects can be switched off.

This last pic shows a Document designer where I get selected paper size and can drag precentation objects into the document. These again can be printed on a printer, PDF or Web Pages. So as you design with RTFrame Designer you can also automate the documentation tasks. And since I am on Windows using Visual Studio it obviously generate C++ code and project for Visual Studio that can be opened and run …

This is the final app after being compiled by Visual Studio and started – running stand-alone. This part is still a bit work in progress, but it is very cool to see a HMI designed, dokumented and running like this.

RTFrame – Real Time Framework

I got tired of messing with Phyton, Java or C# or web/cloud apps to make real-time systems, so I finally started on a pure C++ library with high performance desktop graphics. Graphics is only a start, but it is the most important one. Not much have been done in this area the last decades and as everything else uses C++ at core it it unfair that we don’t have a proper C++ library as well. I have worked with MFC, Qt, C#, Delphi and a few PLC solutions and while Qt was close it also is very heavy to work with, hardly C++ anymore and heavy licensed with close to no tools. I abandoned Qt for C# earlier and while C# is great it only exist for real on Windows and it is and will always be an interpreter with performance issues. Even Qt uses JavaScript on theire QML and it is not nice to work with as you spend far to much time in debugging. So, pure C++ here we go. I will deal with Web and Smart Phones later, lets first create a RTFrame that cover Windows and Linux so we can make advanced graphics apps with a mix of 2D and 3D functionality easy.

Below are some images of demoes and applications on their way – see text below pictures:

Some of you have seen BSA written in C#, I am redoing the concept in C++ due to performance issues. And on the way I also create tools/API to make HMI very, very fast. The target is advansed SCADA type applicationr ot PLC, but the framework is generic in nature. That said I expect that C++ will mosltly attract developers facing technical projects where performance do matter.

One of the first tools I needed is PixelArt – a 2D Image editor so I could open, Edit and Save images. This is not finished, but is included in the SDK/Designer.

I have already shown the draft for a 32 channel logic analyzer/oscilloscope in a previous entry. This is an app building on RTFrame that display 32 channels real-time at extreme speed. This is a tool I want myself and I will run it on a RaspberryPI 10″ screen. A key milestone was to achieve 32 channels at 60FPS with very low CPU usage – that is what the GPU gives me.

I have only made one Circular Gauge yet, but they will come in numbers and shapes – this was just a performance test filling a 4K screen with analogue meteres that all move 60FPS – it’s beautifully and my 12 year old laptop is a 9% CPU usage.

 

This last one is a demo with some controls including a 3D control. I can place the mouse on the triangle and turn it in all directions – presentation graphics 3D control miced with ordinary 2D controls.

And stay tuned because this is coming out fast. This is something I have wanted for years before I finally started it just a few weeks ago. At precent I focus on Windows, Raspberry PI/Linuz, but I will address more platforms later. The objective is high performance, precentation graphics at a minimum of developer cost – meaning minimum of coding time.

Logic Analyzer

One of the instruments I always wanted is a Logic Analyzer that can combine whatever signals I have available on a computer. Some will be digital, others will be analogue or calculated protocol decoding and they will come in with different sampling. Getting data in is not the difficult part, presenting it at 60FPS with 32 channels was – but the demo below does exactly that. It is still work in progress, but I am impressed by the graphic performance. This is precentation graphics done by GPU using my new HMI SDK RTFrame. And this is pure C++ that run on Linux, Windows, Raspberry PI for now – I will add others later.

PnP – New machine design

I started building this machine before I realized it would be easier to draw it first to get things right. This is a ca 700mm x 700mm x 700mm design – It is a machine that is designed to be mounted bolted to a floor. What you see below is just the raw design – it still lack a few details + it lack the outer cabinet.

I currently count 26 x 2020 frames – 550, 600 and 650mm length. I did not want to cut a single 2020 frame. The number of 8mm feeders illustrated is 56, but I can mount on all 4 sides increasing number of feeders to above 100 + I can extend the machine to 1200mm in feeder direction. I have options, but the reality is that I will be using strip/tray feeders a lot – so the large work-space in the middle is 600 x 345mm and this can be extended if I use less feeders.

I use 3 different Nema motors – Nema17, Nema11 and Nema8. Nema8 is 20mm wide and is key to get the needle that narrow. Nema11 is used to move the needle up/down on he Z axis. Nema17 is used to move X and Y axis. The main challenge I had was mounting of X and Y axis – it was difficult to find parts. I am not happy with the Nema17 motors sticking out, so I am looking for a different solution to that – it might be that I need to include plastic design to strengten metal design – lets see. I have all the parts, so I just need time to build this and I am sure I will get a few surprices as I assemble the machine.

I have shown the new Feeder back in may, what I lack is the electronics – I have the main control system, but lack the electronics for the feeders. I will be back on that later.

PnP – New needle design

I started my PnP machine as a modified copy of LucentPnP, but as I assembled that machine I also realized that a plastic design moved to much. The entire machine was unstable and needles would move several mm under speed. Achieving 0402 was difficult, 0201 was close to impossible – so I decided to move on – remove all plastic on critical points and remake a complete, new design – metal only. I started with the needle system and decided on a 2/4 needle design that is illustrated below:

I am still using 2020 frames and this head design focus on easy manufacturing of metal parts – I needed a design I could build myself from parts that are commonly available. No fancy CNC usage – only simple drilling. The result amazed even me – I have never done much metal works before, but once I started designing and started realizing how I could achieve results it came out nicely. The drawing show a 4 head design, but I actually plan a 2 head – and the design above can be anything from 2 to 8 head. The reason I want a 2 head is because a 4 head cost more, is heavier and occupy more space. The 4 head above is 10cm wide, meaning that I waste space on the machine. As a hobbyist I don’t care much about assembly speed, so a 2 head is fine. But, I want an option to build a faster, larger machine later.

This work is open source, I use FreeCAD and manual and design files will be available – for now I hold back a little because I actually need to build and test the machine myself. I have all the parts, but lack time at precent. That will improve as authumn comes back.

This new PnP Machine is 99% metal (Aluminium) and uses only easy to get parts so that anyone (including myself) can buy and build a custom machine. The design consist of 5 sub-designs:

1 – PnP Header design.

2 – PnP main machine.

3 – Feeder design.

4 – Control system electronics.

5 – SW/FW.

I will cover all designs in detail partly through this blog, but also through separate pages that focus on this machine only.

 

 

 

PnP – Designing my own Feeder

Having build BambooFeeder, BingFeeder and looked into PhotonFeeder I decided to design my own partly to solve issues I observed, partly to save space and partly to save cost! This was a proof of concept experience and it turned out very good. The 3D model of the 8mm Feeder is shown below. It is not 100% complete as I will need several rounds with printing, adjusting & testing, but results look promissing so far. I seldom show the full FreeCAD app, but in this case I do so for a reason.

Specification

  • 12 mm wide for 8mm tape.
  • Smart Feeder with intelligence/memory
  • Automatic configuration.
  • ESD/EMI safe.
  • 130 by 101mm – very small by accident.
  • Low cost – ca 10.- USD per feeder + control system.
  • Mounted on 2 x 2020 or 2040 frames.

Cost

  • Plastic PETG print ca 2.- USD
  • 2 x N10 motors ca 5.- USD
  • Bearings and screws ca 3.- USD
  • Control system – TBD

Reference to parts and where to get them will be given on github later.

To hell and back with FreeCAD

I use FreeCAD because it is the only open source CAD system I know. This is not a complex model IMO, but using FreeCAD 1.0 I started getting problems as the model became a slug on a i7 Windows10 with 16Gb RAM. At one point I got a “out of ram” message as I tried to save and even small changes took close to 10 minutes to execute. Imagine sitting and entering a single parameter and waiting 5-10 minutes to see the effect? That was me 2 days ago and I basically decided to to remove FreeCAD from my computer as useless, sluggish, junk! The model was 605Mb on disk (WTF?) and took some 12Gb in RAM. It was no way I could continue with that, but a friend urged me to test FreeCAD 1.1 and I did.

Loading with FreeCAD 1.1 and saving again the model shrinked from 605Mb to 62Mb on disk and “only” used 3,7Gb RAM – the difference allowed me to continue and finish the model. It is still slow to work with, but 5 sec waiting is nothing compared to 5 minutes. FreeCAD 1.1 is a big improvement over the earlier versions. Well done to those working on this release. Since the feeder model is in FreeCAD it also means it will be available open source.

Sprocket & Tape Feeding

I use a plastic sprocket with encoder holes and merged that with a gear. My first test was to 3D print this and it did to my surprice come out nice and strong. The sprocket (red gear on drawing) is only 1mm thick, but I could not break those tags with my hands so I think they will do ok. Early testing of tape feeding is very promissing. Using plastic gears is a big cost saver, and my take is that if I need to swap them out after some time, so what – they are still dead cheap to print in PETG.

Wormgear

I use two workmears on N20 motors and those are complex to 3D print. I have the option to change to brass versions, but that cost ca 2.- USD each. For now I want to stick with PETG and see how it goes.

Sprocket Decoder

I use IR decoders to read the sprocket position, but I could not find any pre-made sensor fitting, so I decided to use two 0603 components and make my own PCB’s forming a very narrow sensor around the sprocket wheel (Yellow parts at right) and I also made a cable gate from right to left to avoid that sensor cables got close to motor/gears.

Wheel Bearings

One of the decitions I made was that I wantet proper wheel bearings on every gear. They only cost ca 10.- cent, so 5 bearings is a total of 0,5.- USD. Well spent money in my book. With bearings also comes special screws that probably is another 1.- USD in total.

Peeler Mechanism

The peeler mechanism is the 2nd N20 motor (top left) with 2 gears to drag the tape between them exiting it at left and a classic end-switch to verify if tape is tight. I have no idea if this will work as the tape is thin and slippy, but we will see.

Control System

To operate the feeder I need a small control system and this is currently the green plate located at left. The control system fold into the lid so that it also is the wires from left to right over the tape track. That saved me from having wires on the sides. This drawing still lack the proper PCB with mounting holes, but PCB is fixed to the main part and lid will have a hole for it. I can also increase the size of the control system as it needs to hold a MCU, two H-bridges and CAN. MCU will be STM32H503 because I get those as low as 1,5 USD. They are a complete overkill for this task, but they have 128Kb Flash. I started coding on a smaller 32Kb MCU costing 1.- USD, but was in fear of running out of flash. I also use H5 for everything else due to cost/performance so it makes sence. I will return to control system design later.

Issolated communication

I will be using CAN with 3,7KV isolation on the control system. The reasons is that it only cost ca 2.- USD extra and with 50 to 100 Feeders on a machine I will be operating 100 to 200 DC motors and lot of wires with ESD/EMI challenges. One Feeder is not a problem, but 50 to 100 of them is a large system to destroy, so I preffer to do it properly!

CAN can operate 1 – 32 nodes easely so I need a USB/Ethernet/CAN GW capable of Ethernet (USB) and multiple CAN networks – and guess what – I accidentally have that ready as other articles describes ECU with multiple IO capabilities – CAN and Ethernet is on the list, but so is also RS485 and GPIO pins so I can easely create an advanced automation machine and integrate a mix of BambooFeeders, BingFeeders, T-2, Photon as well as my own.

That said I would like to think about that a bit because while my ECU’s are perfect for this task they also come with a cost… I can however accept a single cost in ca 200.- USD region if that enable low cost, intelligent feeders.

Intelligent Feeder – what is it?

Firsly I want to put persistent memory on the feeder, so that once you mount a reel you also configure the feeder. And once you put that in the machine OpenPnP will automatically recognise that you have 10K 0402 (example) in position xxx. Minimum config work needed. The next job is then for OpenPnP to execute auto-calibration and start running.

But, it is more – as we start/stop motors we send PWM pulses and the “normal” way is to start fast and break hard creating small “bumps” in the feeder – I want soft start and soft stop to avoid those twitches. I have a IR sensor for position, but the reality is that this is inaccurate so I want to use software average to make it more accurate by predicting timing of next position and adjusting. Once I have run adry run I should have data to compute this more accurate.

I have the option to add a 2nd IR sensor directly on the tape itself – I am still considering if this is worth it.

A last option is wherever I need a “break” on the tape itself. I have an option ready, but I have so far decided against it. The tape follows the track perfectly and is very tight (not to tight), but this is one thing I need to test and adjust.

Since we have memory we can as well count components on the reels.

I will add a vibration sensor on the dev kits for my own usage, but they will not be on the final product.

Noise/Vibrations

This is work in progress, but as soon as I start a N20 motor on a Bing Feeder I notice that sound and vibration is amplified through the plastic. I will have the same challenge, so I need to deal with that. I have an idea to isolate the motors, but lets see. This is the reason I want a vibration sensor on the feeder for testing.

To be continued…

I have so far only drafted a proof of concept on a new, small, low cost feeder. I have yet to set it into system and link it up with OpenPnP.

This is an open source project so I will put it on github later.

 

PnP – Feeder comparison

I finally got around to actually build a Bing Feeder using white PETG. I have bought 3Kg of Green PETG for later as I believe that color is better for camera support. Going from BambooFeeder to BingFeeder is a big jump – two completely different feeders and separate set of pros & cons. I will tempt to go through some of my observations.

Bamboo Feeder AS2:

  • No control system so you need to add a servo controller and deal with inrush current as these servoes draw 0.8A as the start.
  • Simple, low cost design (4 .- USD) – based on youtube movies very ok with some added camera usage.
  • 12mm wide on 8mm tape version, can be mounted tight.
  • Push-Pull with a cheam servo.

Bing Feeder v3:

  • Adds a control system to drive motors, communication is through two GPIO pins – on/off and pulse. You feed by sending a 10ms pulse. Closed loop where motor start and move until the IR sensor detect a gap, so it move 2 or 4 mm depending on what sprocket you insert.
  • Sprocket based so will drag the tape 2 or 4mm. Uses 2 x DC motors (1 c N20 and 1 x N39),
  • IR sensor to detect movement of sprocket wheel.
  • 20mm wide on 8mm tape.
  • Support 0402 by design.
  • Cost ca 20,. USD.
  • Far more dificult to 3D print.

My first observation on Bing Feeder is that I could have redesigned it to be 12mm wide. I also could have decreased cost and upgraded the control system to be intelligent. The question is if it is worth it? The reality is that if BambooFeeders costing 4.- USD works with Camera = problem solved. I ordered 6 x 8mm Bing feeders with 0402 support and from what I see they should manage 0402 and maybe 0201 – lets see then I start the machine.

Seen from my perspective these are both very interesting designs.

As I rebuild the PnP frame I will have a 600 x 600 x 600 mm metal box and be able to add Feeders on 3 sides, so for testing I will add both Bamboo, Bing and T-2 to see what I get out of them.

 

 

PnP – Smart Feeder

Looking at Feeders I looked into PandaPlacer’s BambooFeeder, microsmt’s Bing Feeder as well as the T-2 Feeder. I am not able to use any of these “as is” because they are not truly open source – but BambooFeeder is very low cost < 5.- USD and I had their 3D images so I could print them. I have received a T-2 Feeder with documentation and I am waiting on a Bing Feeder, but lets start with the BambooFeeder.

First – lets discuss why I do not use LumenPnP design anymore. This is the machine I started building, but I realized the machine was a bad piece of engineering “as is”. V4 is better, but it is too much plastic and issues that create instability on the magchine. microsmt and PandaPlacer did not exist then I started and these machines are all metall for a reason. So I ditch the LumenPnP mechanical design and copy the two others. Photon Feeders look great, but they cost 95.- USD and I need ca 100 Feeders – if I was to pay 95.- USD per feeder I could as well just buy 2nd hand Siemens or Yamaha feeders.

I have not been able to look into Bing Feeder design yet as I am still waiting. But, I started printing BambooFeeder and decided that this wa a candidate for upgrade because I need a lot of low cost feeders for 0603 and larger components. I do see that Bing and Bamboo both talk about 0402 and even 0201 components, but lets start with 0603. My challenge is that I need a lot of feeders and a control system for them and I can’t buy the later as is + I don’t want to either. 100 BambooFeeders in a system have a serious issue – each servo have an inrush current of 0.8A and a stall current of 2-3A – so as you switch on 100 servo based feeders my powersupply wiould need 80A – and yes I was offered a 5V/150A PSU from a friend, but lets not go there.

A better solution is to create a servo controller that also can switch on power one feeder at the time so that we can start feeders in sequence and avoid the insane inrush current. And since BambooFeeder have an open space of 20 x 50mm it become attractive to put a RS485 based Feeder Controller here – A MOSFET to handle 4A cost 0.1 USD, MCU with EEPROM 1.- USD so BambooFeeder is dead easy to convert to a smart feeder. A small MCU can switch on power to servo as well as run the PWM + measure current usage and if we have an Eeprom it can also be smart and remember what is on the tape – type of component and how many left etc – that’s a lot of extra functionality for 2-3.- USD and it gives me a smart feeder costing < 10.- USD in total.

If you only want 1-32 Feeders you can control these directly from a USB/RS485 converter and with a PSU budget on lets say 4A – the trick is to only operate one feeder at the time and start them in sequence. For 100 Feeders I need a GW Hub, but that is something I already have. I plan to use Duet3 as main control system, Raspberry PI 5 as main computer and a self-made ECU (Ethernet based) to control feeders and other things. If you have followed this channel you know that my ECU is a minimized PLC so I have the system to add whatever I want.

For MCU on the Feeder I decided on STM32L031 that comes with 32K Flash, 8Kb SRAM and 1Kb EEPROM + it cost ca 1.- USD per MCU in quantity of 100. Assuming I can get the code I want on this – if not I can try an old AVR -8 bit and ordinary Arduino IDE, but as a backup I can also scale up to a 3.- USD solution that include a STM32H503 – but lets see how coding goes.

On RS485 I just use a non-isolated traceiver because I will be isolated in the other end. This means I accept the risk that a hard spike might knock out a network of 4, 8 or 16 Feeders for now.

The Power part is a 3.3V regulator and a small MOSFET that is driven by a 3.3V signal. The servo signal itself is a 3.3V PWM,

MCU on the system is a bit tricky, but I can easely provide 5V/4-6A isolated – with 100 Servoes or DC Motors on a system we need to avoid a disaster if we get a motor spike, so we need to have sufficient isolation or you will suddenly find the entire electronics dead one day – been there, don’t want to go there again and isolation is cheap these days – lets do this properly.

As for T-2 Feeders – I like them and I have one with documentation, but they require a different connection system. For now I can connect one with a vero board as 4p rail and as this is RS485 as well we can connect them in parallell with BambooFeeders for testing.

As for Bing Feeders I have not looked into these yet, but I plan to connect a few of these as well if practical. All three feeders are usable for 0603, but have accuracy issues for 0402 and 0201, so I want to test and learn + I want to enable control systems/ecostructure for all three as open source. What I do on feeders will be open source under MIT license + I will offer to sell the control boards later – but, I hope someone else will produce a 2-3.- USD version on Aliexpress.

Taking a little about 0603, 0402, 0201 and why 0402 and lower become an issue. The hard reality is that the overall quality of these machines make even 0603 an issue as inaccurate feeders miss, have to use camera and retries. On 0402 and 0201 this become a larger problem as 0402 need 0.1mm accuracy on position and 0201 needs 0.05mm – a 3D print has an accuracy of 0.4mm so feeding a tape with 2mm +/- 0.05 mm becomes an issue. It will work on a good day, but you will experience that the machine miss even on 0603, miss more on 0402 and is unreliable on 0201. To compensate for this we need more accurate mechanics and no plastic Feeder will provide that – if you tune in a 0201 tape it will work for 2-3 picks and start missing. So what do we do?

We can buy more expensive Feeders like Siemens or Yamaha 2nd hand (or new) – they are metall and designed for 0201, but you also have to improve the rest of the system + your DIY machine suddenly starts to cost a lot of money. The alternative that I hope to achieve is to improve camera systems so they can correct errors – if we miss on a pick we simply use camera to auto-caliber next pick position etc. This will require far better cameras that will be slower to work with + better lights, but my take on this is that I want 0201 components and I don’t care if my machine need to use a bit of time – evrything is better than me sitting 3-4 days assembling a board by hand. For production in larger quantities I use different solution that become available with volum.

New PnP Head Mounted

New PnP Head. It is the same old LumenPnP Head, but I modified it to use laser sensors on both side + Nema8 steppers. The rest of the machine is in 3D print behind me, so give me a few days and I will share pictures of the assembly. I do not have access to original LumenPnP parts so I have to design around parts like custom switches. I also prefer the smaller Nema8 rather than Nema11 – but, lets see how it works out.

If anyone wants a copy of the design odifications just drop me an email.

 

Happy Easter

Just a picture showing what I am working on. I also think this is the first picture with Ethernet mounted. Both these boards will soon come in new versions.

I need to experiment a bit with picture resolution since my screens now are 4K – I used to reduce pic resolution by copying pictures through a 2K screen to make them more user friendly – that don’t work anymore.

The main board at right was made 2cm short of full length to enable 5 x DSUB9 in front panel with 1:1 cable to the ports. What you see here is a test cable used to communicate port to port. Firstly I detected that port 2 on the cable was not properly connected and secondly I detected that the 3rd port had crossed tx/rx – but, I got the CANFD ports working. Using CAN ot RS485 I usually either use DSUB9 or simply screw terminals. M12-5 and NEMA2000 (left) add a different perspective. I am quite eager to test both NEMA2000 and an increased speed version to see what speed/distances that can be used.

But, that’s work for another day. I lost power in my house yesterday and realized the reason was that a plug-board in the basement had short-cutted. The reason it shorted had something to do with 20cm rainwater on the floor. It has been raining so much that water now comes in through the floor rather than leaving out – so water pumps was installed this morning. Only minimal damage done, but this scare me a bit – I did not thing this was possible and have even bragged about my basement beeing dry – I never considered the water to come in from the drains in the floor. Oh easter fun!