Tuesday, January 30, 2018

Firmware version 1.2.0 released

Today I have posted up firmware 1.2.0 for the Alternator regulators.  This release includes many small adjustments / tuning as a result of feedback – thank you to all!  Mostly these changes are around the fall-back operational mode when a current shunt is not present (or has failed in some way), but there are two changes which may impact people:

The definition of the Battery Size DIP switches has been changed from a 500Ah per increment to 250Ah per step.  This is more in line with expected battery capacities.  Larger banks are still supported via the ASCII configuration commands and the internal representation of battery size is unchanged; only how the DIP switches are interpreted has been modified.

The ability to change the default 60 seconds warm-up delay has been added to SCV and SCA  ASCII status and commands.  See the revised Reference Guide for details.   One side effect of this change is that the internal storage space has to be changed, and as such any existing configuration information will be overwritten and lost.  If you do upgrade your regulator and have used ASCII commands to do detailed configurations you will need to reissue those.

Going forward I have added blank spaces to the internal storage arrays, so hopefully in the future as features are added a restructuring will not be needed.

The default CPE has been modified slightly to a bit more conservative values, specificity around the target voltage for CPE #8 (Li technologies) as well as max charging temperature for all batteries.   As we learn more about how specifically LiFeP04 technology is best deployed in house usages you can expect the default CPEs to be further refined.  Of course there is always to option to override the defaults via ASCII commands.

Finally the ability for the FEATURE-IN port to do a master-reset of the regulator has an additional condition which must be met:  The DIP switches must be set to select CPE#6 (reserved) with all other switches set = ON.  This is to reduce to possibility of accidental clearing of regulator, while still allowing for field master clear w/o needing to recompile the source code.

For a more complete list of changes, refer to the commit logs in  Github:  https://github.com/AlternatorRegulator/alt-Source


Those wishing to do a simple flash upgrade of their Gen 3 regulator may use the update tool located here:  https://github.com/AlternatorRegulator/alt-Binary

And revised documentation may be found here:  https://github.com/AlternatorRegulator/alt-Documentation


Those looking at the code will notice many other formatting and naming changes:  There are mods associated with allowing common source code to be used with the DC Generator, and you can expect more changes along these lines down the road.

Thursday, January 11, 2018

Why all the code pushed up to GitHub?

Some folks may have noted a LOT of code pushed up to Github over the past few days. 

I am refreshing the DC Generator controller design, including bringing it up to a like level of OSEnergy support as the Alternator Regulator.
http://smartdcgenerator.blogspot.com/

As I do the software porting / refresh there will be changes to the Alternator Regulator source code which is not directly related to the Alternator Regulator, but are being made to allow common source code / code reuse with the DC Generator controller.  Mostly it is naming, and use of #defines and include files.

Some of the edits include changes in the support libs RV-C, so make sure to bring down and update both the source and the libs directory on your local machine.


Monday, January 8, 2018

More robust USB connection, and a new CAN Dongle for Windows!

There has been increased interest in monitoring the Alternator Regulators, with some nodeJS scripts even in the works!   This however brings out the question:  What is the best way to attach to the regulators for long term monitoring?

My short answer: CAN

The CAN is designed for just this, the problem had been locating reasonably priced CAN adapters for PCs.  That has changed this past summer, as there is new a flood of low-cost CAN to USB adapters available for under $25.  One good source being: https://www.seeedstudio.com/USB-CAN-Analyzer-p-2888.html   Seed Studio is not the manufacture of this device, but they are well supporting it.  It is readily available from them, Ebay, Amazon (though at an insane price) and even Mouser and Digikey  (Hint, google the Seed Studio part number: 114991193  to see a few purchasing options).

To connect it up take a standard CAT-5 cable, cut one end off and connect the CAN-H and CAN-L wires.  If your PC does NOT already have some type of grounding back to the batteries negative terminal, also connect the CAN-GND wire.  That one will take some fiddling with.  Try it 1st without connecting the CAN-GND wire, if you start getting errors see if connecting the GND wire helps.  (We are hoping to avoid multiple ground paths back to the battery, aka a Ground Loop).

The RJ45 connector follows the CiA-303 spec for wiring, and when using standard CAT5 cables the wiring SHOULD be like this:


Regulator’s RJ45
CAT-5 color coding
Pin
Function
EIA 568A
EIA 568B
1
CAN-H
White/Green
White/Orange
2
CAN-L
Green/White
-or-
Green
Orance/White
-or-
Orange
3
CAN-GND
White/Orange
White/Green
4..8




Sorry, but there are two ‘common’ cable standards out there.  You will just have to look to see which one you have by the color of the wire in the 1st position.   For reference, here is the complete RJ45  pinout spec:






Once you have the pigtail on the CAN-USB done just plug it into one of the RJ45 connectors on the Alternator Regulator, does not matter which one.  Then follow the software driver instructions for the CAN-USB dongle and any app you wish to install.   If you have two regulators linked by an existing CAT5 cable, plug the CAN-USB pigtail into the open port on either regulator and remove the blue jumper on the TERM post for that regulator.  Then continue with driver/software install.  As a bonus, one of these CAN-USB dongles will provide access to BOTH regulators!

I have ordered one of these devices and have high hopes that with it and the work others in the community are doing we can get a simple and nice status display going.  Plus, this will be a great way to gain access for the configuration application being written as well!


Well, CAN is great – but if you want to use USB that is also an option.  I am a bit concerned about the long term reliability of the micro-USB connector on the regulators – it really is more for updating/configuration/diag then long term use.  And of course there is a distance limitation associated with USB (though active booster cables help).  One idea for a more robust USB connection is to install the 5-pin header into the PCB (just next to the existing USB micro connector) and use a cable to connect to that header.   The header pinout conforms to the standard PC 4 or 5 pin headers and there are several options out there, looking something like this:




The 5-pin header pinout spec is:



Note that some cables do not contain shielding, and hence are 4-pin.


Some ideas for sources include:
https://www.newegg.com/Product/Product.aspx?Item=N82E16812329093&cm_re=usb_2.0_header_cable-_-12-329-093-_-Product

http://www.frontx.com/cpx508.html

https://www.amazon.com/Adapter-designed-motherboard-external-connector/dp/B000V6WD8A

A ton of options out there - most all type ‘A’ in both male and female.  So, CAN is nice but if you are looking to do USB long term, consider connecting via a USB header.