thiagoralves Show full post »
thiagoralves
Petri is more focused on the 3D enclosure for now. We've not discussed anything about schematics yet, but I have my ideas. I plan to create the I/O boards first because they are simpler. My idea is to have each I/O board controlled by an ATmega328P like this one:  https://www.digikey.com/product-detail/en/microchip-technology/ATMEGA328P-AU/ATMEGA328P-AU-ND/1832260. This is exactly the same chip used on the Arduino Nano, which makes it easy to program, and therefore opens opportunities for the hacker world to modify the original firmware if they want to (and hackers love to do that). The original firmware will be simply a Modbus RTU implementation that will respond to a few Modbus messages according to the type of I/O, i.e. if it is a digital output card, it will respond to Read Coils, Write Coils and Write Multiple Coils requests. The Modbus address will be set using dip switches on the board. Also, the board there will have a Max485 for the 485 bus, and the traditional circuitry to make the voltage levels according to the industrial standards.

I'll be more than happy if someone wants to start the design according to these specifications. In any case, I might have my own design as well in a few months. Lets keep in touch.
Quote 0 0
HKTarzan

Thiago,

 

Would you mind to move your previous posting to the "OpenPLC new hardware device" group? I would like others to participate in the discussion on electronic hardware...

I have worked on an Input and Output card - the same viewpoint as you - easiest ones and would tentatively offer you 3 fully assembled PCB's of each (free) for self-use and to give away 2 sets to active contributing members who shall work along with you on the firmware. But I would follow up with you when there is a consensus among the "community" on what the IO PCBs should be like...

Quote 0 0
HKTarzan

My current design was done with an ATmega 324 (but a change can be implemented) and support 16 digital inputs with a 25 pin D-Type connector on the front panel and 2 x 20 Pin DIN41612 (AB) connectors Like:

https://www.digikey.com/product-detail/en/hirose-electric-co-ltd/PCN10-20P-2.54DS(72)/H11156-ND/1036416

The one DIN connector was for the PLC Bus and the other was in parallel with the D-Type connector. This would have given flexibility for a front panel connection like a PLC or a backplane connector as in a card-rack system.

Having noted the valid remarks in replies like soldering - Not even on assembly lines in China they always know what proper soldering is and as for cost, I do sometimes forget that being in HongKong and having access to manufacturing and assembly (in China) 30km from here makes it extremely inexpensive to me. So, for now, I'm supporting the design as above and on a DIN rail.

 

As for hardware, I do see an issue with the 328 as there are not enough available pins free for reading 8 x inputs and 2 X 8-bit dip switches. I see the options as either an ATmega32U4 or we can get past the lack of pins on the 328 by using 2 X Hex rotary switches like:

https://www.digikey.com/product-detail/en/nidec-copal-electronics/S-1010A/563-1043-ND/948354

On the MCU use 4 pins for the hex number and 2 additional pins to select the switches individually. The choice of MCU, I shall leave up to a discussion (above ideas only suggestions) and I can implement/change as soon as there is consensus on the issue.

 

Will the cover hardware change or can I take the size of the PCB and size and position of holes on the PCB in the 3D model as correct? Can I use the position of the feed through bus connector as a fixed position?

Quote 0 0
HKTarzan
Ouch - whats wrong with me today - 1 X 8-Bit dip switch
Quote 0 0
thiagoralves
HKTarzan wrote:

As for hardware, I do see an issue with the 328 as there are not enough available pins free for reading 2X 8 x inputs and 1 X 8-bit dip switches.

Why not using a 8574 like this one just to read the card address? These chips are very cheap (about $1.00 in single quantities), and talk on the I2C bus that uses only 2 pins. I know I2C can be slow for some hard real-time requirements, but we only need to read the card address once, so I don't think it is going to be a problem.

HKTarzan wrote:

Will the cover hardware change or can I take the size of the PCB and size and position of holes on the PCB in the 3D model as correct? Can I use the position of the feed through bus connector as a fixed position?

You should ask Petri about it. I'm pretty happy with the current design. I believe that he is going to change only the thickness of the walls, so it might not affect the current PCB disposition.
Quote 0 0
HKTarzan
Is there any confirmed feed through connector defined for the design like the number of pins and type?
Quote 0 0
HKTarzan
It seems as if the most common configurations are either 16, 40 or 64 pins and I believe the better one shall be the 40 pin (2X20)??
Quote 0 0
thiagoralves
I believe that 40 pins is still a lot. We might need only 16 or less. The bus only needs signals for power, gnd and 485 comm. If we want to send two separate power lines (+24V and +5V), GND, and a full duplex RS485, it will be 7 pins total. But since we are going for a Modbus master/slave protocol, we don't even need full duplex on RS485
Quote 0 0
Petri Mantere
Design of the next iteration is not ready yet, but PCB dimension or hole locations won't change much.

Connectors and their position can be changed regarding to electrical design. Please note that height of the bus connector is critical. Samtec ESQ-110-34-T-D is used in the 3D model. At the moment one module is 18mm in width, but that can be also changed.

I think that front panel connectors should be changed to 3.81 pin pitch connectors because they are readily available and there are also cheaper copys on the market (for example Phoenix 1897872 could be used). These are slightly bigger, so space in the front panel might be an issue. If we want to design 16ch card, then there is little room for indicator LEDs.

I will try to find some time on this week end to finish design for iteration 2.
Quote 0 0
HKTarzan

Thanks for the feedback on the bus connector - had to ask - in Asia it's not a problem to get hold of any, but it may be different in other countries...

Petri - Let's start with 8 channels s as we are limited by the MCU pins - design already changed back to 328 and an I2C bus expander...

In the PCB design, Do we go for a small matrix (2X4) of LEDs on a small plug in PCB that clip on inside the enclosure? If yes - I'll get the PCB uploaded ASAP for size and LED position reference or just let me know a physical size limitation that I have. Can 360 import STEP files?

Quote 0 0
Petri Mantere
I think that small LED matrix would be good idea as long as it can be sourced globally. It would be convinient if all parts could be sourced from DigiKey. LED matrix can be soldered on PCB and simply leave holes to front panel of the enclosure. The front panel surface will be 2.5 - 3mm from the front edge of the PCB.

You can find download STEPs from A360. There is a download drop menu on upper right corner.
Quote 0 0
HKTarzan
This is rev1.00 of the Digital Input module for discussion and changes if needed
Quote 0 0
r2k-in-the-vortex
Some thoughts and nitpicking on the circuit, disregard my armchair commentary at will, what I would do doesn't matter because I'm not making the circuit.

Front panel LED connector would not be necessary if you would put angle light pipes to the LEDs you already have there. I find it likely that most people won't bother with ordering a separate LED board.
Example: http://ee.farnell.com/mentor/1296-1004/light-guide-quadruple-right-angle/dp/4327974

RS485 wants to have termination, so maybe a wider switch block to handle that? If you have a switch you can throw then you don't need to solder the resistors on the wires.
I think 120ohm at end of the line generally does the trick. Master would also have pull up / pull down if I remember correctly.

R2 could also be replaced with a switch, I think 10 switch banks are pretty common.

Switch banks also come in tri-state variants so you could get rid of RN2, example:
http://ee.farnell.com/multicomp/mctimr-10/switch-dil-tri-state-smd-10way/dp/1522016

Optocouplers with logic level outputs are also common, also in dual packages, example
http://ee.farnell.com/vishay/vo0630t/optcouplr-du-10mbd-100v-us-8pin/dp/1779716
Something like that would reduce chipcount by 5 and get rid of RN1

You have just enough pins to get rid of U4, if you pinshare ICSP with some of the switches, for example the 3 most significant bits, for programming and debug you don't really need the entire address space.

R15-R22 There is no such resistor as 4k4, a typo, I'm sure you meant 4k7.

C3 at AVCC can be marked NA as ADC is not actually used.

Edit:
I'm not entirely sure if ~RESET pin requires pull up resistor or not, I think it works fine without it, but unless you guys have used this specific type and know for sure it might be a good idea to put it there. Can always be marked NA later on, if not needed.

Free pins on feedthrough can be used for more GND and more 24V, extra amperage never hurt anyone.

Review power symbols. Are 5V and VCC actually connected? VCC at ISCP connector. Also COM and GND, 24V is bus 24V, but there is no return path for COM.
Separating logic and IO supplies completely would not be a bad idea, but then you need a DGND in feedthrough. As you don't probably need 2x5V then you can replace one with DGND and rest of the free pins with extra power for IO.

Maybe an optional power/RS485 connector somewhere, DIN rail needs to have a power and communications entry point somewhere.
Quote 0 0
hjbleier
I have a couple of items that would be really nice a wish list hint hint [wink]

For the CPU card a realtime clock (no battery but a super cap) so it will be possible to do some kind of time scheduling without having a full time SCADA system attached to it. A super cap RTC will last weeks and one less thing to go bad.

For the Input and Output cards, real analog input and outputs that are industry standard like 0-10VDC and/or 4-20mA at like 12bit resolution or even 16bit resolution on the input card [smile]
Maybe even the ability to read cheap RTDs or even NTC standard like 10K type 2 or 10K type 3 or both
You could make like a universal input that is jumper selectable (digital/NTC/0-5V/0-10V/0-20mA) or even a different version of the input card for voltage and current.

Everyone does digital but for real world applications you got to have a way to read analog values! Plus it get real expensive buying modbus remote io to just read a couple of analog values. When you are trying to centralize a process to a single device for failsafe it defeats that goal.

Please oh Please wishlist come true, that would be the perfect PLC, opensource and openhardware!!!


just a couple of ideas..
Quote 0 0
hjbleier
take a look at EZ-Logix Rack PLC @ http://ezautomation.net/ezlogix/ezlogix.htm they have a nice mix of IO combinations that work good for lots of applications. But their software is not IEC-61131-3.
Quote 0 0