PLC – Vibration concerns

Looking at my CCU board I have 4 components that are of concern related to vibrations! Top-Left I have a USB connector, but this is for development only so it will not be mounted in production. Top-Right I have DC/DC and connectors that might need support. And in the midle I have done a mistake as I added an old 32Khz crystal for RTC just because I had it in numbers – this is a hole through and the body/legs will be exposed – this I will replace with a SMD component. As for the connector and DC/DC I might need to add glue or supporting mass as I expect that long term exposure to vibration might cause issues.

The next question is if I can use a large speaker and create my own test bench for vibrations?

Problems and solutions

In my last entry I wrote about challenges with sizes on opto-couplers. I have since discovered  isolated digital IO modules with twice the density compared to opto couplers. They also offer 100Mbps speed and bi-directional solutions.

I recently used a version of this motor/gear with a Nema17 tor run the wheel on my mobile CNC machines and while it works fine it creates a problem : sound!

The printed plastic parts are hollow and a stepper motor vibrate a lot as it steps. This creates an unexpected load sound. The solution is a classic DC motor with an encoder (above) – I hope. Either that or see if I can mount some sound isolaters on the Nema17. I like the DC brush onces above thought because they are also smaller and more cost effective, the issue is if I have sufficient control of movement as with a Nema17. We will see.

Annoying Issue

One repetive issue I face is number of signals from MCU to/from IO that can be isolated. The the case below I want 7 digital signals and an isolated current sensor back, but I lack space for the 7th signal since one module is 25mm in width. One solution is to mount components on the back side, but I prefer to avoid that for a specific reason. Another solution is to make the isolation barrier different or simply ditch one of the signals… I am looking for opto couplers that use less width as well…

Mobile PLC – CCU

CCU (Central Control Unit) is the name I give units that contain the core “brain” and only communication IO. The module below is an example of the core of a CCU with 3 external CAN ports, 8 internal module ports and 2 external Links. This is a fast MCU with a decent amount of speed, SRAM and Flash + it has it’s own SPI Flash + a USB for debug only. The CAN ports are standard M12-5 A Code and wired according to a de-factor standard. These will be used for CAN and for RS485. Possible I can use B or D-code for RS485.

Links can be used for modules as well, but they are designed to be links to different CCU’s allowing them to be connected in series to extend the CCU or linked up as a redundant unit. The unit above takes 5V in, so it is dependant on a 24V PSU unit.

The board above can be used alone or connected to a range of IO modules with different capabilities to form a larger CCU or even a ECU (Electronic Control Unit). A system will usually have one CCU and multiple ECU’s, actuators and sensors. As a rule we use CAN on everything and only RS485 or Ethernet as an exception. We can also use RS232 and other techniques as needed.

Each module is 70x25mm in size. The CPU module occupy 3 slots and each module can occupy as many slots as needed + they can double length to 140mm or even larger with special cabinets. The core is small project boxes that can be filled with modules as per need to form a custom PLC.

I use the term “PLC” because a modern PLC is mostly the same as above with specialized SW. My PLC languages will include C++, C#, Rust and Python + it will be supported by BSA. In reality I will be coding drivers in C++ and logic in PLD, but that is my choises – it should not limit you. The objctives is small size, plug and play and low development cost. In short you pay a few bucks for a few HW units, connect them together and will be up running in no time with a prototype or completed project.

This block diagram illustrate a CCU. A minimal CCU is only PSU + CPU module with 3 x CAN. A maximized box can contain up to 8 modules and as the MCU itself can act as a module it is basically no limit on how much you can put into a box.

CCU – Central Control Unit. Basically system level logic and communication.

ECU – Electronic Control Unit. Basically a box with a CAN connected to a CCU controlling electronics directly.

Servo Position Feedback

As we move a servo it would be more than nice to have a position feedback! The servo itself have a potentiometer telling the absolute position, but a standard Servo only have a 3 pin interface Power and Position setting – it gives no feedback. This is a common issue with many available actuators – lack of feedback.

In my case I want to use a power servo to turn four wheels and without position feedback I will be part blind as I drive. Or am I? I do not have the actuator position, but I have current feedback and know that high current usage is an error situation. Secondly I have GPS, accelerometers, magnetometers that will tell me if the vehicle is moving as expected then I drive.

That said – I am considering adding position feedback on the steering as well, but I will return to that later.

BSA Power Servo

Creating a module that can control a PowerServo is fine, but what about using it from BSA? What do we need to do? From a user perspective very little. In this example I just created a PLD State Diagram block with 3 input methods and one output method. It is this simple once the underlaying library is set up. It is simple and fast.

Comparing to some classic PLC systems BSA is a dream to work with in development speed, but BSA target far more than these old systems as well.

The only limitation in this case has to do with the servo – normal servoes allows you to set a position, but they give no feedback as to what the actual position is. You do however get the current usage as feedback and we know that if current usage is high it means the servo struggle to reach or hold the set position – this is thanks to the added current sensor on the servo modul.

In a final version we just add the servo modul as a library component that will pop up at left as if it was a build in tool. As we code we will drag lets say 4 servoes into a diagram and code their behaviour. As we deploy the code we need to associate those 4 servo blocks with physical servoes in the config. The servo modules will pop up as unallocated resources and we just need to tell the system what component they are in our diagram. The rest is magic plug & play.

PLC Power Servo

I am quite found of using 60 to 150Kg Servo units, but driving those units is an issue as I need a RF Signal and a 12V PSU capable of 5A. The example board below contains a separate DC/DC so I can deliver 8V and 12V with a single cable for those larger servo’es – it also contains an on/off switch and current sensor so I can monitor how they behave.

As always in this new series of modules – full galvanic isolation. The picture below (borrowed from AliExpress) show  typical target servo. These are a bit difficult to drive if you have several of them as a they use a bit of current and the worst one is as you switch power on. With the driver board above I can create a start sequence and monitor their power usage. The module can be used on smaller Servo’s needing 5V as well.

PLC Main Module

The “Main” or Central Computer if you like is basically a large MCU with 3 x CAN ports and 10 x Modul links. It only need a 5V PSU and can be used stand-alone or combined with other modules to form a larger entity. The central computer controls the entire system of both internal and external units. This board is a big waste land as the modul size dictate the actual size. I might add more to this board later.

The 10 connectors at right are communication links to modules and to an redundant unit if redundancy is required.

PLC Power Modul

This is the 24V power modul. It uses a 3rd party isolated DC/DC to support 24V “as is” and 5V isolated. It has protective diodes and capacitance for the 24V side. I could have needed more connectors for power distribution, but these boards are very small. As this is a PLC design we use. This should work on 12-24V and should be fine on the 18V batteries I use.

The remaining challenge is that the next modul is a Power Servo that require 8V or 12V depending on model. Even small, miniature Servo’s are a pain to switch on so these bigs ones will be a real issue. Learning from experience I believe it is wise to have a On/Off on the power to each servo as well as a current sensor and monitoring – which means I need to involve a MCU to do power management. This is all doable, but it add complexity/size.

The Power Modul above is the same as on the top, but without the isolated modul and with less internal power connectors. I can replace the Waterproof connector with an internal connector on 24V and adjust voltage out from 5 to 22V with 5A in peak, continious current. The DC/DC have a on/off switch, so all I need is to add a current sensor and an internal connector to a MCU board monitoring the PSU. This was a quick draft, so the modul is not ready. One issue here is that I use the same connectors for multiple things – that is OK’ich as we use TTL (5V), but it is very bad then we mix 5V, 8V, 12V and 24V – så I need to deal with that by using different connectors that cannot be intermixed by accident.

Protecting PSU’s from Motors are a big issue. I believe that the best protection is if the PSU have a fast, analogue trip that disconnect the PSU on over-voltage and -current. I can do thos in SW, but in this case I would like a analogue HW trip that need to be switched back on by SW. SW will be to slow for switching off. A misbehaving motor controller will typically trip and release the motor causing a break that release energy back on the 24V. This often result in a pulse that can break a few things. The PSU itself is the worst because as currend drop from xx to 0 it jump up in Voltage and uses a few “cycles” before it regulate it’s output at the same time as the Motor or coils misbehave. This needs to b experimental, but I think it will make the system safer.