Open source PLC hardware

C
Well it would probably work, but it would cut your speed in half, doubling the number of serial read/writes. And you would need the "native" CS to go to that chip. A better way, if you want to include some hardware, would be a 1 of 8 decoder chip using 3 GPIO lines to drive it. A write to GPIO should be much less expensive in terms of time. Most simple would be to use the software select built into the expander chips, but we need the hardware select anyway for cards that don't use that particular chip. If 8 GPIO lines are not available on the CPU selected, then we might have to go with one of these routes. We can certainly add length to the backplane on the CPU end and have it run under the CPU. I suppose I should pick a CPU card and see how hard it will be to use 8 GPIO. 3 should be available on most any card. But, I hate to design to any one board as they are coming out at a rapid pace and who knows how long a particular board will be available. If the need for 8 selects will be a problem perhaps I could include copper for the decoder. Otherwise, the BP is very close to being ready for fab. PCB's design rules checking has a field day with the bus routing, but the issues are minor. Perhaps another version with the decoder for those who have a shortage of IO would be better?

Regards
cww
 
W

William Sturm

Curt said: "The gEDA suite is the only contender here, I'd much rather spend money on the prototype than on tools or especially Windows"

I would personally rather use TinyCAD and FreePCB. They cost nothing (if you run MS Windows) and are very good. They are both GPL'd also. I do agree that a nice open file format would solve these kind of issues, I am not aware of any however. TinyCAD uses XML as it's file format, FWIW. It also can export PNG files. FreePCB uses a Pads-PCB format for it's netlist input/output. It's output files are in Gerber format, of course.

I suggest that we all use what we want, as long as we output RS274X Gerber files for board artwork and any open image format for schematics, such as PDF or PNG. Sure, there will be some duplicated effort, but so is learning new software and installing multiple operating systems.

Bill Sturm
 
W

William Sturm

Curt said: "Perhaps another version with the decoder for those who have a shortage of IO would be better?"

Ken said: "I really would encourage a completely passive backplane for simplicity"

OK, then that is what it will be, at least at this point in time. Simplicity wins, I was just thinking of ways to minimize the number of interconnects.

Bill Sturm
 
C
The 1" backplane just passed the Advance DFM check and is ready for fab after my final check.

I'll work on the cards in the morning after chores. I'll send Bill the .png to post.

Regards
cww
 
C
Hi Bill,

I suppose you can design boards with whatever you want. But, besides the issue with duplication of effort, there are a few problems that are analogous to Open Software. Gerbers are not "source code". Yes, you can make boards from them, but that's about it. So they are analogous to binaries. The "source code" in this case is the file format the layout software uses. The end user should be able to use this without restrictions, now and down the line. That means the layout tools need to be Open and not just free. And although this may seem to be splitting hairs at the moment, I have dozens of board designs that were made mostly with free tools that are now useless, because the tools have gone away. Some were DOS based, on old versions that are no longer available. Some were tools from board vendors that are no longer with us. Some even date back to my last regular use of Windows, (3.11) because there was no choice. Some could probably be resurrected, but not easily. And not without my involvement. So as soon as PCB would make artwork that was acceptable to the proto houses, I switched to that. All of those designs are still loadable and editable and I can legally send you the artwork, PCB and the OS it runs on. Because I _own_ them, and you can too. In fact, I'm obligated to make them available. This is one of the least recognized problems with shrink wrapped commercial software, but a problem that causes a great deal of trouble in automation and any of the arts that produce durable goods. Can you use any of the Windows tools that you were using 10 years ago?, 15?, and can you legally provide them to others? Maybe, but probably not. So, yes, at the moment, I am glad for free tools. But, for the future, I need Open tools. The GPL can't be retracted. And PCB will not go away. Please don't read this as nagging at you, there is a point to be made as to what Open really means. And it's one of the special problems with Open Hardware that we heed to consider.

Regards
cww
 
C
Well, I worked over the input board to use .150" connectors which will allow for 23 connections, enough to do the usual sort of "isolated strap to either sink or source" board. But in the meantime I submitted the input card to a DFM check at Advanced, and it threw all sorts of defects. I was shocked, and then I looked at what it found. It doesn't like the lettering on the board that shows the pinout.:^) Is this desirable enough to try to find a workaround? I like having it on the board, but may have problems if their check barfs. Also, I am trying to find available alternatives to the Beagleboard. In my search, it seems to have the best bang for the buck even if $150 is more than I want to spend, and it has all sorts of bells and whistles that seem pretty unnecessary for this application. But it's the right size, has good support and an active community. And it will probably be around for a long time. Glomation apparently doesn't want to sell me anything. I've emailed them twice for information with no response. Using a CPU board you can get at DigiKey would have it's advantages. I would prefer on board ethernet, but still...... I could use some eyeballs.

Regards
cww
 
W

William Sturm

Technologic or EMAC come to mind for embedded Linux boards at a reasonable price point.  Or just use a mini-ITX...

Bill Sturm
 
C
Nearing the end of what I can do for free, so I took some time out from hardware to look at software. Taking the Beagleboard as the default unless or until something more suitable comes along, I joined the community mailing list and _after_ reading the manuals, I mentioned what I want to do as the muxing and default pin setups were a bit confusing. There are people using the SPI ports and GPIO for similar tasks. The standard kernel SPI driver will work and there is a driver to access the port from userland (spidev) and the GPIO pins can be accessed through sysfs. It looks reasonably easy to do once you get in the zone. I think this will be the first pass approach as this should achieve <1mS scans with "normal" (Bonehead C tm.) programming. I need to look again to see if the expander chips actually need full duplex. I'm kinda eager to get a board and play, but it's not likely soon unless I hold a bake sale or something:^). Retaped both cards to use .150" pitch connectors and both pass the DFM check with the text on the silk layer. I'm gonna call Monday and find out if having it on the top copper is really a problem. I'll try to get some .pngs to Bill tonight or in the morning. The Beagleboard most commonly runs the Angstrom distribution of Linux which I have to investigate. If I get bored, I'll do an optoisolated input card.

Regards
cww
 
W

William Sturm

Curt says: "Nearing the end of what I can do for free, so I took some time out from hardware to look at software."

Curt, get some prices together and I'll try to help out...

Bill Sturm
 
C
Catching up a bit, I looked at the Sheeva stuff. This is ARM 7. I'm not sure if 7 has a MMU and would run a "standard" OS. I really want to run a standard OS as much as possible. The ARM path is one divergence, but it's necessary because the US is _years_ behind because everything has to run Windows. And even when shown the light with the netbook fad, consumers did an about face and regressed to something that will run Windows. Fortunately, running Linux, I can take advantage of the tremendous progress driven by the cellphome/netbook/mobile market and use an inexpensive, low power, high function CPU and use reasonable resources. The Sheeva is an early example of what can be done by leaving the MS mess behind. I can make an _extremely_ powerful, high function, PAC for the cost of a low end PLC. And it's extremely simple.

Regards
cww
 
C
Again catching up, the Beagleboard _does_ run Ubuntu. I would attempt for something a little lighter, but if it runs fast enough and the PLC process still approaches real time, Why Not?

Regards
cww
 
Ubuntu Server is somewhat lighter. Years ago I went down the path of making a lightweight distro but that was back when 256MB Disk On Chip devices were [relatively speaking] megabucks and you were lucky to find a board supporting Compact Flash. How the world has changed!

I think the bigger issue for automation is to make the distro mount the hard drive as Read only. Forutnately in Linux that is quite easy, and you can have a writeable partition as well for storing user files (such as programs to run). I wonder if someone has a distro for this type of thing just to make life easier?

I'm somewhat of an advocate of the Sheeva implementation because it seems like it will scale to a custom CPU in the future without a lot of pushups. I don't know if you could disect a plug computer, or possibly hack into the SD card slot to get at the SPI pins?

KEJR
 
C
There is a newer model called Guru Plug or something like that that exposes more ports and has an HDD.

Regards
cww
 
C
I thought I'd summarize what the system looks like so far for those that don't want to try to pick through the thread.

This is in essence, a do it yourself PLC, remote I/O, or all in one, automation kit. It will provide, with the SBC of your choice, a platform with PLC type I/O. Everything will be provided for you to procure, make and assemble locally, but I or someone will probably sell boards if that's easier.

The SBC is not a part of the project, This will allow any to be used that will fit in the space. The only requirement is that it be SPI capable. Depending on the intended application, it could be anything from a simple hardware state machine, a PIC, A BASIC Stamp, a Rabbit, on up to a full blown Linux Server class machine capable of running SCADA and web services, etc.,in addition to the logic process. Thus it can economically be a simple I/O rack for serial (CAN for example) or ethernet (ModbusTCP) or whatever else you might need, or a complete Industrial Computer system. I will be doing the development with a Linux SBC, because that's where my interest lies. I will publish the code for this, but for the others, you're on your own. I will do best effort on other SBCs if you supply what is necessary. I don't do Windows. My R&D budget is about $500, which I don't have right now. $200 for boards, $200 for a Beagleboard with the doodads needed to bring it up, and $100 for supplies and misc. That's probably low due to shipping, etc. Individual sets will be much cheaper with even qty. 10 because of part and board volume discounts. Budget for $2 a point for IO and whatever you want for the CPU. Analog TBD, but probably not much more. Just building a full set of cards will lower the cost per point quite a bit.


The hardware:

Backplane:
The backplane is extremely simple, basically a SPI bus and chip select lines and power for the cards. Since we aren't mandating a SBC, the SPI lines, chip selects and power will be wired to one end of the BP There are 8 slots in this version, each will accommodate one SPI slave device. Each slot has a hardware address feature for chips that support it and a hardware chip select for chips that don't. Any card will plug into any slot and acquire the address for that slot. The cards are attached with a standard 16 pin header receptacle. The slots are on 1" centers. +24V and GND are supplied to each slot through redundant pins 2 power, 2 GND, and fed by high current bussing. The current limit is around 15ADC average. CPU power will be provided by 2 locations for a three terminal regulator from the 24V bus. BP size is 1.5" X 8.5" with a full ground plane and provisions for bypass caps and termination resistors, if needed. All are OTS through hole devices. Power to be supplied by a single external OTS 24V power supply.

The card form factor is 3.5" high X 2.5" deep. All are connected to the backplane with a right angle .100" 2X8 16 way pin header.

Initial card types are:

16 24VDC sinking inputs (High = True) with a common ground. This card is extremely simple as well, with 16 voltage dividers, the MCP23S17 chip and a 78L05 local regulator to power the chip. There are 18 terminal pads on .150" (3.81mm) centers that will accept several types of modular terminals, both fixed and pluggable. They are +24VDC, GND, and the 16 inputs.

16 24VDC sourcing outputs (ON = 24V) with a common GND. This card is also extremely simple, with the same MCP23S17 chip, two Allegro UDN2981 driver chips, and a 78L05 regulator for the MCP chip. The Allegro drivers switch directly from the +24 bus and will source at least 120mADC continuously, all outputs on, and up to 350 mADC limited by the number of outputs on and thermal considerations. Again 18 .150" pitch terminals are provided for and they are +24V, GND, and the 16 outputs.

Together these give 128 points of digital IO. I have an isolated input card in the works and I can do a sinking output card and/or isolated output cards if there is interest. There are many SPI D/A and A/D chips available and these will form the basis for additional cards. The engineering is free, but offering to pay for the proto fab will get any of these done in short order. It's not much, much less than an analog card for what you are using now:^)

Mechanicals: TBD

Regards
cww
 
There is more than one type of "plug computer", and there are at least two different CPUs involved. For the most common one, standard Debian ARM seems to be the most recommended OS. However, they recommend that you use the "dev" version of the plug as that gives you a debug port.

 
C
I did a BOM for the cards with real numbers, I sent it to Bill but I will post it if I can figure out a way where the formatting is not destroyed. I will do one for the backplane tonight, when I can deal with the tedium. I found another very attractive board called a HawkBoard. While it isn't as fast as the BeagleBoard, it has a number of improvements from my perspective, like ethernet on board and VGA video rather than DVI-D. It also costs quite a bit less, like $89. The big problem is that it's very new and doesn't have anything like the community or community development that the BeagleBoard has. So the cost of a dev environment would be much less, but there could be much more work to get all the drivers. etc. working. But, software aside it's a better mix for a PLC. I guess that I'll have to stick to the old engineering axiom, "First make it work, then make it elegant". Software should port over easily once the early adopters do the heavy lifting:^). But if I have $89 and can't scrounge up another $60..................
http://www.hawkboard.org

Regards
cww
 
C
Here are the BOM with real numbers.
Sorry about the formatting, Windows is different than Linux and the rest of the world. I screwed up my config trying to match.


Input card:

$63.12 to get 3 proto boards. Advanced Circuits Bare Bones service. It's not much cheaper to get 1, $54.38
**********************************************
1 Board blank Advanced Circ. $21.04
1 78L05 regulator Jameco 51182 $ .25
1 Right angle male header Jameco 203967 $ .39
9 RA header Jameco 2094661 @.25 $ 2.25
9 Top Screw terminal Jameco 2094602 @ 65 $ 5.85
1 MCP23S17-E/SP Microchip.com $ 1.05
1 capacitor 50V .33 uF Jameco 138237 $ .14
2 capacitor 50V .1 uF Jameco 25523 @.08 $ .16
16 4.99k R 1% MF res.1/4W Digikey 4.99KXBK-ND $ 1.70
16 19.6k ohm " Digikey 19.6KXBK-ND $ 1.70

Total: $34.53

Output card:

Same card price as above

1 Board blank Advanced Circ. $21.04
1 Right angle male header Jameco 203967 $ .39
1 MCP23S17-E/SP Microchip.com $ 1.05
9 RA header Jameco 2094661 @.25 $ 2.25
9 Top Screw terminal Jameco 2094602 @.65 $ 5.85
1 capacitor mono 50V .33 uF Jameco 138237 $ .14
4 capacitor mono 50V .1 uF Jameco 25523 @.08 $ .32
2 UDN2981 driver Newark 31K7841 @1.95 $ 3.90
1 78L05 regulator Jameco 51182 $ .25
Total: $35.19


Backplane:

1 board blank Advanced $23.04
8 F header recept. Jameco [email protected] $ 6.80
4 capacitor mono 50V .1 uF Jameco 25523 @.08 $ .32
connectors and regulators for your app $ TBD
Total: $30.16

Note: the extra cost built into the R&D budget reflects the fact that some parts must be purchased in multiples especially the boards.

Regards
cww
 
The Beagleboard and the Hawkboard seem to be aimed at slightly different applications. The Beagleboard is more like an embedded PC replacement, while the Hawkboard is more of a traditional embedded design. The Beagleboard will run Debian ARM, while the Hawkboard requires a custom Linux image. The trade-off seems to be that the Hawkboard is cheaper, but would require more development effort, while the Beagleboard is cheaper, but can use many of the standard Debian ARM packages.

The Hawkboard might make a good communications interface board for the rack. You could write a Modbus/TCP server for it that would let it be used as remote I/O for PC or PLC applications. That would give you a complete working system relatively quickly that can act as a showcase for the hardware design. Turning it into a full fledged PLC could then be a follow-on project (possibly using a different CPU board).
 
C
The Beagleboard and the Hawkboard seem to be aimed at slightly different applications. The Beagleboard is more like an embedded PC replacement, while the Hawkboard is more of a traditional embedded design. The Beagleboard will run Debian ARM, while the Hawkboard requires a custom Linux image. The trade-off seems to be that the Hawkboard is cheaper, but would require more development effort, while the Beagleboard is cheaper, but can use many of the standard Debian ARM packages. <

Using something like Angstrom really doesn't trouble me because I don't, for what I need to do, need much more than an embedded distro. All I need is a working SPI driver, ethernet, and working toolchain. What troubles me is the "youth" of the Hawkboard community. Can I get the help I need?. Can I avoid "heavy duty" hacking? The whole point is to have a platform. Once the distro, kernel and drivers are stable, I can port my original PLC demo and self host for the small applications. Then we have the stone for the stone soup. This might be easier on the Beagleboard. The Beagle would also be better for "all in one" type stuff where the HP would be more important.

The Hawkboard might make a good communications interface board for the rack. You could write a Modbus/TCP server for it that would let it be used as remote I/O for PC or PLC applications. That would give you a complete working system relatively quickly that can act as a showcase for the hardware design. Turning it into a full fledged PLC could then be a follow-on project (possibly using a different CPU board). <

What I think should be in a PLC will fit on either. But, just by virtue of having on board ethernet, the Hawk is better suited for Linux automation. I can't see having dongles and the like on the factory floor. But doing it by myself, it would be nice if the Hawk were farther along. Mebbe we have some kernel hackers within the sound of my voice who will reassure me:^) I just want for it to be doable while I can commit the time. Then maybe I can get back to PLC tools. For now, I have boards ready for fab and I'm not sure how and when to release them.

Regards
cww
 
C
Here's another $90 contender, already set up as a network gateway. For the many folks that have wanted a web controlled PLC, this would do it with little effort. I need to look at this one a little more, but they've got a cool demo. And this board is available from DigiKey also. Would make a nice ModbusTCP slave at the least.

http://www.avrtv.com/2007/07/02/avrtv-special-003/

Regards
cww
 
Top