Sunday, July 28, 2013

Just a quick note

Over the past week I installed the regulator aboard Viking Star, and have made three runs.  Two long and one with lots of starts / stops.   I have been working through issues, but still have a few to go before I can declare it has a basic level of functionality.  I am facing two right now:


  1. During startup, when I release the main engine starter button, the regulator faults  with INA-220 I2C read errors.  They are random in nature, but directly associated with the releasing of the starting button.
  2. When running with the Arduino regulator, I seem to under-read the battery voltage.  When I switch back to the standard fixed voltage regulator, the Arduino regulator correctly reports the voltage.

Both of these are making me think there might be something with how I have installed the regulator.  It is complicated in that I left the original regulator in place so I can switch back and forth easily.  But I am wondering if there is a ground loop that is causing coupling of the starter as well as loading on the line during running (causing a voltage drop, and hence under-reading of the battery voltage).   I just need to get down in the engine room with some meters and/or O-Scope, but have been working instead on the DC Generator / Watermaker as we started using the watermaker for the 1st time after installing the integrated controller / regulator...


Hopefully will get some time next week to make  progress.


ps:  some may have noticed I snuck in rev 0.0.2 of the source code, and its associated .wrd file describing the ASCII interface.  I did that to support the person who is working on a GUI for smart phones and such.  Figured it would be better for him to use the latest ASCII syntax while developing, and the code will still work in a kind of 'demo mode' on a standard Arduino as long as the "#define TESTING"  is enabled.


Friday, July 19, 2013

1st unit ready to test out!

It has been very quiet on this blog for some time now, mostly as a result of Kristi and I taking a trip back to Minnesota for her folks 60th anniversary, combined with boat travel to and from the Seattle area.  But we are back in Canada now, and I have just about finished up with the 1st build.


Top view.
Field connectors are the large ones on the top left, bottom left connects
battery voltage sensing, Alternator stator, as well as engine 'enable' line.
Top right has Feature in/out connectors and Alternator shunt, while
the bottom right has the block of RJ-45 connectors for temp probes,
service probe, and synchronization cable for twin engine install.

Bluetooth module is top center.



Bottom view.   Field Driver FETs (right hand side) will mount face down onto
the heatsink, with relief holes in the PCB to gain access to the mounting screws.
Need to use a bit more PCB cleaner to get rid of the remaining residue.









Today I did some mocking up of the assembly, just to see what parts fit and what I was missing.  Mostly it looks good, but I will need to get taller standoffs to raise the ‘cover’ up some more (Cover not shown here).

All mounted.  I need to purchase taller standoffs to support a small plastic cover
which will go over the whole unit giving it a nicer finished look, and some additional
protection beyond the conformal coating.

Also need to print up and add the stick-on labels describing the DIP switch and connectors.




A few issues I have found:  There was one design error in the FET driver, the 15v clipping zener needed to go between G and S, not G and GND.  I relocated the Zener to the back of the PCB and tacked it on.   I also am finding the NTC daughter boards a real PITA to solder up.  Partly due to their small size, partly due to I made the wire through holes a little small, and partly due to the Chinese sourced CAT-5 cables I purchased, which seem to be made from Aluminum – not copper…  Digging through our parts stash I found some unused Magnum remote cables and use them.



REALLY small PCB there, that is a CAT-5 cable coming in from the left...



And here is a photo of the 'Service Cable'.  This is used in conjunction with the Arduino programming environment to upload the Firmware to the regulator.  It can also be used to send/receive ASCII commands to existing firmware to program some of the configurable features, for those who do not wish to mess with 'C' programming, nor the Bluetooth interface:
Optional Service Cable.



My next step is to complete the mounting and then install it on Viking Star.  I am very interested to see how some of the new algorithms work (specifically the auto-alternator size determination).   I figure I will also want to wire up a remote ‘kill switch’, just in case things go really bad.  But as with the integrated Engine control / regulator project, I will be making several test runs, logging data, and making adjustments to the source.   I am not worried about the core regulator functions, it is the new stuff placed around that that I need to check out.



Friday, June 28, 2013

Charge profiles - Need help in setting the Default ones...

A new feature of the standalone regulator is built in charge profiles selectable via the DIP switches.  There are 8 positions which can be chosen.  Each charge profiles contains parameters for a series of 'stages' with items such as :
  • Limits to Battery Voltage
  • Limits to Alternator Current
  • Exit criteria to allow moving to next stage based on Time, Current, or perhaps battery voltage.
  • Battery charastics, specifically Temperature compensation
Below is what I currently have for a 'place holder', and am open to input on the profiles as to be honest - mode are largely blank...  So, is there perhaps another battery that should be added?  (ala LiPro).  Should one or two of the spaces be held over for 'future expansion' in the default profiles?  Send me Emails (or post comments here) I would kind of like to have a 'standard' set of profiles and keep them for all revisions to the source, as I really do not want to get into a massive mixture of different source configurations in the field...


Normalized Charge profiles:

Before getting to the actual profiles, we need to understand how the regulator auto-adjusted for different battery voltages.  (12, 24, 36, or 48v).  To avoid making 8 profiles for each battery voltage, I decided to make all profiles  'normalized' to a representative 12v system small (500Ah) battery.   Then at startup the regulator will make two adjustments to the working charge profile depending on:
  1. Sensed Battery voltage.
  2. User selected 'battery capacity size' on the DIP switches.

The sensed battery voltage is applied to target Voltages (increasing them) while the Battery Capacity Size DIP switches are used to increase target Amps.

Example - currently the 1st charge profile entry for  Bulk/Absorption phase has the target VBat defined as 14.1v, and the 'exit' criteria (for exiting Absorption phase when the battery is truly fully charged)  is at 10a  (2% of the 500Ah battery capacity).  Two examples:  First a 12v large battery system then  a 48v mid-sized battery:



12v 1,600Ah battery:
  • Auto-sensing system voltage = 12v, multiplier is 1x.
  • User selected DIP switches  = On-On (1,500Ah or greater battery)
The regulator will adjust the run-time charge profiles as:
  • Volts  * 1x  - based on sensed battery voltage
  • Amps * 4x  - based on user selected DIP switch

So, the 14.1v / 10A  becomes -->  14.1v, 40A  Meaning the regulator will drive BULK mode until the battery voltage reaches 14.1v, then switch to ACCEPT mode - holding VBat at 14.1v until the measured current drops below 40A at which time it will move to the next phase (float in the case).



48v,  800Ah battery bank
  • Auto-sensing system voltage =  48v, multiplier is 4x.
  • User selected DIP switches  = Off-On (500Ah - 1,000Ah battery)
The regulator will adjust the run-time charge profiles as:
  • Volts  * 4x  - based on sensed battery voltage
  • Amps * 2x  - based on user selected DIP switch

So, the 14.1v / 10A  becomes -->  56.4v, 20A  Meaning the regulator will drive BULK mode until the battery voltage reaches 56.4v, then switch to ACCEPT mode - holding VBat at 56.4v until the measured current drops below 20A at which time it will move to the next phase (float in the case).




Charge Profile States:

Each charge profile has the following basic 'stages' or modes:
  • Ramping   - Initial state where the alternator is brought online slowly
  • Bulk         - Regulator will be in Bulk mode until the battery voltage reaches the Accept voltage limit.  During Bulk phase, Amps are limited by the capability of the alternator or optionally a defined max Amps.
  • Acceptance - Voltage is regulated to the defined limit.  Will stay in Accept  until Amps drops below the defined value (indicating the battery is fully charges), or a defined time limit is exceeded.
  • Float           - After Acceptance, this is a 'keeper' stage where the volts are regulated to a lower setting.

Each of these stages or modes have criteria for regulation of Battery Voltage and Alternator Amps, they also have exit criteria (exiting that mode and moving on to the next one) based on time, volts and/or amps being delivered.   There are also some additional stages:
  • Over Charge  - Between Acceptance and Float to give a final 'kick' to some battery types
  • Post Float      - Alternator is turned off letting the battery rest rest
  • Equalize         - Selected overcharging to rebalance the batteries



Charge Profiles:

Each Charge Profile (there are 8 of them, selectable via the DIP switches) has a series of entries to allow for targets and exit criteria, as defined by this structure:  You might find it easier to copy and paste this structure into a text editor of your own, to better be able to read the long lines.  Use a fixed-space font (e.g. Courier) to preserve tabbing and alignment.




//----- This structure defines a 'profile' for battery charging.  Each stage consist of 'modes', primarily:  Bulk, Acceptance, 
// Overcharge, and Float.  Each mode has a max voltage set point, and criteria for exiting that phase (Exceeding a time limit, 
// or Amps dropping below a given value).  Of special note is the entry Float and Post Float, which have additional criteria 
// resuming charging.
//


ACPT_BAT_V_SETPOINT;            // Set point for Ramp, Bulk and Acceptance battery voltage.  

                                // Alternator will transition from BULK mode into Accept Mode when this voltage is reached, and then start the Accept Duration counter.
EXIT_ACPT_DURATION;             // Stay in Accept mode no longer then duration in Hours
EXIT_ACPT_AMPS;                 // If Amps being delivered falls to this level or below, exit Accept mode and go to next (Overcharge)
                                //     Set ExitAcptAmps = 0 to disable Amps based transition and only rely on timeout duration.



                                // Overcharge mode is sometimes used with AGM batteries and occurs between Acceptance and Float phase.  

OC_BAT_V_SETPOINT;              //    Set point for Over Charge battery voltage (Set this = 0 to disable)
EXIT_OC_DURATION;               //    Over Charge mode duration in Hours.  (Set this = 0 will also disable Over Charge step.)
EXIT_OC_AMPS;                   // If Amps being delivered falls to this level or below, system will exit Overcharge mode and go to Float
                                //     Set this = 0 to disable Amps based transition and only rely on timeout duration.



FLOAT_BAT_V_SETPOINT;           // Set point for Float battery voltage

EXIT_FLOAT_DURATION;            // Alternator will stay in Float mode this many hours before entering Post-Float (no charging) mode.  Set = 0 disable transition to Post-float mode.
FLOAT_TO_BULK_AMPS;             // If Amps being delivered exceeds this value, we will assume a LARGE load has been placed on the battery and we need to re-enter
                                // BULK phase.   Set this = 0 to disable re-entering BULK phase feature



EXIT_PF_DURATION;               // Only stay in Post_float mode (no charging) this amount of time.  Set = 0 to disable times based Post-float exiting and exit only on Voltage.

PF_TO_FLOAT_VOLTS;              // If during Post-Float mode VBat drops below this voltage, re-enter FLOAT mode.   
                                // Set = 0.0 to disable exit post post-float mode reverting to FLOAT Charge mode based on voltage.
                                // Config note:  If you configure the system to enter post-float mode from float-mode (by setting the time value EXIT_FLOAT_DURATION), AND you
                                // set both EXIT_PT_DURATION and PF_TO_FLOAT_VOLTS = 0, the regulator will in effect turn off the alternator once charging is completed
                                // and not restart a charge cycle until powered down and up again.  This can be useful if you truly want a one-time only charge.
                                // You could also config the FEATURE-OUT port to indicate the complete charge cycle has finished, to say power-off the driving engine?



EQUAL_BAT_V_SETPOINT;           // If Equalize mode is selected, this is the target voltage.  Set = 0 to prevent user from entering Equalization mode.

EQUAL_BAT_A_SETPOINT;           // During equalization, system will limit Amps to this value.   Set = 0 will also prevent user from entering Equalization mode.
EXIT_EQUAL_DURATION;            // Regulator will not stay in Equalization any longer then this (in Hours).  If set = 0, then Equalization mode will be disabled.
EXIT_EQUAL_AMPS;                // If Amps fall below this value during Equalization, exit equalization.     Set = 0 to disable exit by Amps and use only time.



BAT_TEMP_1F_COMP;               // Battery Temperature is compensated by this factor for every 1F temp change.  Note this is based off of BAT_TEMP_NOMINAL (77f)

MIN_TEMP_COMP_LIMIT;            // If battery temperature falls below this value (in deg-F), cap temp compensation voltage rise to prevent overvoltage in very very cold places.
BAT_MAX_CHARGE_TEMP;            // If Battery exceeds this temp (in deg-f), stop charging and force into Float Mode to protect it from over-temperature damage.






Do I need some additional parameters?  e.g., should there be a Float-to-Bulk voltage set point in addition to the Amps value?




Charge Profile Entries:


And here is the 8 entry table that I have for the current 'charge profiles':  Take note that there are a LOT of blanks, for example Post Float and OverCharge are currently disabled for all entries.  And the Temp Compensation is all set to the FLA type battery, which I suspect is not the right answer.   So - -   If you have knowledge on this area, please send me comments to:  mvVikingStar@gmail.com  Thanks!


   Bulk/Accpt                Overcharge              Float                 Post Float            Equalization                Temp Comp   
{14.1v, 4.5hr, 10a           0.0v, 0hr, 0a          13.1v, 0hr, 0a            0hr, 0.0v,           0.0v, 0a, 0hr, 0a,         0.028*6/10, 15f, 125f}, // Default (safe) profile.
{14.6v, 4.5hr, 10a           0.0v, 0hr, 0a          13.4v, 0hr, 0a            0hr, 0.0v,         15.5v, 0a, 0hr, 0a,         0.028*6/10, 15f, 125f}, // Standard FLA
{14.1v, 4.5hr, 10a           0.0v, 0hr, 0a          13.6v, 0hr, 0a            0hr, 0.0v,         13.6v, 0a, 0hr, 0a,         0.028*6/10, 15f, 125f}, // Standard Gell Cell
{14.3v, 4.5hr, 10a           0.0v, 0hr, 0a          13.1v, 0hr, 0a            0hr, 0.0v,         15.5v, 0a, 0hr, 0a,         0.028*6/10, 15f, 125f}, // Standard AGM (1)
{14.5v, 4.5hr, 10a           0.0v, 0hr, 0a          13.5v, 0hr, 0a            0hr, 0.0v,         14.5v, 0a, 0hr, 0a,         0.028*6/10, 15f, 125f}, // Standard AGM (2)
{14.1v, 4.5hr, 10a           0.0v, 0hr, 0a          13.1v, 0hr, 0a            0hr, 0.0v,           0.0v, 0a, 0hr, 0a,         0.028*6/10, 15f, 125f}, // Reserved for future use??
{14.1v, 4.5hr, 10a           0.0v, 0hr, 0a          13.1v, 0hr, 0a            0hr, 0.0v,           0.0v, 0a, 0hr, 0a,         0.028*6/10, 15f, 125f}, // Custom #1 - Users Entry
{14.1v, 4.5hr, 10a           0.0v, 0hr, 0a          13.1v, 0hr, 0a            0hr, 0.0v,           0.0v, 0a, 0hr, 0a,         0.028*6/10, 15f, 125f}  // Custom #2 - Users Entry





Wednesday, June 26, 2013

Working through Bring Up

Have been making good progress on the bring-up, with many of the subsections tested.  So far have the hardware almost 100% 'spot checked' for no-smoke and some level of function.  Am now working through integration of hardware and software, and doing more detailed sub-section testing.

Here is a photo of the 1st board:



Notice I am using a Uno development board to provide DC power as well as communication to and from the regulator.  All those Tombstone resistors provide handy test points!



Wednesday, June 19, 2013

PCB and Parts have arrived!

Yesterday we stopped by our maildrop here in Friday Harbor and picked up a pile of parts!   PCBs look very Royle, being Purple with gold finish.


I am intending to mount the PCB in the open space of the HeatSink and place a nice looking plastic cover over it.  When combined with the PCB conformal coating, should give a well protected unit.  That small PCB the pencil is point to is actually two PCBs that will be used to hold the NTC temperature sensors and allow for soldering to CAT-5 cables.  This is a tight board, mostly because I still retained the use of through-hole parts whenever possible.  But even so, there are three SMT chips on this, including the dreaded INA-220!

Friday, June 14, 2013

Regulator Connection




Of special note are the the A, B, C, and D terminals.  These are used to allow the regulator to support P-type (High Drive) or N-Type (Low Drive) alternators w/o any other changes.  As shown (with the Jumper between A and B) the regulator is configured for a P-Type (High Drive) field. The Field is then connected to C/D (or in this case just C as the other end of the field is connected internally in the alternator to ground.)  To support a N-type, one would jumper C&D, and connect the Field to A/B.  (Or just B if the alternator has connected the other end of the Field to BAT+ internally).

The DIP switch is used to select built in charging profiles, while the Bluetooth (or via the Service Port) can be used to enter custom profiles.

The Battery + and Battery - connections should be made AT THE BATTERY, while the Alt + and Alt- should be made directly to the alternator.  (The reason I separated the BAT and ALT wires is to allow support for Alternators which might have a different field voltage then the charging battery.  e.g., using a converter 12v alternator to charge a 48v battery where the field is still 12v).



V0.0.0 connector location  (Original  design - no longer supported)

v0.1.x connector locations (Latest/ current through-hole design)


v0.3.x connector locations (CAN - SMT design)





Tuesday, June 11, 2013

First cut of draft Source for standalone regulator posted

Today I placed up the 1st cut of Source Code for the stand-alone regulator project.  version 0.0.1

This version is mostly complete, but has only had limited testing on a stand-alone Arduino UNO card - there is no regulator hardware available yet.  The source can be found under the SOURCE tab above, looking in the standalone regulator directory.

I also posted a .wrd file that does some initial documentation of the regulator, and in particular the ASCII strings in and out to be used to monitor status as well as optionally change configuration parameters.  Over time this document will be expanded.




Tuesday, May 28, 2013

Parts ordered for Stand-alone Arduino based Alternator Regulator

This morning I placed orders for the remaining parts and the PCB for the standalone version of the Arduino based Alternator Regulator.  Here is a 'projected' picture of what the PCB will look like:



And the schematic can be found in the Schematic Link above.  BOM/shipping cost came in at $83 for the regulator and just under $100 for everything:  Regulator, Temp probes, Current Shunts, etc.  All but connection wire and fuses.

The basic concept for this regulator is the same as the integrated Engine Controller and Regulator, with a few differences:
  • Found a simplified FET boost-driver (LT1910) that has a built in Booth PS.  It should allow N-Channel FETs to be used from 12v to 48v on P or N type alternators w/o any hardware changes.  Will be interested to see how it works!
  • Have eliminated the hardware remote LCD panel, the unit will just start when power is applied and optionally communicate status via Bluetooth. (Or the built in Serial port)
  • Have on board DIP switch and LED for stand-alone configuration and operation.  Just select the battery type, size, and some other special features and connect it up.  Nothing else is needed to get it to work in its basic function.
  • Sync port to coordinate functions between two regulators charging the same battery, ala in a twin engine boat.  Mostly this is to share Amps produced, but as the firmware progresses, might find other needs for this coordination.

    It still retains the ability to monitor and manage Amps (Watts) as well as Volts.  This can be used to better decide when to change charging states (terminating the Acceptance phase based on battery need vs. pre-determined fixed amount of time), as well as doing functions to protect the Alternator, or limit the load on the engine.  I plan to have a few 'pre defined' scenarios built in and selectable via the DIP switches, and hope to have a simple user interface available via the Bluetooth (and/or Serial port) to monitor status as well as allow for additional  custom configuration of different scenarios to be saved in the Atmel EEPROM.  Of course, one could always modify the firmware and get any scenario they wanted!

    I should be picking up the parts late June, early July.  Then will be building them up.  Till then, I continue to use my Fixed voltage truck regulator on the main house battery alternator, and the integrated Arduino controller on the Generator.







    Thursday, May 23, 2013

    Posted draft Stand Alone Alternator Regulator Schematics

    This morning I placed the draft schematics for the stand-alone (alternator only) version of this project to the Schematics tab above (click on the Stand Alone Regulator' folder.

    This regulator will be based on the controller project and share a lot of the code, but will not include any of the Engine control functions.  Key features of this stand-alone regulator are:


    • Active management of Alternator for both Volts and Amps (Watts)
    • Ability to use Amps as a way to judge when a battery is fully charged, as opposed to pre-defined time value (this is the key feature)
    • Paralleling ability for coordination between two regulators in a twin-engine setup (ala, marine use)
    • DIP switches to be used to select a series of pre-configured charging profiles.
    • Fully support of P or N type alternators from 12v to 48v

    It also includes a Bluetooth module, for future communication to computers, phones, etc. for status updates as well as finer control of the configuration.

    As always, it is fully programmable via a Service connector, and posted in the Public Domain.

    One major change I am excited about is the Field driver - I located a self-powered Boost driver (LT1910) that looks like it will allow for a fully configurable P or N type alternator support from 12v to 48v without any hardware changes.  Will be going to FAB in a few weeks, if anyone is interested in this let me know.




    Sunday, June 20, 2010

    PCB Errata

    Design release V0.1.4

     A problem with low voltage cutout has been IDed in the FET driver chip.  More details here:
    http://arduinoalternatorregulator.blogspot.ca/2016/04/regulator-stops-working-when-enable.html



    (Click for larger view)






    Design release V0.1.3


    (Click for larger view)

    Some photos showing corrections:

    R6 / R33 moved to bottom of PCB correcting Tx/Rx