Skip to main content

dsPIC MIAC PLC Manages Emergency Power

By Pete Smart - Flowcode & MIAC user from Sydney, Australia

The MIAC is a fully specified industrial electronic controller, designed to operate with typical industrial control voltages: 0-10V inputs, up to 24V 2.5A solid state outputs and 240V 8A switching relays. A MIAC gives you the ruggedness and power of a Programmable Logic Controller with the flexibility and ease of programming with versions to suit every programming environment from scripting to C++. Uniquely positioned, the MIAC bridges the gap between the worlds of development boards and professional applications.

 

From left to right: the original 8-bit PIC MIAC now with black keypad, the Arduino compatible MIAC with blue keypad, the 16-bit dsPIC MIAC with orange keypad and the Raspberry Pi MIAC with pink keypad.

The motivation for this project was driven by continual loss of mains power at my home office. I live on a rural property just on the outskirts of Sydney. Frequently through storms, trees drop branches and the transmission lines get damaged. As you can imagine trying to run a business from an office with no power or communications is not conducive to great customer service!

The solution was to provide an independent source of mains power. A Kubota industrial generator was chosen due to its reliability and affordability. The generator is well rated at 100 A per phase and is driven by a diesel 3.3 L engine, providing power to my office, machine shop, the house.

Whilst mechanically and electrically sound, the Kubota generator has very limited control systems and has been specifically designed for manual worksite operation. In its off-the-shelf configuration you manually have to turn the ignition key to on, then switch on the glow plugs, then hit start. Once the engine is running, you then have to manually connect to the house mains.

An automated solution was obviously required; and the MIAC plays an important role. In this project MIAC automates a number of key tasks:

  • mains sensing – detects mains failure
  • engine start sequence
  • engine management – engine health and fault management
  • mains/generator power transfer switch
  • engine cool down – allowing the engine to cool down gracefully after being on load

With the added communications features to the new 16-bit dsPIC MIAC, MIAC is now a solid competitor to the traditional industrial based PLCs’ I can safely say this as deal with very large essential power systems on a daily basis – 2 MW above!

MIAC controlling the Kubota Generator

As you can see by the attached photo, MIAC was physically mounted on the generator unit, which was done to minimise the volume of remote cabling as MIAC interfaces to numerous points on the generator. The balance of the cabling comes from the mains transfer switch which is located near the main switchboard. Power for MIAC is sourced from the generator battery, which is continually float charged and monitored by the MIAC.

Mains Transfer Switch

 

The program was initially created in Flowcode v6 using MIAC V1. Structurally the code was built in 2 main streams supported by 25+ macros and the MIAC component. An interrupted routine was used to monitor mains and engine parameters on a 500ms cycle whilst the tasks were managed in the main program loop driven by data collected from the interrupt cycle. The keypad and display are used to switch between auto and manual with the display providing real-time status information of system performance.

A number of fault tolerant management scenarios were implemented in the MIAC code. Given that this engine does not have a crankcase heater, glow plugs are used to warm the cylinder head prior to start – cold diesel engines don’t start reliably! MIAC will sense if the engine does not start the 1st time, following up with 2 additional start sequences. In the event that the engine does not start on the 3rd attempt, MIAC will lockout any future start attempts on the assumption that the engine has a fault blocking successful start. MIAC will only allow restart after pressing the reset button – this provides an opportunity for the operator to read any error messages displayed on MIAC’s LCD.

After a year of operation, the program was successfully transferred to Flowcode 7 and dsPIC (Wi-Fi) version of MIAC. Not only does the new dsPIC MIAC version provide more memory and horsepower, it is packed with a whole bunch of new features that provides an opportunity to further automate energy management.

Recently I acquired a Crompton 1630 energy monitoring unit. This is a digital metering system which is used in industrial/commercial facilities. Using the MIAC native RS – 485 communications function, dsPIC MIAC now communicates directly with the Crompton 1630 device monitoring parameters such as kilowatt-hours used, frequency, mains voltage, mains current, power factor and total harmonic distortion. Interestingly most of these devices use an IEEE – 754 data format. Using the very powerful Flowcode 7 component creation, I created separate components for the Crompton 1630 device and the IEEE 754 data conversion process. These parameters will feed into the overall generator management system providing information to assist with a more accurate, and hopefully pre-emptive fault management.

dsPIC MIAC talking to the Crompton 1630 via RS-485

 

I have had much interest in in the project from several local businesses and farmers in the area – most of the gentleman who I’ve demonstrated the project to leave with a large dose of generator envy!

Based on the levels of interest I am working (in my limited spare time) on the next stages of development leveraging the new features of dsPIC MIAC. The short list of features currently planned:

  • Integration of Wi-Fi – this will allow monitoring of generator system status via an IOT website, for example Thingspeak
  • Remote start of the generator via mobile phone application or web interface – this is important as my area receives a large number of lightning strikes due to the amount of ironstone in the ground. By starting the generator and getting off the mains you limit the amount of damage to household appliances from lightning strike.
  • Parameter logging of the generator engine statistics to facilitate proactive maintenance
  • Electronic frequency and voltage management
  • Energy system management, using a combination of solar, battery, generator and mains to manage the traditional energy bill.

To find out more about the MIAC range and to buy your MIAC controller today, visit www.matrixtsl.com/miac. Or to find out more about Flowcode, you can pruchase from the RS website.