The previous proposal included a lot of data/address/function pins that actually is a bit obsolete design as we use multiple RS-X channels. This smaller bus uses 2×20. I can use the same width as for a Hat, but maybe a bit deeper boards.
I need the PLC system to be small and mobile to fit robots. I wanted a wider system to get more connector space, but I can add 2nd slots for those few cases. In short – I feel that increasing the size would be a mistake.
It is an alternative – and I could even do both …
If I use a 10cm wide backbone I have room for a 2×30 (or 3×30) by 2.54 pitch “bus” that could contain the following Inventory:
Summarised this gives me:
- 4 pin 5V PSU (5-10A)
- 4 pin 12V PSU (5-10A)
- 4 pin 24V PSU (5-10A)
- 4 pin 48V PSU (5-10A)
- 4 pin GND 5V
- 4 pin GND 12,24,48
- 8 pin data bus
- 12 address bus
- 10 function/extra address pins
- 8 pin for 4 RS-X lines (RS485)
- 2 clock pins
This is just a working draft…
The more I look for any real standards within PLC the more I get the impression that they either do not exist or is not used. This is consistent with what automation engineers tell me. I was kind of getting my hopes up with “Industry 4.0”, but well… lets crack on with creating our own.
The first PLC module I want to make is a box that can hold Raspberry PI + 1 or 2 Hat’s. Having the capability to add a RPI 3 or RPI Zero W is a great asset. It also provide a solution for industrial mounting of a RPI.
This enables 4 PLC modules “as is”:
- Linux/Windows computing module
- 5 port RS485/CAN communication Gateway
- 16 channel Servo/IO
- 8 channel DC Motor, 8 channel Servo/IO
I will create more Hat’s so they can be added as PLC modules as well. I am a bit wage on the details around how to integrate Raspberry PI itself. I want PLC connectors in front and that leaves Ethernet + USB at bottom. The more problematic side is accessing the backbone – suggestions are most welcome.
Maxim Integrated have started a PLC series called “Micro PLC” – the boards have a similar concept with STM32 at core and a backbone bus – except for that I don’t know much about them. It is a cute concept.
The system have several boards, the one above is quad channel analogue input. . I get the impression that the purpose is more to demonstrate Maxim technology than to create a PLC system thought, but who knows.
The blog entries show how Plain VM/Assembly evolved, but they can be a bit confusing to read stand-alone. So, I need to clean-up the content here a bit. The exercise now is to write up Plain Assembly Reference, Plain VM Reference and make sure the two documents are synchronized and consistent. I had a working core before, but need to change it to adapt to my latest ideas. Looking at my first register only VM I admit that is much simpler, but I am really keen to get instructions like Transaction and syntax supporting distributed processing and parallelism going. Below is an updated VM Instruction table – the text is fresh from a libreOffice document that will be uploaded later.
||Assign an expression to a variable. Execute a pre-parsed expression tree and store the resulting value in a variable. Expression can either be written as an algebraic math expression or a list of simple operations separated with ;
Call a function. Call creates a return entry on the stack and will continue with next instruction as End of the function is reached. Call can in contrary to raise also capture event’s raised by Raise.
||Unpack a bit field
||Pack a bit Field.
End a conditional block of code by jumping to a pre-calculated ix on the stack. For (as an example) will insert it’s own ix on the stack, End will jump to that ix and remove it from the stack.
||Exit the VM. Will terminate the current module.
For Loop. Will create a stack return entry causing the next End instruction to jump back to the loop start.
||If statement to allow if..elsif..else with expressions.
No Operation. Basically not needed except usefully for testing basic performance.
On capture event’s raised by a Call or State. It contains parameters defined by the Event definition in a Func.
Call an event with parameters, but without creating a return entry. Raise remove the stack, but will leave the stack entry point. The next end will return to the last “call”.
||Switch to a selected value.
Will wait until a listed event is raised before it process that event and continue.
||Loop while an expression is true.
Lock access to listed “interface” variables. Transaction will wait until access is granted or we time out. Transaction can also “spawn” in which case the transaction block is treated as a function in a different, local module that execute in parallel. See instruction Spawn.
Update complete a Transaction by either Commit or Rollback changes.
Can be called separate inside a Transaction block to commit part of the changes made.
Can be called separate inside a Transaction block to reset changes made. Changes are reset to the last commit.
Spawn call a function located in a different module. This function is executed in parallel and the returning event is inserted into our event queue.
I see a lot of schematics and people who struggle with getting a STM32 working. I have only been working with F0, F1 and F4, but these SoC (System on Chip) MCU’s are dead easy to get working.
Basically they have internal oscillators so they only need 3.3V power. The F4 range also need VCAP capacitors – the number vary from MCU to MCU. F411 uses 1, F405 uses two etc – so check your datasheet it is well marked. I always use SWD, but you could also use Serial, SPI or CAN for downloading code. The capabilities vary from MCU to MCU, but I like SWD because it is only 2 pins + NRST + GND.
The important thing is – connect power and you should be able to download code. The main reason I struggle is short-cuts on PSU lines, so once you ohm your 3.3V ok – just expect it to work – repeating myself – it is very easy to get a STM32 ticking!
This is a STM32F1xxRx prototype board I made for my own usage. I will update with VCAP capacitors for F405 and see if I can produce some of them in F103, F105, F107 and F405 format.
I was very annoyed as I got this one because I realized I had sent in revision 1.0 while I already had made a revision 1.1. Not that it mattered much – it did it’s job. This one is mounted with STM32F105RB. The new one have a few more leds – correct some markings and width + I will add vcap’s. The design of this carefully so all pins are available – I will add jumper for the internal leds. It also uses our standard SWD connector.
Just for the record, you do not need to add the SWD connector – use a SWD adapter with male connections and just press them down the holes – it allow you to program the boards without adding a connector – quite handy for later production.
I have worked far to long with 19″ cabinets and things you mount from front, so what I am thinking is a micro-version of a rack system. We box each electronic module with a backbone plug and custom front connectors. We then plug them in, wire using standard wiring (that we probably have to create) in front – no wiring in the back.
These boxes are simple and can easily be printed on a 3D printer. They will also allow us to mount more electronics tighter to address the total size.
A classic PLC uses 2 wires for a 24V pulse signal – we can typically standardize these so that we apply standard, plug & play cables and avoid as much custom wiring as possible. The top front is after all for wiring to equipment, not for internal wiring that is already done in the back-plane. I think this can work, but I need to talk it through with professional automation engineers – luckily I have access to them in numbers.
One drawback I can see straight away is vibration. I was planning to make this so small that it could fit mobile Equipment, but mobile Equipment vibrate a lot. We will need an outer box and holding mechanism that tolerate very high vibration – or more correctly reduce vibration.
Finding a standard project box for PLC is not difficult. The box above is available from 1.5 GBP and up on ebay. They have a standard click on system in the back for wall mounting and opening on the sides for connectors. This is quite popular within automation that mount these side by side and have cabling above and below. The illustration below show the main principle on how they are used
I ordered a few of these earlier, but gave them away because they where to large for what I planned at the time + I would like to avoid the need of loads of custom wiring. This is still an option, but I would like something a bit more plug, play & modular.
Automation engineers would love this type as they are used to it, but if you scale up modularity with rather large boxes you also need a large cabinet – I like to address less space usage and less cabling needs. We do after all plan a backbone bus that is not present in classic solution,