Senbrix is a compact PLC built on a Raspberry Pi. It is the same kind of controller that drives factory equipment, put together from a standard board and the .NET runtime instead of purpose-built hardware.
This post covers what Senbrix is and how far it currently runs. What we built to prove it out happens to be a beer-pouring arcade cabinet, so that project doubles as the evidence.
What goes into a single Senbrix project
A Senbrix project is made of three things.
Memory areas — the bit areas P and M, timers T, counters C, and the word area D. The sizes are set per project. In the arcade project, P and M are 32768 bits each, T and C are 2048 words each, and D is 4096 words.
Communication — the channel that connects to the system above. The channel named HMI링크
(HMI link) is a Modbus TCP slave: the HMI connects as master, reads the D area, and writes
commands.
Boards — nine slots. Expansion boards go into the slots, and each channel is mapped to a PLC address.
The CAN expansion board lineup
Expansion boards attach to the main unit over a CAN bus, so a single pair of wires can daisy-chain several of them.
| Board | Role | Where it is used in the cabinet |
|---|---|---|
| AD-4 | Analog input, 4 channels (16-bit) | Lever position, joystick X and Y, buttons |
| DA-4 | Analog output, 4 channels | Vibration motor strength |
| IO-8 | Digital input and output | Four arcade buttons, indicator lamps |
In the arcade project, the inputs of AD-4 #1 are mapped to D14 through D65, IO-8 #2 has its
inputs on P0 through P3 and its output on P4, and the output of DA-4 #3 sits on D17. Slots 4
through 9 are empty.
Addresses written as names — symbols and retain
Symbol addresses let you write BtnPlay instead of P0, and St30 instead of M33. A symbol can carry
a description and a path (its category), so the arcade project is organised into a tree:
게임기/블랙잭 (cabinet/blackjack), 게임기/게임로직 (cabinet/game logic), and
게임기/상태디코드 (cabinet/state decode).
Symbols with the retain flag turned on keep their value after power is cut. That is where the leaderboard records live.
Ladder and C# together
Sequence control and interlocks are written in ladder. Contacts show the symbol name directly,
and an expression can go straight into an output slot, as in
LeverPos = (LeverRaw - DeadBand) * 1000 / RawSpan.
The things that are awkward in ladder — shuffling a card deck, drawing a random fish species,
tallying a score — are written in C#. Ladder and C# look at the same memory and wake each
other with handshake bits. StartReq and GameInitDone, both marked C# → ladder in the symbol
table, are exactly those signals.
In the arcade project the ladder is split into 18 sections, and the C# is split per game.
Why we validated the compact PLC on an arcade cabinet
Validating a PLC becomes the question the moment one is built: what do you validate it on? Putting it into real equipment is the most accurate answer, and also the riskiest one with the fewest chances to try.
So we built an arcade cabinet instead. In some respects a game is more demanding than a machine.
- Real time — a person works it by hand and watches it with their eyes, so any lag is felt immediately
- Analog — the beer has to rise in proportion to how far the lever is pulled. On/off will not do it
- Several I/O types at once — analog input and output, digital I/O, and communication all run in one program
- Long runs — a game repeats endlessly. Leave it powered for days and cumulative faults surface
Running four games — beer pouring, blackjack, a shooter, and fishing — out of a single project took the place of that equipment test. The whole build is written up in a seven-part series on the beer game cabinet.
Along the way we caught real problems: the non-linearity of the analog output, the screen stutter that the communication update interval produced, and the move of the entire address map after the expansion board address space ran short. Without the cabinet, those are problems we would have met on a customer’s site.
Where it stands now — working and still open
The arcade cabinet has been powered on for days and all four games run. Above it, Senvas Touch is connected as the HMI over Modbus TCP.
Some things are still open. The IO-8 relay outputs are not switching, so the indicator lamps never came on, and the measured curve of the DA-4 analog output is badly non-linear, so we are using only a narrow part of its range. In both cases we have narrowed the problem down to a cause, as recorded in the series.
Running four games out of one project surfaced, ahead of time, the problems we would otherwise have met on a customer’s site.
Contact
- Email: [email protected]
- Instagram: https://www.instagram.com/going.sen/
- Website: https://intosen.com/kr/consult/
Comments
Enter a nickname to leave a comment, or sign in with Google or GitHub.