Shop OBEX P1 Docs P2 Docs Learn Events
Yet another controller board — Parallax Forums

Yet another controller board

I'm currently designing a replacement for one of my old P1 based controller boards:

The new one will have similar size and features but with a nicer case instead of an open PCB. I plan to use this DIN rail enclosure. The primary application is CNC control but it will also be suitable for general PLC and motion control. I'll use it for controlling my flight simulator, for example.

Feature wish list:

  • 6 axes step/dir interface (optionally 9 axes)
  • alternatively 6 ports for high speed RS422 communication (smart abs, SPI, BISS...)
  • 18 general purpose 24V inputs (sensors, switches)
  • 12 general purpose 24V outputs (solenoids, relays)
  • 2 analogue outputs 0..10V
  • 2 analogue inputs +/-10V
  • 2 PWM outputs 5V
  • 1 incremental encoder input (A/B/Z)
  • 24V supply
  • 100Mbps Ethernet (UDP, IP or custom protocol)
  • 128x64 OLED display for status and diagnosis

The controller will have two stacked PCBs. The main board at the bottom will hold the P2 and the 24V IOs. The upper board is for the Ethernet, encoder and axis ports. The upper board can be modified to fit special needs in the case customers request it. For example I could add more IOs or more axes by multiplexing some of the slower signals to save P2 pins.

The CNC controller will be a commercial product running proprietary code that I won't disclose. But if the hardware turns out to look interesting for somebody else's project I might sell the boards for the production cost and provide some sort of "skeleton" code to handle the IOs. If required the upper board could even be replaced with a patch field / breakout board for custom circuits. Not as versatile as the P2 EVAL board but better suited to industrial applications.

Comments

  • ErNaErNa Posts: 1,851

    very nice!

  • Layout of the main board finished.

    My friend Ingolf: "The board is almost empty. You should add some more features."
    Mariss: "I hate the color of green." :D
    My excuse: "The enclosure dictates the board size."

  • ErNaErNa Posts: 1,851

    If there is a free pin, you may add a microphone to program the plc verbally

  • Amazing PCB layout work.
    Question: how do you protect the 24 VDC output power from random noise, voltage spikes, RF coupling, and all the rest ?
    Follow on: how are the input I/O control lines protected, buffered and filtered ?
    and how are the output I/O signals amplified and protected ? TIA...

  • I'm not sure what you mean with "24 VDC output power". Outputs are short circuit protected and have an internal voltage clamp so that they can directly drive inductive loads like solenoids or relays without getting damaged by voltage spikes. I use automotive lamp drivers (VNQ860) that already have full protection built in (overheat, overcurrent, reverse voltage).

    For the inputs I use a special circuit that is effectively a constant current sink combined with an RC low pass filter and schmitt trigger. It takes any voltage from 5 to 60V as high and everything <5V as low with a reaction time of ~1ms. Proximity sensors can be used without shielded cables.

  • Yesterday, I assembled the PCBs.


    Those FFC cables save a bit of money, space and weight but I don't like the assembly at all. I'm always scared to break something and never sure if the connectors are tight and locked.

    The cutouts for the upper board and the OLED display are still missing.

  • JonnyMacJonnyMac Posts: 9,709

    Wow. Very nice!

  • Very nice! those DIN rail enclosures are great for that. what brand is yours. I'd only seen ones with dividers in not-always-great positions, would prefer what you have with one wide open slot top and bottom.

  • The link to the enclosure manufacturer is in post #1. The BRT-80005-A1 has slots for the green terminals on both sides while the -A3 version has no cutouts. There is a transparent acrylic cover on the top side but it's of bad quality (unequal thickness causes distortions and rainbow reflexions). I will replace that with a custom made front panel. The inner board fixtures (see drawing) are also quit sub-optimal for my case. Standard M3 spacer posts also don't fit into the screw holes but that can be fixed with little effort.

    BAHAR offer customization to their enclosures like laser cutting and screen printing but I like to keep the enclosure itself standard and rather add customized panels which can easily be exchanged for different variants of the PCBs if customers requirements change.

  • ManAtWorkManAtWork Posts: 2,317
    edited 2026-02-21 16:25

    Today, I've machined the top cover.

    I've made some mistakes regarding the measurements of the enclosure. It's not exactly a rectangular box but has a slightly truncated pyramid shape to help extracting it from the injection mould. This means it gets narrower towards the top and the upper PCB doesn't fit exactly. I also have to move the display slightly inbound.

  • RaymanRayman Posts: 16,100

    Nice . I’m starting to like rj45 for connecting things too.

    Guess got the idea from @refaQtor …

  • I use RJ45 cables since 2006 for almost everything where up to 4 twisted pairs are sufficient:

    • Ethernet
    • MODBUS
    • Step/Dir signals
    • ABZ incremental encoder
    • RS485 absolute encoder (Smart Abs)
  • MicksterMickster Posts: 2,906

    Here's a RJ45 vibration test:

  • I use many, many RJ45 connectors since ~20 years in hundreds of machines and never had a single problem that could not be explained by excessive abuse, except...

    • during Covid I was forced to buy from dubious sorces and got a bad batch of ~100 connectors which had problems with intermittent contact failures
    • unprotected RJ45 connectors are sensitive to chips or dust. Solution: use Neutrik NE8xxx (XLR-style) housings to protect them (as mentioned in the test report above)
    • the locking tabs of the patch cables of my test equipment which are plugged and unpluged very often fail once every year or so. Solutuion: replace them when worn out
  • MicksterMickster Posts: 2,906

    I just had that broken tab thing on a Beckhoff system. They reported intermittent problems. It looked like someone had broken the tab but shoved the connector in anyway.

    Puny components and fat-fingered maintenance people = not good.

    "Industry needs Mack trucks, not Ferraris" - Dick Morley "father of the PLC"

  • ManAtWorkManAtWork Posts: 2,317
    edited 2026-03-03 08:55

    The first smoke test was successful. No smoke, the voltage regulators work as expected, digital IO and display are OK.

    Next items to check: Ethernet, step/dir signals and encoder input.

    The layout needed some corrections: I forgot some pullup/pulldown resistors, outline needs to be some 0.1mm smaller

  • These oled displays burn out pretty quick. Do you cater for this like for example it's on when it's needed and (mostly) off at all other times ? The more I think about this controller the more I want it despite the fact that I don't actually need it for anything in particular. No smoke is only good when no smoke is expected :smile: .

  • The OLED display is rated for 10,000h life time @25°C and full brightness and 50,000h at half brightness. That's not much for industrial use and I guess it gets worse at higher temperature.

    The display is not really needed except for diagnosis during installation. All I need is to display if the Ethernet link status is OK. If a hidden button is pressed with a pin a diagnosis mode is entered where the state of the inputs and outputs are displayed. If you press the button longer a special pairing mode is activated where the controller responds to broadcasts over ethernet so that the IP address can be set. The display acknowledges if everything went OK. After the connection is established everything can be viewed from the PC even with the display hidden or inoperative.

    But thanks for the hint. I think I'll implement a "screen saver" which dims the display after some seconds if nothing changes.

  • But I like those little displays. They don't cost much and are a nice eye-catcher. And for the support it's much easier to ask "do you see an OK-symbol" than "is the green LED at the RJ45 connector lit permanently and the yellow one is flashing?" Error messages can be displayed in plain text instead of "the second red LED flashes twice per second?".

  • BTW, I've found a note in the manual about "burn-in" vs. "image sticking".

    8.4 How to Fix the Image Sticking?
    Unlike the usually irreversible “burn-in” effects commonly associated with direct view phosphor display devices such as
    CRTs, an image retained on an OLED display can be reversed – often to a point of total invisibility. However, the severity of the
    underlying causes (as described above) of the image retained on a specific display, as well as the variation factors (see “For
    Software Developers” above) under which the retained image was created, will dictate the final level of retention reversal.
    One way to erase a retained image on a panel is to run the screen (monitor “on”) in an “all black” pattern for 4-6 hours.
    It is also helpful to do this in an elevated temperature environment of approximately 35º to 50ºC. Again, utilizing a dynamic
    screen saver with an all black background during prolonged idle display periods is a good way to avoid image retention
    issues.

    So it's no real "burn-in" but should be reversible and a svreen saver should fix it.

  • evanhevanh Posts: 17,095

    That was the same on CRTs and Plasmas too. Permanent burn-in is very long term. It's basically unequal ageing from unequal use of pixels. Even the fancy "Quantum Dot" LCDs are heavily using phosphors now too. If you want rich high contrast colour and wide viewing angles then phosphors are it.

    OLEDs seem to be very similar behaving to phosphors. I don't know anything about the chemistry but I wouldn't be at all surprised if the two are related here.

  • The contrast register in the OLED controller IC controls the LED current. It can be set from 0 to 255 and was already at the default of 127 which means half brightness and 50,000h expected lifetime. Thats 5.7 years at 25°C. The sensitivity of the human eye is logarithmic. Full brightness is only required in direct sunlight. 1/4 brightness is totally OK indoors and even contrast=1 is still visible. So with a screen saver that dims from contrast=127 down to 32 the display should survive the warranty period of 2 years even at 45°C.

  • evanhevanh Posts: 17,095

    The huge pure LED signage boards won't be immune either. They will be using lighting type LEDs - and lighting LEDs are all native blue only. So they also need phosphors to tune their colours.

  • The schematics needed some small fixes. A series resistor to make an input 5V tolerant was too small. The current injected into the body diode caused two neighbouring DAC pins to fail completely (luckily not irreversibly). They saturated to 3.6V and 0V regardless of the DAC value. I changed the series resistor to a voltage divider to fix this.

    The encoder input, the Ethernet interface and the step/dir outputs are also working, now. :) And I've implemented the screen saver.

Sign In or Register to comment.