Text Box: Afrikaans

To contact us:

Mobile: +27 82 510 2875

E-mail: sales@CountryAuto.co.za

CAF301`s History

I thought it would be interesting to share my experiences and development history of the CAF301 AMF controller.

I am a mainframe/PC programmer at one of the South African government departments with a lot of electrical background not so much in electronics.

My dad, the owner of the Company, one of his customers had a problem with his standby generator that failed to operate after an electrical storm. The customer thought it to be the small box containing mostly relays. After investigation the problem was traced to the controller in the switch panel. Nothing I could do to fix that. The customer mentioned the prices of the various components and I must admit it sounded cheaper to replace the whole standby generator and that was only for a manually (base load) operated version. To make it automatic would have cost them another few thousand bucks (SA currency). A few months later a colleague mentioned something about PIC processors. I searched the web and ended on the Microchip web site. Downloaded a few of the CPU specifications read through some of them and the ideas started piling up. Number one on the list was a module to operate/control a standby generator. I had to go through quite a learning curve but soon mastered using the IDE and programming the CPU. Soon things started happening, but seen as a pet project it took a long time to develop with a lot of mind and idea changes.

I added a few links to photos taken during the development process.

 

As with any project it started of with a sketch made on paper. The paper version later ended up on a design (Vero) board. Fig1. Then hours and hours of testing debugging and mind changes. Lucky a mind change or a bug fix is fairly cheep and easy to accommodate without doing any hardware changes. There were some hardware changes involved in some of the ideas involved but was limited. A lot of the testing involved simulating various inputs Fig2 and of course some real inputs Fig3. but the proof is when you do it for real. Al I had is a single phase 1.5KW generator. It proved to be sufficient to point out a few minor problems. Fig4. Testing it on a 3 Phase generator was a bit more challenging. I first had to find someone willing to allow me to conduct testing using their R100 thousand rand equipment. The same customer allowed me to use his machine and testing revealed a few subtle bugs.

As a software developer at some stage in your code you reach a point where you do not like what you see. Jip, that resulted in a great deal of code rework but in the end it was all for the best. After fixing the problems it was time to test 3 Phase again. What is a design cycle with out a proper mishap. Fig5. Luckily I did not incur any electrical shock or injury but the board was fairly damaged. The regulator and CPU were the most expensive components destroyed. Life goes on, used some household cleaning detergent to clean the board. The tracks was still in a useable state, thus a few component changes and I was back in the game. On the positive side it did reveal a potential damaging situation that arise if the CPU is trashed, the design was adjusted to prevent/limit any further damage incase of a CPU failure. In total I trashed 3 CPUs during the course of development.

I did how ever reverted to safer very much lower voltage option. How? That was easy, for those who don not know it, a vehicle alternator is also a 3 Phase power generator you just have to spin it a little faster. I used a Delco Remy 30SI alternator for it is easy to gain access to the stator windings to which I had to tap into.

Designing a PC board I concluded is an art of its own. The first board Fig6. was a double sided board, what a mistake. It looks nice and solves a lot of trace crossing issues but that is where it stops. It is expensive and difficult to solder the IC pins, basically any top layer component. Version 2 of the PC board had only bottom layer traces, it took a lot of thinking and trace rerouting but it was worth it. There were cases where the trace routing became a problem, but re-assigning functions to ports eased the pain and the code was amended accordingly. I am so glad we have compilers.

Although the initial design was made using a PIC16F877A CPU I started using the PIC16F887 CPU it had all the required features and is about R20 cheaper.

My biggest challenge was to figure out a way to determine the phase rotation/phase sequence in a 3 Phase setup using a PIC processor or any micro processor for that matter. All the web searches and talking to more cleverer people all ended up with weird ideas involving high end complicated electronics, timing the lines going high/low with some added calculations and or it can not be done using a CPU. A day or twos thinking and playing with ideas and a solution jumped to light. A solution I am pretty proud of it can do frequencies as low as 30 Hz and it was tested on a frequency as high as 2500 Hz, my guess is it can go even higher than 100kHz. With a bit of timing changes I can make it go even lower than 30Hz, but with the application at hand going through the effort is not worth it.

The first installation was done by my self and it took about 2 days to complete the wiring. This entailed rewiring the generator to accommodate the new AMF (Automatic Mains Failure) controller. Most of the time went into the fit of the contactors (Magnetic relays), enclosures and rerouting the electrical power cables. The next few pictures tracks the installation as it progressed until completion Fig7, Fig8, Fig9, Fig10, Fig11, Fig12, Fig13, Fig14, Fig15. One of the requirements was that I leave the existing control circuitry in place thus the double harness that can be spotted on the generator it self.

It is not always a bad idea to go and check how your product is used, and speaking to the client, if you listen carefully they will reveal a requirement you failed to acknowledge or you took for granted. This was how the charger control was born and adding it was not a huge effort but surely made the worlds difference. Fig16

On site testing revealed some interesting behaviors that I failed to reproduce during my testing using a controlled environment and simulating the various inputs. So I had to rely on the test results and try and workout where did I miss it. A few minor code changes, lots of on site testing and the problems were solved, slowly but surely.

On 2010-10-10 all the tests performed behaved as intended, no more funnies, no more Hu, why is it doing that, no more going back to the drawing board. A sure day to remember.

And when you think hey I am done, the client throws you a curve ball. The machine was in a building and they fitted a garage door. Jip, you guessed it, the door must open and close as the machine starts/stops. So we found a garage door automation company to fit all the gadgets needed to automate the door. All that was left was to hack into the circuit and make it open/close when needed. Some how I managed to get it working.

I greatly thank the owners of WZ Trucking for allowing me to utilize their machine, my dad for providing most of the materials used in wiring the installation and all of my family who witnessed and endured the failures, setbacks and successes.

 

What about another version...

Birth

Country Auto Field service CC

Home

About Us

Contact Us

Product List

CAF