thiagoralves
Hi folks,

I've been working on a new board for the OpenPLC. My goal is to have it as simple and cheap as possible, although still offering PLC-level of electrical protections. It is called OpenPLC RN (RN is for Remote Node), and will be based on the ESP8266 chip. This initial version will support Wi-Fi only, but I'm also planning in creating a variation of OpenPLC RN that will work on Ethernet.

Attached is the schematic of the current version of the board. It is still in development! Therefore, I would love to hear the opinion of all of you concerning what you want to see in the board and also suggestions for modifications.

I'm looking for partners that will be able to manufacture this board when ready. If any of you know about any PCB manufacturer in US or China, please contact me.


Thanks!

Thiago Alves
Quote 1 0
tomdertech

Thanks looks interesting.

Some thoughts and comments:

1. It would be nice to see an electrical specification i.e. what are the ON/OFF voltage levels for the inputs, what are the drive capabilities of the relay outputs etc ... How would these compare to a PLC
2. I am not too familiar with analog outputs on a PLC is a PWM analog out clean enough?
3. I would suggest some clamping protection on the inputs, especially the analog input and the digital inputs. I would look at using transrobs maybe the SMBxJ range?
4. What form factor will the board be in?
5. What kind of connectors are you proposing to use?

Just some early thoughts, but looking good.

Regards,

Tom

Quote 0 0
eyasu
Great news! I'll provide some comments soon.
Quote 0 0
thiagoralves
tomdertech wrote:
1. It would be nice to see an electrical specification i.e. what are the ON/OFF voltage levels for the inputs, what are the drive capabilities of the relay outputs etc ... How would these compare to a PLC 

The input voltage is optocoupled, with a range for the digital I/O of 5-60VDC. The relays are 220V 10A. Most PLCs on the market have about the same specifications.

tomdertech wrote:
2. I am not too familiar with analog outputs on a PLC is a PWM analog out clean enough?

There are some PLCs that use open collector output with PWM. If you want an analog voltage out of that, basically you just need to add a capacitor at the output.

tomdertech wrote:
3. I would suggest some clamping protection on the inputs, especially the analog input and the digital inputs. I would look at using transrobs maybe the SMBxJ range?

That would be nice, but I'm trying to keep the components count as little as possible for the board to be cheap. The optocouplers already offer enough protection in my opinion.

tomdertech wrote:
4. What form factor will the board be in?

I'll just have this answer when I finish the PCB layout design. But I'll try to make it around 10x8cm

tomdertech wrote:
5. What kind of connectors are you proposing to use?

Screw terminal connectors are the dominant type of connectors on PLCs. I'm planning to use those.
Quote 0 0
sachin_singh
Hi Guys
Appreciate Thiago's great work
PWM output using a MOSFET is too crude to work under industrial environment
It would at least need an LC low pass filter along with short circuit protection using PTC

ADC input at minimum would need anti aliasing low pass filter and a 50/60 hz notch filter (may be IIR filter)
plz refer to the diagram
Special care has to be taken while PCB design too such as
Separate ground planes for analog and digital
Terminating analog and digital grounds at a single point to avoid ground loop
Keeping analog and digital signals well separated on the PCB
Cheers !!


Quote 0 0
thiagoralves
The OpenPLC RN board is ready! Here is the view of the PCB:
OpenPLC_RN1.PNG    
OpenPLC_RN2.PNG

I'm quoting the cost of manufacture at some places and expect to have the first prototype in my hands in a few weeks. I'll let you guys posted!  
Quote 0 0
eyasu
Hi Thiago,

It is great to see that you are speeding up the process. I am eagerly waiting the final board, because I am planning to design a lab with OpenPLC RN. I would want to provide the following suggestion:
  1. Hardware specification: hardware specs, specially RAM size and processor speed, should be comparable to real PLCs. If you make the specs very high, it might not be logical for some tasks. So please make it very closer to existing PLCs.
  2. Analog I/O support: hope you have already considered to support analog I/O supports on the design. If not, please consider to support it.
  3. Architecture: What will be the hardware architecture? ARM? x86?
  4. Compilers: What type of compilers will be supported by the firmware? gcc/g++?
These are the few suggestions and questions I have for now. Hope to provide more later or when we have the first model [smile].

Thank you,
Eyasu.
Quote 0 0
thiagoralves

eyasu wrote:
Hardware specification: hardware specs, specially RAM size and processor speed, should be comparable to real PLCs. If you make the specs very high, it might not be logical for some tasks. So please make it very closer to existing PLCs.
CPU: Tensilica L106 32-bit RISC @ 80MHz
Mem: 64 KiB of instruction RAM, 96 KiB of data RAM
eyasu wrote:
Analog I/O support: hope you have already considered to support analog I/O supports on the design. If not, please consider to support it.
1 analog in (0-10V) and 1 PWM out (open collector). Please check the diagram for details
eyasu wrote:
Architecture: What will be the hardware architecture? ARM? x86?
Tensilica RISC CPU (custom made for the Espressif ESP8266)
eyasu wrote:
Compilers: What type of compilers will be supported by the firmware? gcc/g++?
Espressif offers an SDK with gcc for their chip. However, the firmware for the device won't be changed at runtime because OpenPLC RN is supposed to work as an remote node, kinda like an Modbus remote node, where it receives commands from master and then switches outputs.

Sachin_singh, I took a note on your comments and implemented them (except for the filter + PTC on the PWM out)

Quote 0 0
wilksey
Hi,
Can you please explain why OUT3 + OUT4 are inverted?  Is this something to do with the ESP chip or is it done on purpose?  I see OUT3i is used for "flash" which I presume puts the ESP into programming mode?

I don't see a power input connector on the schematic, do you have an up to date one?  Also there appears to be no input protection on the power.

How would you control the ESP version? Is there a MODBUS over WiFi type system?
Quote 0 0
thiagoralves
OUT3 and OUT4 are inverted because of the ESP bootloader. Those pins needs to be at a certain voltage during boot or the ESP will enter in programming mode.

The P1 connector is for power (up to 48VDC) and there is also a Power Jack.

The ESP works with a custom protocol. It uses the ESP8266 driver on the OpenPLC host side, but the firmware is a little bit different. I already ordered some prototype boards, and they work great. The only problem is latency. However, you can't expect great latency with WiFi based devices, right? So, it's a trade off.
Quote 0 0
wilksey
Hi,

Thanks for your reply.

I can't see P1 or a power jack on the schematic?

Would be good to see some photos of the prototype boards, and perhaps a video of them working.

EDIT: I've just looked at the datasheet for the MC33063A, and it states that the "absolute" maximum input it 40V, not 48V like you have said, are you using a different part or did you not realise?
Quote 0 0
thiagoralves
You are right. The maximum input voltage is 40V. The P1 connector can be clearly seen on the renderized 3D image of the board. It is the first green conector in the picture. The power jack is lacking its 3D image, but the footprint is also visible, right beside the P1 connector.

I'll try to take some pictures to show you how it works
Quote 0 0
wilksey
Thanks,
Yes I see them on the 3d view, I was wondering if there was a schematic that showed it.
Is the code on github or is it still in development?
Quote 0 0
thiagoralves
I'm sorry. Now that I looked at the schematic attached to this forum thread I realized that it is outdated. I'm attaching here a .zip file with the entire Kicad Project for the board, plus the ESP8266 firmware. It should be loaded using the Arduino IDE.

When the device runs for the first time, it creates a WiFi connection called OpenPLC-WiFi. In order to configure it, you must connect to this WiFi, open the browser and go to 192.168.4.1. Then you will see a nice web interface that will guide you through the steps to configure the OpenPLC WiFi board (yes, I changed its name). Once it is configured, the board should reboot automatically and then connect to the OpenPLC Host defined in the setup. If by any means you need to reset the board to the factory defaults and configure it again, just boot it up with the first input wired to 24V (logic true). Then all its configuration will be erased and you will be presented with the OpenPLC-WiFi network again.

Also, you asked for a photo, here it is:
WhatsApp Image 2017-03-21 at 5.17.29 PM.jpeg 

I'm sorry, I don't have a video of it working yet. I'll try to make one this week.
Quote 0 0
wilksey
Hi,

Wow, thanks for the zip file, it seems to contain everything!

Just wondering is there a specific "host" application (say within Windows) that needs to be ran?  The protocol looking at the .ino file is quite minimal at the moment, does it just send some kind of bit pattern?  Are there any plans to implement a MODBUS protocol over the WiFi?

Thanks again, your work is very inspiring!
Quote 0 0