Skip to main content

Building a Rotary Inverter Controller with a Barth lococube mini-PLC Part 3: Final Assembly & Test

Rotary Inverter Controller with a Barth lococube mini-PLC Part - Fully Assembled

Finalising the controls & enclosure assembly, completing the wiring and undertaking an exciting first test.

In part 2 we looked at what controls we would be using to command the rotary inverter, designed a constant current supply to run the field coils and mocked up the front panel. In this post we will be finalising the front panel layout, producing the enclosure, wiring all the controls and doing the all-important first run.

Finalising the Controls Layout

Finalising the Controls Layout

Having mocked up an initial layout that we were happy with in part two, a decision was made to modify the design to include some additional controls. For a quick indication of generator output phases, we added three neon indicators (237-0430) and opted to replace what was originally the three-phase output connector (relocated to the back panel) with one that would be for an external emergency stop loop.

We agreed on the size of the panel by placing all the components on a sheet of MDF with sufficient spacing in between, then tracing around them to get a rough estimate of size. Having the components to hand is very helpful for getting a good feel of sizing — accurate 3D models of components might be available, but sometimes this doesn’t help!

Wiring to the front panel takes more space than expected

It is also worth noting that wire will take up more space than you think, again reinforcing the point above about 3D models being deceptive. As the inverter has a nameplate rating of 55A at 28VDC we opted to use 16mm² wire (this might be veering off in the direction of overkill) that has a relatively large bend radius, meaning lots of space needs to be left to form the cable into shape.

Enclosure Assembly

With all the dimensions confirmed the aluminium panels were sent off to be laser cut. The rest of the enclosure is constructed from a 20mm square aluminium profile (850-8470) and acrylic panels to keep the rotary inverter visible but also provide some protection — especially important given the speeds that the motor spins at.

As we were uncertain of initial component placement we designed the panels with no holes for fasteners to hold everything together. Hole centres were marked up using an engineer’s square, scribe and then centre punched ready for drilling. Once drilled the edges were deburred using a countersink (508-8982) — not only to avoid sharp edges that could cause cuts but also to ensure that the head of the fasteners will sit flat against the panel.

Two lengths of DIN rail were also mounted inside the enclosure as some components could not be mounted any other way and for ease of using things such as terminals to distribute power and signals.

Wiring

Wiring Plan

Given a suitable layout for the components had been determined, a wiring plan was then started. As highlighted in our previous project planning to wire is incredibly important and can save a lot of headaches and frustration further down the line. 

We planned out every connection that would need to be made, but as is par for the course this changed when we actually started the wiring. Some connections were removed, some rerouted and additional ones were made to connect components we didn’t initially expect to need — such as a DIN rail mounted relay that cuts the input contactor power when the emergency stop circuit is broken.

Complete wiring and assembly

With all the wiring in place, checks were made to verify each connection was made according to the wiring plan, that all connections were tight and that there were no shorts between any of the supply rails. The moment of truth was then applying mains power to the system, which was thankfully uneventful as expected — all the front panel meters illuminated, the two PLCs came online and a 36V supply was present at the input of the current source.

Control Logic

Now that we had completed all the wiring and the system passed the first smoke test, we began to devise the control logic. Theory of operation was discussed in part two, but we realised some changes would need to be made — for example, when starting the rotary inverter the generator field also needs to be turned on slightly so that an output voltage is generated, which enables the panel meters to then close the feedback loop.

The program logic now follows the steps below:

  1. Apply motor field current
  2. Apply some generator field current
  3. Apply motor armature current
  4. Regulate generator output frequency by varying motor field current
  5. Regulate generator output voltage by varying generator field current
  6. Close output contactor when requested, if the output is valid (115VAC, 400Hz regulation achieved)

As we are using two PLCs to achieve control we designated the motor control PLC the “main” and the generator control PLC the “secondary” — the main PLC handles starting the system and retains overall control over the system, and outputs an enable signal to the secondary PLC which then regulates the output voltage.

The programming language chosen was the Barth-provided “miCon-L” graphical environment, which should feel familiar to anyone who has used other graphical programming tools before.

Using the Barth “miCon-L graphical programming environment

Within the programming environment, the interface is well laid out and easy-to-understand but does have some interesting quirks — program blocks from the “Libraries” pane on the right-hand side are dragged from the visible block at the top, rather than from the list item.

Programming blocks for overspeed control and system logic

With this in mind, the control system was built up, starting with the enable and emergency stop logic. Again, following what seemed like a logical order of inputs on the left and outputs to the right helps keep things clean — this also helps a lot during debugging with following the program flow!

Programming block for PID controller

A block is also provided that implements a PID controller, which we used two of — one on the motor PLC for output frequency regulation, and one on the generator PLC for output voltage regulation. We struggled to figure out the PID control block for a while before finding this forum post which detailed how to use the block; an external error signal has to be generated, in our case by taking the frequency input and subtracting 400.

simulating the system behaviour

As all the logic has been implemented, we moved onto simulating the system behaviour before testing on real hardware. Conveniently the miCon-L environment has a built-in simulator that allows for inputs to be simulated and outputs to be monitored. This is incredibly important to do first as we could easily overheat and damage the motor — or even worse overspeed the inverter and potentially have it fly apart. 

simulating the system behaviour showing inputs and outputs being monitored

With both motor and generator PLC logic implemented and simulated, we moved on to testing with the real hardware. The first step was to program both PLCs, and then we moved on to system testing without any armature power — this is to verify the operation of the logic and that all the inputs and outputs are connected correctly.

The operational status of the PLC can also be observed from the miCon-L software, with inputs and outputs reflected in real-time. Program parameters can also be updated without having to stop execution and then reprogram — incredibly useful for tuning things like PID loops or control values. In our case, we have two PID loops to tune and a number of other parameters to tweak, such as startup field currents.

a “Trend-Writer” block which is input over time much like an oscilloscope

Other useful tools for representing values are also provided, such as a “Trend-Writer” block which is input over time much like an oscilloscope. We added two of these to display the generator frequency and the control voltage that commands field current, to aid in debugging.

Testing

With the program now verified on the real hardware, we opted to go for it and connect the high current 28V power supply that my colleague built here.

We were very anxious about this first test as the power supply is more than happy to deliver 80+A should something go wrong, the rotary inverter is of a somewhat unknown condition, and we don’t have much information on how to control it “correctly” (we made best guesses based on my experimentation with controlling the large “sepex” DC brushed motor on my go-kart).

The first in a battery of tests conducted accelerated the motor at a terrifying rate, eventually generating well over 450Hz on the output which tripped the overspeed safety and disconnected all power to the inverter — this was under PID loop control so evidently, the control loop needed more tuning. We then ran this a few more times with various different parameters which didn’t seem to have a great deal of effect.

Testing - Graph showing result of a 2V Field control current

Testing - Graph showing result of a 4V Field control currentWe tried two last tests involving manually setting a lower and higher motor field current — the purpose of this was to confirm that changing the field current affected the motor speed as we expected it to, with a higher field current causing the motor to accelerate quicker at first but then run slower and vice versa. The two graphs above illustrate how changing the field current affects the acceleration of the inverter.

Further investigation will need to be done to find out more about how to correctly control the field windings so we can fully regulate the output voltage and frequency, and then more PID loop tuning to ensure the output is stable.

Video of testing.

To Wrap Up

This has been a fun project to work on, involving a rather exciting mix of high currents with lots of opportunities for things to fly apart (and lots of lovely vintage electronics smells). The flexibility and ease-of-programming of the Barth lococube STG-820 PLCs has meant that we could quickly experiment and see how changing parameters affects the operation of the rotary inverter. 

We’re going to do some more research into how to properly control the rotary inverter with an aim to get the output regulated and usable for running other projects, given we now have a solid hardware platform that we can build an appropriate software control scheme on top of.

Other parts to this series on building a rotary inverter controller with a Barth lococube mini-PLC, include Part 1 - The Controls and Part 2 - The Assembly.

Engineer of mechanical and electronic things by day, and a designer of rather amusing, rather terrible electric "vehicles" by night.
DesignSpark Electrical Logolinkedin