tag:blogger.com,1999:blog-61097152180581680572024-03-13T15:24:00.123-07:00DC Generator Controller Alternator Regulator and Small Engine Controller w/remoteViking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.comBlogger115125tag:blogger.com,1999:blog-6109715218058168057.post-67186419657064001462020-05-01T13:08:00.000-07:002014-03-28T11:30:51.156-07:00WELCOME<div style="text-align: center;">
<div style="text-align: left;">
<span style="color: #222222; font-family: inherit; font-size: xx-small; line-height: 16px;">Revised 6/20/2013</span><br />
<span style="color: #222222; font-family: inherit; line-height: 16px;"><br /></span><i><span style="font-family: inherit;"><span style="color: #222222; line-height: 16px;">Note: If you are looking for the companion to this - the Stand-along Alternator Regualtor, I have started placing those files in a separate Blog: </span></span><span style="color: #222222;"><span style="line-height: 16px;"><a href="http://arduinoalternatorregulator.blogspot.com/" target="_blank">ArduinoAlternatorRegulator.blogspot.com/</a></span></span></i><br />
<span style="color: #222222;"><span style="line-height: 16px;"><br /></span></span>
<span style="font-family: inherit;"><span style="color: #222222; line-height: 16px;"></span></span><br />
<span style="font-family: inherit;"><span style="color: #222222; line-height: 16px;">After using our </span></span><span style="font-family: inherit;"><span style="color: #222222; line-height: 16px;">Kubota EA300 based DC generator / water-maker for about a year (</span><a href="http://mvvikingstar.blogspot.com/search/label/Kubota%20DC%20Generator" target="_blank">mvVikingStar.blogspot.com/search/label/Kubota DC Generator</a>.) I wanted to make an improvment.</span><br />
<br />
<span style="font-family: inherit;"><b>The goal was very simple: Shorten the amount of time I needed to listen to the Generator running.</b> See, being away from the dock for 8-9mo a year we are very dependent on our generator. And I just did not look forward to the 'suffering' hours of the daily generator run. I wanted a regulator which would maximize the amount of energy produced for every minute the Diesel was spinning. </span><span style="color: #222222; font-family: inherit; line-height: 16px;"> I also wished to be able to generate some energy while running the Water maker and provide remote operation of the generator. </span><br />
<span style="color: #222222; font-family: inherit; line-height: 16px;"><br /></span>
<span style="color: #222222; font-family: inherit; line-height: 16px;"><b>As the project grew, it gained two additional values: ability to <u><i>fully</i></u> recharge the batteries, along with remote automated start/stop.</b></span><br />
<span style="color: #222222; font-family: inherit; line-height: 16px;"><br /></span>
<span style="color: #222222; font-family: inherit;"><span style="line-height: 16px;">Limitations of most 'smart' regulators prevents all of these goals - primarily because they manage only the Volts, relying on the self-</span></span><span style="color: #222222;"><span style="line-height: 16px;">limiting</span></span><span style="color: #222222; font-family: inherit;"><span style="line-height: 16px;"> nature of alternators to manage the Amps. (Though some do a crude attempt to manage Amps produced.). A major design point of this project is the active monitoring of BOTH Voltage and Amperage. By doing so I will be able to meet the charging needs of the batteries while also maintaining a constant load on the Kubota EA300.</span></span><br />
<span style="color: #222222; font-family: inherit; line-height: 16px;"></span><br />
<br />
<b><span style="font-size: x-small;"><i><span style="color: #222222; font-family: inherit; line-height: 16px;">BTW: If you are looking for a simpler design, one that keeps the key values of shortening Generator run-time and/or the able to fully recharge batteries, see the stand alone regulator on the link above.</span></i></span></b><br />
<span style="color: #222222; font-family: inherit; line-height: 16px;"><br /></span>
<span style="color: #222222;"><span style="font-family: inherit;"><span style="line-height: 16px;">This design is done in such a way to be applicable to other small engine </span></span><span style="line-height: 16px;">control</span><span style="font-family: inherit;"><span style="line-height: 16px;"> deployments. With or Without an </span></span></span><span style="color: #222222;"><span style="line-height: 16px;">Alternator</span></span><span style="color: #222222; font-family: inherit;"><span style="line-height: 16px;"> and/or Water maker. Key features include:</span></span><br />
<br />
<br />
<b>Overall Features:</b><br />
<ul>
<li><span style="color: #222222;"><span style="line-height: 16px;">Local Controller and operating switches with optional remote display / switches.</span></span></li>
<li><span style="color: #222222; line-height: 16px;">Supports system voltages (Starter, throttle control, etc) of 12 or 24v.</span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Support of Alternator field and battery voltages up to 48v systems.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Alternator voltage support is independent of System Voltage - as 12v system can manage a 48v alternator.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Driver to enable external pump, ala HP pump for watermaker, or circulation pump for co-generation deployments.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Open Source Firmware and hardware for ultimate customization</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Easy attachment of </span></span><span style="color: #222222; line-height: 16px;">diagnostics console for easy firmware updates as well as detailed monitoring and logging of system operation.</span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Wide range of configuration available, modes of operations, checks preformed, features included.</span></span></li>
</ul>
<br />
<b><br /></b>
<b>Engine Management:</b><br />
<ul>
<li><span style="color: #222222; line-height: 16px;">Selectable Auto Generator Start-up (based on battery voltage)</span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Auto stop after charging is completed</span></span></li>
<li>Warm-up and cool-down periods w/o alternator load.</li>
<li><span style="color: #222222; line-height: 16px;">Active throttle speed control, adjusting engine speed to match current loading.</span></li>
</ul>
<b><br /></b>
<b>Alternator Management:</b><br />
<ul>
<li><span style="color: #222222;"><span style="line-height: 16px;">Fully configurable 3-stage Alternator regulation with soft ramp of initial power on.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">'Over Charge' (or 4th stage) support for AGM batteries.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Battery Temperature Compensation and adjustment for all charging voltages.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Reduced total charge time by capturing wasted engine capacity during early portions of charge cycle.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Precise measurement of battery voltage, including negative lead to accommodation any common ground line voltage drops.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Alternator charging actively managed by measured battery voltage, charging current, and total load placed on driving engine.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Adaptive alternator reduced power mode to support simultaneous driving of other loads, ala water pumps, hydraulic pumps.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Charging rate reduced under excessive EGT, engine and/or alternator temperature conditions. </span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">By actively managing Voltage and Amps, larger framed alternators turning at lower RPMS can be utilized resulting in upwards of 10% greater alternator efficiency.</span></span></li>
</ul>
<div>
<br /></div>
<b>Fault Detection:</b><br />
<ul>
<li><span style="color: #222222;"><span style="line-height: 16px;">System fault monitoring: Over temperatures (Engine, EGT, alternator, battery), voltage, amps.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Broken sender / wire check for Oil pressure and Cooling Water Flow Senders.</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Fail safe protection: Watchdog timer, hardware crow-bar for over-voltage</span></span></li>
<li><span style="color: #222222;"><span style="line-height: 16px;">Software self-checks for incorrect configurations, and internal operating errors.</span></span></li>
</ul>
<br />
<br />
<span style="color: #222222; font-family: inherit;"><span style="line-height: 16px;">And some likely future </span></span><span style="color: #222222;"><span style="line-height: 16px;">enhancements</span></span><span style="color: #222222; font-family: inherit;"><span style="line-height: 16px;"> will include:</span></span><br />
<ul>
<li><span style="color: #222222; line-height: 16px;">Auto Start quite period holds off (with optional RTC added)</span></li>
<li><span style="color: #222222; line-height: 16px;">Lifetime recording of total amps / watts produced by alternator, hours of operation, etc.</span></li>
</ul>
<div>
<span style="color: #222222;"><span style="line-height: 16px;"><br /></span></span></div>
<div>
<span style="color: #222222;"><span style="line-height: 16px;">The project is base around the Amtel ATmega328 CPU configured using the Arduino development environment. All parameters and features are fully configurable with a wide array of options. Features may be disabled if not needed. </span></span></div>
<div>
<span style="color: #222222;"><span style="line-height: 16px;"><br /></span></span></div>
<div>
<span style="color: #222222; line-height: 16px;">All works are being released under the Creative Commons licensing agreement, with the only restrictions around commercial use. I have selected the Open Source KiCAD tool for Schematic capture and PCB layout and posted those CAD files. </span><span style="color: #222222; font-family: inherit; line-height: 16px;">Links at the top of this Blog provide details of each portion of this project. Click on the </span><i style="color: #222222; font-family: inherit; line-height: 16px;"><u>Link-to-Files</u></i><span style="color: #222222; font-family: inherit; line-height: 16px;"> area to download the schematic and well as PCB layout and parts list.</span></div>
</div>
</div>
<span style="color: #222222; font-family: inherit;"><span style="line-height: 16px;"><br /></span></span>
<span style="color: #222222;"><span style="font-family: inherit;"><span style="line-height: 16px;">The </span></span><i style="font-family: inherit; line-height: 16px;"><u>Design Elements</u></i><span style="font-family: inherit;"><span style="line-height: 16px;"> section goes into more details of each </span></span><span style="line-height: 16px;">sub-segment</span><span style="font-family: inherit;"><span style="line-height: 16px;">.</span></span></span><br />
<span style="font-family: inherit;"><span style="color: #222222;"><span style="line-height: 16px;"><br /></span></span>
<span style="color: #222222;"><span style="line-height: 16px;">And for an ongoing list of status / issues click here: </span></span><b style="color: #222222; line-height: 16px; text-align: center;"><a href="http://smartdcgenerator.blogspot.com/search/label/Status" target="_blank">>>> STATUS <<<</a></b></span><br />
<br />
<span style="color: #222222; font-family: inherit;"><span style="line-height: 16px;">Comments and advice are always welcome! It is my hope this project can be the basis for others works in </span></span><span style="color: #222222;"><span style="line-height: 16px;">intelligently</span></span><span style="color: #222222;"><span style="font-family: inherit;"><span style="line-height: 16px;"> controlling small engine </span></span><span style="line-height: 16px;">deployments</span><span style="font-family: inherit;"><span style="line-height: 16px;"> and generating systems.</span></span></span><br />
<span style="color: #222222; font-family: inherit; line-height: 16px;"><br /></span>Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.comtag:blogger.com,1999:blog-6109715218058168057.post-37899981033483784692018-03-31T17:11:00.002-07:002018-03-31T17:11:43.424-07:001st artical of revised controller finished proofing!It has been a while for any BLOG updates, but during that time progress has been happening. Today I finished hardware verification of the revised PCB design, including the migration to the STM32F07 CPU. Software porting has been going smoothly, once I did the homework around the development environment (STM CubeMX + Keil uVision). <br />
<br />
This coming week I am going to be revising the PCB layout ready for another round of FAB, and will post up the schematic at that time. Firmware is still under development, but largely ported. Mostly I need to finish the throttle control, augment thee ASCII status strings and commands to allow for configuration options around the engine, as well as work to place the controller into a low-power state when the DC generator is not operating.<br />
<br />
One challenge will be how to have them assembled (I will NOT be hand-soldering them up for folks, though could make the PCB available for anyone who wishes to do so themselves!) At min, really need 10x to make a viable assembly run. There are a few folks ready interested in this, if you have an interest drop me a line and I can add you to a mailing thread we have going.<br />
<br />
Remote: I do have a 1st articular of the remote assembled, but have not done any work with it. I am focusing on the controller 1st, will look at the remote later. (Will require use of local on/off switches for now).<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com1tag:blogger.com,1999:blog-6109715218058168057.post-24179373840598361462017-09-03T15:33:00.001-07:002017-09-03T15:33:28.825-07:00Design Refresh!It has been 3 years sense I last looked at the DC Generator controller board design. In that time we have accumulated over 1,000 hrs of run-time on our system, and 20x other systems boards have been ‘sent out’ (though I am not sure how many are actually running to be honest). Over the years I have had a few folks inquire about the design, and if there were any more PCBs left – which I had to say no. But this winter I want to do a design refresh – bring in the learning from the Alternator Regulator project, and specifically add a CAN connection capability. CAN (following the OSEnergy open standard) will allow for coordination and cooperation between charging sources, simpler remote panel integration, as well as integration with more modern standards such as SignalK. Much of the ground work has been put into place, and is being proofed out with the Gen 3 design of the Alternator Regulator. It is time to refresh the controller its self.<br />
<br />
So, here is a 3D rendering of the design I have drafted up:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioPXeDaCuqlMDgUaNl7CCgm6Y4NBjG4NtMA8LP1sTDSA3YOXdx9CW7C884xHfIhxwY_3VlUc3l75oZkw-471VW5gjImI0ScPw3GWC1cr4Fcqw_ip10Z8N6YyXuA2mdXdVkiIiCSYJLnvxP/s1600/CAN+DCGEN.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="718" data-original-width="1116" height="409" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioPXeDaCuqlMDgUaNl7CCgm6Y4NBjG4NtMA8LP1sTDSA3YOXdx9CW7C884xHfIhxwY_3VlUc3l75oZkw-471VW5gjImI0ScPw3GWC1cr4Fcqw_ip10Z8N6YyXuA2mdXdVkiIiCSYJLnvxP/s640/CAN+DCGEN.png" width="640" /></a></div>
<br />
<br />
<br />
As before it is a fully integrated engine and alternator controller, with the addition of some additional sensing ports to allow for monitoring of an optional water-maker (Monitoring for alarm, not active control / automation of the water-maker). It also includes the aforementioned CAN communications capability. It does feature a different CPU, the STM32F072, a bit lower cost – but also more programming pace, so the IDE will be a little different (A future project is to see about creating a board-type to support this new CPU under the Arduino IDE). I have the initial design completed, want to sit on it a while to do desk-reviews, but am looking to make up a prototype this fall, with perhaps a small professionally assembled run later this winter.<br />
<br />
Will also be looking at refreshing the optional remote.<br />
<br />
A major effort will be bring the firmware up to date. A major change I want to make is move from include file / compile options for configuring to using the ASCII command approach as on the Alternator Regulator.<br />
<br />
OK, this is just kind of a heads up – letting anyone who stumbled across this blog know there is still life in the DC generator project! If any questions, and if you are perhaps interested in a controller this winter – drop me an Email and/or leave a comment below.<br />
<div>
<br /></div>
Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com3tag:blogger.com,1999:blog-6109715218058168057.post-26087814514456232062016-09-30T03:17:00.005-07:002016-09-30T03:17:59.782-07:00Hair-Pin!!!Last year I changed out the alternator on our DC generator for a larger frame Leeve Neville alternator - and at the same time reduced the drive ratio to 1:1, which resulted in a noticeable gain in overall efficiency (See prior post).<br />
<br />
Well, today I received a new alternator that I am interested in testing to see if additional gains can be made:<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo-uZo1Aw9PHfViKevKTUfyIaJTogkzbc_J5gdjG250O3qwaj7jFMaQY0pyi7XkyryYGrTtvbHuaj69s0GyGXliFt8rjd7KpuxXTzmIc-x4e_NfO_tnNz_rDPKY6p9rstJcEVetnK2BFWM/s1600/IMG_8338.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo-uZo1Aw9PHfViKevKTUfyIaJTogkzbc_J5gdjG250O3qwaj7jFMaQY0pyi7XkyryYGrTtvbHuaj69s0GyGXliFt8rjd7KpuxXTzmIc-x4e_NfO_tnNz_rDPKY6p9rstJcEVetnK2BFWM/s320/IMG_8338.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Nice and Clean!</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK1QzO-vPccQC4PKvHP0UCqAovRLT2lSR3LVsHBeKo4Lav3G4d1p8wgrvi4MgBD86lc0E22zHLmFCOwnW5hbw5zPgazgo3Kr1YgecfA2W7iLcclKlEBEhyphenhyphen7douGaIHyvfKC7vxJme1PzK6/s1600/IMG_8339.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK1QzO-vPccQC4PKvHP0UCqAovRLT2lSR3LVsHBeKo4Lav3G4d1p8wgrvi4MgBD86lc0E22zHLmFCOwnW5hbw5zPgazgo3Kr1YgecfA2W7iLcclKlEBEhyphenhyphen7douGaIHyvfKC7vxJme1PzK6/s320/IMG_8339.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Note the square wires, and how close the are.</td><td class="tr-caption" style="text-align: center;"> </td><td class="tr-caption" style="text-align: center;"> </td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgivAvycR7y02xVGqXG2UpJ_Lk7rzyjpDtI1L-xEU8Sglfp2jDD5IFjWXDlk-ygjrSU3rArd4LAgXbOSNoM9A7pf6Lm8FAKIUsEYG135iBrVevMJT2zb-E493t_29s5fo3DAHiBWONCBc02/s1600/IMG_8341.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgivAvycR7y02xVGqXG2UpJ_Lk7rzyjpDtI1L-xEU8Sglfp2jDD5IFjWXDlk-ygjrSU3rArd4LAgXbOSNoM9A7pf6Lm8FAKIUsEYG135iBrVevMJT2zb-E493t_29s5fo3DAHiBWONCBc02/s320/IMG_8341.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmpCF_Mew1nDEC7vKgUFN2gZ35Dkexc_bhnimpIoV7DNDGMAF2YNvZYUiZTak3cxUPKy8Oui3gtFkK9l6QsiiqYBtakR_q9lXT8Q9fEkqMWkLmH9nigudZLaVgXQEBqHxYnVHfQ_fqSVlt/s1600/IMG_8342.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmpCF_Mew1nDEC7vKgUFN2gZ35Dkexc_bhnimpIoV7DNDGMAF2YNvZYUiZTak3cxUPKy8Oui3gtFkK9l6QsiiqYBtakR_q9lXT8Q9fEkqMWkLmH9nigudZLaVgXQEBqHxYnVHfQ_fqSVlt/s320/IMG_8342.JPG" width="240" /></a></div>
<br />
<br />
<br />
<br />
<br />
It is a 220A, 138.5 (larger frame) Desno Hairpin alternator. Configured for installation on Cummins 5.9L diesels as an option on some Dodge light trucks.<br />
<br />
I am unable to locate RPM/output curves for this unit, though data from one of the people using my Alternator Regulator shows they have a very fast cut-in. And I need to think about the drive belt - to keep it at the 1:1 ratio, increase it, change it to a rubbed belt.. Some more thinking to do. But I am looking forward to a winter project and see how this baby works out!<br />
<br />
<br />
<br />
<br />
<br />
Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-3100103015120081792015-11-09T17:28:00.002-08:002017-05-06T16:07:00.003-07:00Another look at DC Generator EfficiencyOr: Why you want a variable speed generator<br />
<br />
This fall I spent a few weeks ‘back on the farm’ helping to bring in the crops. Along the way I had a chance to find a series of tractor tests conducted by the University of Nebraska documenting many performance measurements. Bar pull, speed / RPM, gear ratios, etc. Why is this interesting? Well, one of the things they documented is actual measured fuel consumption at different engine loads and RPMs.<br />
<br />
A common rule of thumb for diesel engines is they will produce around 15-17HP for one hour while consuming about a gallon of diesel fuel. What is interesting from the Nebraska reports is this only holds true under full load at a given RPM. Example, take a look at this test data:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijrN5N9br34eYaiFHurX9k1tWjOytFqRD9ehvknQ5ZIWqxjJiaPqzDfU3IIMks4NLutufS5BO-rweRtXvWoBb8e6MjmZ_po944_ygkNqdxaPfu4gXDikx9eb7-bnOrEj_fSFKrE7DJgiSr/s1600/6BTA5.9+Test+Results.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Source: http://digitalcommons.unl.edu/tractormuseumlit/1860?utm_source=digitalcommons.unl.edu%2Ftractormuseumlit%2F1860&utm_medium=PDF&utm_campaign=PDFCoverPages" border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijrN5N9br34eYaiFHurX9k1tWjOytFqRD9ehvknQ5ZIWqxjJiaPqzDfU3IIMks4NLutufS5BO-rweRtXvWoBb8e6MjmZ_po944_ygkNqdxaPfu4gXDikx9eb7-bnOrEj_fSFKrE7DJgiSr/s400/6BTA5.9+Test+Results.png" title="" width="400" /></a></div>
<br />
<br />
Source: <a href="http://digitalcommons.unl.edu/tractormuseumlit/1860?utm_source=digitalcommons.unl.edu%2Ftractormuseumlit%2F1860&utm_medium=PDF&utm_campaign=PDFCoverPages" target="_blank"> http://digitalcommons.unl.edu/tractormuseumlit/1860?utm_source=digitalcommons.unl.edu%2Ftractormuseumlit%2F1860&utm_medium=PDF&utm_campaign=PDFCoverPages</a><br />
<br />
<br />
What is interesting is at 100% load / max RPMS (115HP / 2100 RPM) the engine produced 17.4 HP*hr using 1 gallon of diesel. However, run that same engine under 25% load and the engine is around ½ as efficient – only able to produce a bit under 9 HP*hr from that same gallon of fuel.<br />
<br />
What does this mean? Well, if you have a traditional fixed speed AC generator it is true it will consume less fuel under light loads – but it will be no were as efficient while doing so. Running that 7.5Kw generator at say a 2Kw load (charging up the house batteries) might be doing only ¼ the work, but its fuel consumption will only be reduced by ½ (not the ¼ we might hope for).<br />
<br />
But there is an answer. Again from the Tractor World there is a concept of GUTD, or Gear Up Throttle Down. Meaning – if the load is light use a higher gear and pull back on the RPMs. Just like overdrive in a car, this can help recover most of the lost efficiency vs. running those loads at the higher (fixed) RPM. Again, here is an example from the Tractor world – this one from Virginia Tech:<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuFOHnifCshSnKEzJh7lmd2n0ZlB9VlIBXQB-032qzOSrV0T6HV6mOC3dCnk5NWC7Z-dlPF-6cp8eiRXkeMMgMhc7DPMGTUoYxY5yEh9__d_hraMws6ibvCRp2wRKW0Q2MB6V6O_ykpeu-/s1600/Representative+Loading+Map.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Source: https://pubs.ext.vt.edu/442/442-450/442-450_pdf.pdf" border="0" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuFOHnifCshSnKEzJh7lmd2n0ZlB9VlIBXQB-032qzOSrV0T6HV6mOC3dCnk5NWC7Z-dlPF-6cp8eiRXkeMMgMhc7DPMGTUoYxY5yEh9__d_hraMws6ibvCRp2wRKW0Q2MB6V6O_ykpeu-/s400/Representative+Loading+Map.png" title="" width="400" /></a></div>
<br />
<br />
<br />
Source:<a href="https://pubs.ext.vt.edu/442/442-450/442-450_pdf.pdf" target="_blank"> https://pubs.ext.vt.edu/442/442-450/442-450_pdf.pdf</a><br />
<br />
This takes a little explanation: Start by looking at the blue star in the upper right hand corner. That point represents full RPMs and full engine load – and we see that the relative fuel ‘efficiency’ is 100%. However if we keep the same ‘throttle’ position but only apply say 45% of the load we drop down that red line on the right hand side to where it crosses the 45% load point (Red Star). Here we can see the 75% efficiency dashed line has been intercepted. This means if the engine produced 17HP*hr / gal @ 100% load, it will now only be 75% as efficient, and will now only produce 12.75HP*hr/gal. Bring the load down to the 30% point and we are again at ½ the efficiency as when under full load.<br />
<br />
However what if the engine speed could be slowed down while under the light 45% load? Shift into Overdrive if you will. OK. See the Green Star? This is the same 45% loading (meaning we are producing the exact same Horse Power as when at the Red Star point) – but look; we have now intercepted the 106% efficiency curve! Meaning our engine will now produce 18HP*hr for each gallon of fuel consumed. Doing some math and coming up with a hypothetical example an engine using the representative graph might look like this:<br />
<br />
Deliver 7.5Kw at full throttle burns 0.75 GPH<br />
Deliver 3.3Kw at full throttle burns 0.45 GPH<br />
Deliver 3.3Kw at half throttle burns 0.30 GPH<br />
<br />
If we could reduce the engine speed to ½ we would save 0.15GPH in fuel. <br />
<br />
Take this example to say a 2Kw load and the ‘savings’ will be even greater.<br />
<br />
So what does this all mean? In short: run that fixed speed AC generator under a light load if just wasteful. Problem is most all AC generators run at a fixed speed, no matter how much of a load you put on them. It is the nature of needing to produce a stable 50 or 60Hz AC frequency. DC generators do not have that restriction and can be used at any RPM (just like the alternator in your car – and also some AC ‘inverter’ generators ala the small Honda’s). Being able to adjust an engines speed to match its load can pay off. <br />
<br />
And here is where a DC generator with engine speed control can help. Just like this integrated engine speed controller does. In my quest to improve the efficiency of our DC generator looks like this is one significant factor that is already accomplished.<br />
<br />
<br />
BTW: Here is another paper from Virginia Tech that goes into more detail, and even has some formulas for predicting engine performance at many different RPM and load points:<br />
<a href="https://pubs.ext.vt.edu/442/442-073/442-073_pdf.pdf" target="_blank">https://pubs.ext.vt.edu/442/442-073/442-073_pdf.pdf</a><br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9VjGE-PwWMNrOI18S8iJsBVw7d0dOqsaAzNmJeywKjyeATQHDsoUumKHKd5pZe83OZ3Y1OJFn_6dK7F4doFWxmwTYsWIlB9hYZZKia4kMhSM2_n77O62ShrveO9vnyhRWdkUl2nhRmW2N/s1600/6BTA5.9+Test+Results.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-73018669406669031162015-05-20T08:20:00.001-07:002015-11-09T17:22:43.110-08:00Improving efficiency of DC generator - alternator configurationThis post is not directly related to the DC Generator controller, but I figure it is related and relevant.<br />
<br />
This year I have altered the alternator being used on our Kubota EA-300 based DC generator, switching out a large framed 130A alternator for an even larger framed 200A one. Though the more interesting part is I also adjusted the drive ratio from 2.5:1 to 1:1 (More detailed here:<br />
<a href="http://mvvikingstar.blogspot.com/2015/05/improving-dc-generator-efficiency.html">http://mvvikingstar.blogspot.com/2015/05/improving-dc-generator-efficiency.html</a> )<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6-t63Y18OTQ1frxb4ogMJbwQOMKZs1WRaB6reyfSUeT5NvYQRk6frwDbWit7egfJhyphenhyphenJukV7JAMV433yHZlRF__XqYW4xrzPsNgX6UPrX2toV4YYT73SEIiPyA4bRNPwJ5bhQxzewpf8Tx/s400/Alternator+Efficency+vs+RPMs.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6-t63Y18OTQ1frxb4ogMJbwQOMKZs1WRaB6reyfSUeT5NvYQRk6frwDbWit7egfJhyphenhyphenJukV7JAMV433yHZlRF__XqYW4xrzPsNgX6UPrX2toV4YYT73SEIiPyA4bRNPwJ5bhQxzewpf8Tx/s400/Alternator+Efficency+vs+RPMs.png" width="320" /></a></div>
<br />
My reason for doing this is alternators loose efficiency as RPMs are increased. By using a larger alternator, and turning it slower, I have picked up perhaps 7% in overall system efficiency. A very nice gain.<br />
<br />
But it occurred to me there is even better news here: The controller's active throttle control matches engine speed to the load it is being asked to drive, slowing the engine down during the last potion of the Acceptance phase of battery charging. Guess what: This slowing down just pushes us into a more and more efficient operation range for the alternator! Though I have not measured it, it does occur to me that during those final 'packing it in' phases which lead-acid batteries oh so like and need for proper health - we get an additional benefit of even higher overall system efficiency.<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-29916461902184842192015-03-04T13:25:00.001-08:002015-03-04T13:25:21.777-08:00Source Code v0.1.6 releasedToday I posted source version 0.1.6 for the SERC (Controller) source code. The remote source is unchanged, and there has been no additions to the config.h include files. See the above Source resource tab to download the new code.<br />
<br />
The reason for this release is to bring the DC Generators core regulation functions back in step with changes which have been made in the stand alone Arduino Alternator Regulator source. These mainly focus on the core mange_alt() function and include:<br />
<ol>
<li>Expansion of P&D engine to include 'I' factor, now a full PID capable engine.</li>
<li>Improved field PWM error summing to prevent one factor from overwhelming others when regulation is close to its goal (esp Voltage)</li>
<li>Adjusted pull-back factors, to lessen the dramatic pull down associated with common load-dumps</li>
</ol>
Some other bugs have been corrected, see the change log for more details. Along with the above core changes, I have also adjusted the default PID tuning values - based in feedback from others and trials on Viking Star. The original values were developed with a small-frame alternator, and turned out to provide insufficient sensitivity when a larger alternator was used - esp in conjunction with a high acceptance rage battery such as AGM or perhaps LiFeP04 technology.<br />
<br />
Over the coming months I hope more can be learned about the core regulation engine, and perhaps further refinements can be made to the PID tuning. Given the common code base between the DC Generator and the stand alone Alternator Regulator there is opportunity for all to help in any future adjustments.<br />
<br />
There had been no changes to the configuration.h file, so if you have already edited a copy of that to match your system - just download the core .INO source file and team it up with your edited config.h file. That way you will get the new code, and retain your individual customization.<br />
<br />
<br />
A final note: Over the past few days I have completed a changeover to the newest Arduino IDE release v1.6.0 This release of source was tested using the new IDE, and going forward will continue to keep largely in step with the RELEASED (non beta) versions of the Arduino IDE. I suspect the DC generator source will work OK with the prior IDE released (1.0.5, or 1.0.6), but have not been actively using those for about a week now.<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-64411836089160136132014-08-05T12:03:00.002-07:002014-08-05T12:18:08.099-07:00Capturing log data for assessmentThe Arduino Integrated Controller and Alternator Regulator will output a stream of ASCII data via the service port providing details on its current operation. I have used these dumps to help improve the PID engine tuning as well as resolve issues. In this Blog post I want to describe one way to capture log data into a .txt file, and perhaps ask that folks send in a few of these so I can improve the base code.<br />
<br />
To capture the ASCII stream, you will need to do the following:<br />
<ol>
<li>Attach a USB <--> TTL adapter to the Service Port</li>
<li>Open up the Arduino IDE</li>
<li>Select the serial port used by the USB <--. TTL adapter in Step #1 via <i>Tools/Serial Port</i></li>
<li>Make sure the correct Board type is selected via <i>Tools/Board</i> (Arduino Uno for the controller)</li>
<li>Open the Controller 'sketch' (source code).</li>
<li>Un-comment the line <i>#define DEBUG</i> (remove the two // at the start of the line)</li>
<ul>
<li>This will cause an extra set of debug information to be sent to the serial port.</li>
</ul>
<li>Consider changing <i> "#define SDM_SENSITIVITY 20" </i> in the source code from 20 to a smaller number, especially if looking at load-dumps, or some odd issue. This #define controls how may times through manage_alt() before a debug string is sent out. Setting it to 1 gives the most data, and the largest files.. </li>
<li>Upload the new sketch.</li>
</ol>
<br />
<ol>
</ol>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCGuBb7A3HlyXsP1uWXYUvQmGNJ5pP-i-yK53fADp25JGjKdnKqSWDiYXyLFEJHbsbA11VmKV3a_Uyu9e6KMZgx7PhOQihfUwhhi8I1F-gR4VHd5MGJH5rG8LrZ6y6sjefMHeV5Ny9Ir-E/s1600/Gen+Putty.pgn.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCGuBb7A3HlyXsP1uWXYUvQmGNJ5pP-i-yK53fADp25JGjKdnKqSWDiYXyLFEJHbsbA11VmKV3a_Uyu9e6KMZgx7PhOQihfUwhhi8I1F-gR4VHd5MGJH5rG8LrZ6y6sjefMHeV5Ny9Ir-E/s1600/Gen+Putty.pgn.png" height="176" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Example debug output.</td></tr>
</tbody></table>
You now have an option. You can remain in the Arduino IDE and open the Terminal window to see the ASCII data - I find unclicking 'auto scroll' helps make things run a bit smoother. Then after some amount of data is there, so a copy-n-paste into a standard text editor (ala, notepad), finally saving the file in .TXT form.<br />
<br />
Oh you can use a 3rd party terminal program. Myself, I like to use PuTTY as it is simple, reliable, fast, and you can enable it to automatically capture the .txt file. To use PuTTY take note which serial port is being used by the Arduino IDE to communicate with your controller (Step #3). Then download PuTTY using the following link: <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank"> http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html</a><br />
<a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank"></a><br />
Once installed, open PuTTY and make the following changes:<br />
<ul>
<li>On the opening screen (Session screen), enter the Serial port and Speed from step #3 above. Click the '<i>Serial' </i>button.</li>
<li>On the Session/Logging screen, click the <i>'Printable output'</i> button and enter a log filename. Each time you run PuTTY data will be captured into this log file.</li>
<li>On the Window screen, change the columns to something large, like 400.</li>
<ul>
<li>Not really needed, the log file will be OK w/o this change. </li>
<li>Just makes the visible screen look a little nicer.</li>
</ul>
<li>Then go back to the Sessions screen and click the <i>'default setting' </i>profile and press the <i>Save </i>button.</li>
</ul>
Now each time you start PuTTY it will open to the correct port, and automatically start saving a data log. Press the 'Open' button on the bottom to connect to the controller and start a data capture session. When finished, just close the window and the log file will be saved. Rename this to something meaningful, and perhaps edit using notepad to add in some details about the captured run, ala alternator / engine / battery size. Any unusual event - like a washer/dryer running during Float mode, other charging sources. Anything you think might be relevant.<br />
<br />
If you would then Email it to me, I can use it to help look for ways to improve the code.<br />
<br />
You can look for the function <i>debug_print_common()</i>; to get an idea what data is being sent out. And if you do have any issues with the generator, make sure to set the sensitivity to 1 and capture all the data. Note that the 1st number sent out is a time mark, so in the preamble it would be good to comment on what you see going wrong, and referencing to the approx timestamp if you can.<br />
<br />
And when finished you can reload the firmware with the #define DEBUG commented out - disabling the ASCII strings. Not sure it really matters, I tend to leave DEBUG mode enabled on my generator.<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-22501544692341663302014-08-04T12:52:00.001-07:002014-08-04T12:52:52.268-07:00Which CPU can I use for CAN???With solid requirements a designers job is simpler - choosing the components that meet the needs, at the lowest cost. But when the requirements are opened ended, it is tougher. The past few days I have been looking into ways to get CAN and a small micro-controller together, still not sure I have the full answer.<br />
<br />
I think 1st I want to limit things to what can be used with the Arduino IDE. Given the home-brew nature of this project, Arduino's low cost (free) tools, combined with some per-defined wrappers / libs makes thing a little more easier for a wider range of people. With this as a framework, I think there are three viable approaches:<br />
<br />
1) Use Arduino UNO ATmega328p CPU + MCP2515 CAN controller<br />
2) Use Arduino Due ATSAM3X8EA CPU, it has dual integrated CAN controllers.<br />
3) Use Atmel AT90CAN32 CPU: A kind of 'grown up' ATmega328 CPU, it has a single integrated CAN controller and several more I/O ports.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8crzazbY84RzclkEaEbZZCWVxYE9cp1U-ZEngv_rCW4pLOexF2cbVXvBLUE6fwquq9Su7wAqWlpqNY78oiNHFWSGeroCUw98Y2MvNXDqhLhvAnXqlHto0dJ_1eNuQXagwCET8rpWlKM-o/s1600/328p.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8crzazbY84RzclkEaEbZZCWVxYE9cp1U-ZEngv_rCW4pLOexF2cbVXvBLUE6fwquq9Su7wAqWlpqNY78oiNHFWSGeroCUw98Y2MvNXDqhLhvAnXqlHto0dJ_1eNuQXagwCET8rpWlKM-o/s1600/328p.png" height="272" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Uno</td></tr>
</tbody></table>
Option #1 would be the lowest cost ($5.10 using Mouser pricing), and I <i>think </i>I
can get all the current controller functionality supported if I shift
around some ports and all but eliminate the expansion connector. <br />
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvc-kNUW9eJ-C6k3tCFPYwLhdi-ej9Jai6QG94Q1DHp3m6ucNNsGndHfeGcuAyYR6AMts1ogYR6EI_8Df4rkJ6PZipoKN75nRmDxUkcFoRxb3Tp7cddSizwxAGrPcWanCZC6HzgjBsmGDB/s1600/ATSAM3X8E.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvc-kNUW9eJ-C6k3tCFPYwLhdi-ej9Jai6QG94Q1DHp3m6ucNNsGndHfeGcuAyYR6AMts1ogYR6EI_8Df4rkJ6PZipoKN75nRmDxUkcFoRxb3Tp7cddSizwxAGrPcWanCZC6HzgjBsmGDB/s1600/ATSAM3X8E.png" height="227" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Due</td></tr>
</tbody></table>
Option #2 is perhaps an overkill. But the two CAN ports could come in
useful to support a low-speed and a special low-latency bus. The
ATSAM3X8EA increases program space from 32K to a whopping 512K!
Downside: Cost - $13.51, perhaps a bit higher as I look more into what
is truly needed for USB communication.<br />
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNvhRgvjTcPHWymQxCR_BG6VhHZQnkdZX6fWcGHEZYQEYB87A2GNUAhMFpHYE92aX9PerNcGbWs4hGrQvlqV04p7-f2SHXcrDUfM1fSYOP0zmd2yAyd-bdhZyvWVkbd3zGy8WqHAs4DYCG/s1600/at90can32_16au.jpeg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNvhRgvjTcPHWymQxCR_BG6VhHZQnkdZX6fWcGHEZYQEYB87A2GNUAhMFpHYE92aX9PerNcGbWs4hGrQvlqV04p7-f2SHXcrDUfM1fSYOP0zmd2yAyd-bdhZyvWVkbd3zGy8WqHAs4DYCG/s1600/at90can32_16au.jpeg" height="267" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Something else?</td></tr>
</tbody></table>
Option #3 is somewhere in the middle. Its cost is $7.10 - though it does not have the real killer capability as option #2, there are pin compatible versions available which increase the programming space from 32K to 64K and even 128K - for a price of course: $9.00 & $11.33 respectively.<br />
<br />
<br />
In addition, each of the options will require some extra work in the power supply, and close care with power down modes - as with CAN the controller needs to be alive all the time looking for a call to start generating...<br />
<br />
<br />
Clearly option #1 is the lowest cost, and its MCP2515 is somewhat supported in the Arduino community. But I am kind of leaning towards option #3. Though a little higher cost, it comes with more I/O capability that I could use to provide additional functions w/o an expansion board (ala, controlling external cooling pump & monitoring the watermaker pressures). Though I could add those capabilities w an expansion board, but the time one purchases the I2C chips, the cost advantage of option #1 is lost.<br />
<br />
#2 is such an overkill, and as well as the highest cost. I also kind of wonder about the future of the Due. Today I noted two new Arduino offerings, the Treo and the Zero. Both are high power RISC machines, and I really wonder if the Due's popularity will be effected by them. . . .<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-6327381600365895712014-07-31T07:09:00.001-07:002014-07-31T07:09:15.491-07:00Looking at CAN - Control Area NetworkFor some time now I have been looking at other ways to communicate between the controller and the LCD remote. A big part is that I now use a 2nd ATmega328 CPU on the remote LCD, and it now can do intelligent processing. The idea would be instead of the controller doing all the display rendering, it simply sends over status and the LCD figures out how to format and display it. So instead of sending "On line 2, column 4 put a '1', then a '4', then a '.' and finally a '3'" to update battery voltage, the controller will simply send "Battery voltage is now 14.3v".<br />
<br />
In addition to distributing the work between the two controllers a bit, this also will allow more advanced options for the LCD display. Maybe adding a graphic, or some combination of key switches to select more modes of operation / configuration changes. And perhaps lower costs some as the P82B96's I2C extenders are getting more
costly every day, now at $3.10, and under $1.50 when I 1st started
using them.<br />
<br />
An obvious approach is using ASCII strings much like the Arduino Alternator Regulator does. Sending and reciving via the serial port, likely using an RS-485 or RS-422 current loop to do the actual communications. Advantage is the ASCII is human readable, and easily connected to other devices ala PCs..<br />
<br />
<br />
<br />
But I have also been looking into a CAN (Control Area Network) as a way to communicate. <a href="http://en.wikipedia.org/wiki/CAN_bus" target="_blank">http://en.wikipedia.org/wiki/CAN_bus</a><br />
This technology has been around a LONG time, is well developed, and parts are common as well as inexpensive. With 100's of CAN controllers in many automobiles, there are also a wide range of hardened components out there. It is what NMEA-2000 is built upon.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://upload.wikimedia.org/wikipedia/commons/7/7f/CAN-Bus-frame_in_base_format_without_stuffbits.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://upload.wikimedia.org/wikipedia/commons/7/7f/CAN-Bus-frame_in_base_format_without_stuffbits.png" height="148" width="640" /></a></div>
<br />
Using CAN would allow me to have one wire connected between the controller and the LCD remote. But it also would allow for things like moving all the battery senders off the controller and on to its own little board located at the battery and connected via one wire into the CAN bus. Vbat, Amps, and Temperate. More so, this same information could be shared with a CAN enabled Alternator regulator.<br />
<br />
Though the low-level hardware stuff is standardize, how information is communicated is a different thing. There are several 'standards' out there for packaging up data to send over a CAN bus - NMEA2000 being one, but lots others as well. And beyond that, most deployments tend to define their own standards...<br />
<br />
And one downside to CAN: it is NOT human readable, one needs a PC to receive the data and 'translate' it into something usable for people's eyes. But that is not that hard, CAN-USB adapters are available for under $10 - mostly by the auto guys who want to tap into cars CAN networks. And a small program is not that hard to write to convert... Once you know the 'standard' begin used to communicate over the hardware. And I think even if going to CAN bus, would need to retain the Service port / ASCII interface.<br />
<br />
My head is spinning more then anything at this time, I welcome any comments from people about the CAN bus and its usability...<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-43991170869666183512014-07-20T20:25:00.002-07:002014-07-27T10:14:19.926-07:00Configuring for your system - editing the SERC_config.h fileThere are perhaps 150 different configuration parameters for the Integrated Engine controller and Alternator Regulator, far too many to so via the LCD screen. Options to select modules to include (ala, Water maker, engine co-gen mode, etc). Options defining some board specific changes (TLE5206 vs TLE5205). Battery profiles, engine capabilities, alternator size. Break-in mode, and even how long you want the LCD to remain back-lite and your name..<br />
<br />
Almost all these options are defined via the<span style="font-family: "Courier New",Courier,monospace;"> SERC_config.h</span> file. There are a few options contained in the main source code, ala to enable Debug or Testing mode. But by and large, once you edit the .h file you can maintain your configuration decisions with newer updates to the source code. This Blog post will cover how to configure a system, and is done using source v0.1.6 - and a final note: Though examples are shown here, often the formatting is off, or odd. The actual source code and .h file can be a bit easier to follow, and also include many additional comments on how to set these parameters and what they mean.<br />
<br />
<br />
<h2>
Step 1: Gather information:</h2>
We need to know details about your battery, alternator, and engine. Specifically find the following details:<br />
<ul>
<li>Battery capacity and charge profiles. Check the 'resources' tab above for a collection of specs from different manufactures (and send me new ones if you have them). We want to know recharge profiles, limits and exit criteria: Volts, Amps as well as adjustments and charging limits due to temperature.</li>
<li>Engine Capabilities: Speed / HP table being most critical. </li>
<li>Alternator capacity - You can specify a lower number of Amps then the 'label' if you are concerned about burning out a small alternator by overloading it.</li>
<li>Drive ratio and Alternator polls: Side of engine and alternator pulley as well as # of poles in the alternator (Used to calibrate RPM measurement) </li>
<li>Addresses for your DS18B20 temperature probes. (Click on the Installation tab above and scroll down to the 'Temperature Sensing' section) </li>
</ul>
<br />
For this example, we have a system as follows:<br />
<ul>
<li>Kubota EA-300 engine driving an xxx alternator</li>
<li>Engine is new, we need to break it in.</li>
<li>Will at some time include a Watermaker</li>
<li>Batteries consist of 3x Daka 8A8D (245Ah) AGM batteries in parallel</li>
<li>Pulley ratios are: 7.0" and 2.6", alternator has 14 poles.</li>
</ul>
<br />
<ul>
</ul>
And from the Deka Tech bulletin found in the reference section I find the following guidance:<br />
<blockquote class="tr_bq">
<blockquote class="tr_bq">
Bulk = Max 30% of c/20 rate (73.5A per battery -> 220A the 3 battery system)<br />
<br />
Max Volts = Absorption<br />
<br />
Absorption = 2.35-2.40 vpc (14.10 - 14.40v)<br />
Max time: 12hr<br />
Exit Amps: <0.10A change over 1hr period.<br />
<br />
Float = 2.24 - 2.26vpc (13.44 - 13.56v)<br />
<br />
Equalization: 2.40 - 2.43vpc (14.40 - 14.60v)<br />
Max time 12hr<br />
Exit Amps < 0.10A per Ah<br />
<br />
Temp Co = -3mv/cell/C (-10mV/f for 12v) - centered on 25c/77f nominal<br />
Cap limit adder at 35c(95f) and 15c(59f)</blockquote>
</blockquote>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h2>
Step 2: Edit <span style="font-family: "Courier New",Courier,monospace;">'SERC_config.h'</span> file:</h2>
The configuration file is grouped...<br />
<br />
<h3>
Modules to Include and Hardware Options</h3>
#defines will control switches in the source to code to include and exclude different modules. Care should be taken here as some modules re-purpose controller ports, ala the Watermaker, Co-Gen and Engine Temperature Control modules all can make use to the W-Mkr port on the controller board.<br />
<br />
Remove the '//' in front of the modules you wish to include (commenting them), adding // to modules you do not wish. (This same method is used in the main source to enable/disable debug and testing modes)<br />
<br />
<div style="border: 1px solid #ccc; font: 12px Courier,monospace, Serif; height: 250px; left: 20px; overflow: scroll; position: relative; white-space: nowrap; width: 620px;">
//#define INC_WM //------- Define this to enable Water Maker mode of operation.<br />
//#define INC_CG //------- Define this to enable Co-generation (waste heat) mode (Note, CG, WM, and ET mode can NOT be combined w//o hardware change)<br />
//#define INC_ET //------- Define this to enable Engine Temperature control. (Note, will use CG/Wm FET driver if those other uses are not enabled. Else will use expansion port)<br />
//#define INC_OC //------- Define this to enable OverCharge mode - often used for AGM batteries.<br />
//#define INC_AG //------- Define this to enable Generator Auto Start (Called: AutoGen _AG, not AutoStart A_) mode<br />
<br />
<br />
#define CHK_OP_SENDER //------- Define this to enable Oil Pressure Sender check. Only do this if oil sender is attached.<br />
//#define CHK_WF_SENDER //------- Define this to enable Water Flow Sender check. Only do this if Water Flow is attached.<br />
// The above two checks will cause a fault if the engine status is stopped, but Oil Pressure and/or Water Flow is still<br />
// being indicated by the externals senders (e.g, they did not ground their respective pins when the engine is off.)<br />
// If that is true, you might have an open wire or broken sender . . . . <br />
// Also, if these senders are not installed, or are not stable, comment out the #define.<br />
//#define CHK_WM_SENDERS //------ Define this to enable checking of Water Maker Pressure Senders, looking to see if pressures are out of range..<br />
<br />
<br />
<br />
<br />
#define BREAKIN_ENGINE //----- Define this to enable break-in modes, currently: Run alternator at 1/2 of load, and disable Alternator during watermaking.<br />
<br />
#define SYSTEM_NAME "Your Name Here - DC Gen" // Change this string to something about YOUR system, it will be printed out at startup on the Debug screen. <br />
// This way you can dbl check to make sure you are using the include file which has been customized for YOUR system, as opposed to default one..<br />
</div>
<div style="text-align: center;">
<u>Review and select which modules to include</u></div>
<div style="text-align: center;">
<br /></div>
I de-selected all options at this time, except the Oil pressure sender checking. We can add the watermaker at a later time.<br />
<br />
<br />
<br />
Next make sure the hardware selections match the revision and configuration of your boards. There are only a few common options, and the source code has some more details (like resister divider ratios if you change them from the recommended values)<br />
<br />
<div style="border: 1px solid #ccc; font: 12px Courier,monospace, Serif; height: 150px; left: 20px; overflow: scroll; position: relative; white-space: nowrap; width: 620px;">
#define TLE5206_2 // A better H-Bridge, can use pull down resister R60/R61 to assure throttle motor is not enabled when controller is powered down.<br />
#define INA_226 // Improved version of INA_226. Can natively support 12 & 24v systems, and allows for better resister divider support.<br />
<br />
//#define TLE5205_2 // Old H-Bridge, has potential to leave drive motor engaged when controller is powered down.<br />
//#define INA_220 // Origional Volts / Amps sampling chip. Has limitations impacting systems greater then 12v, see Blog.<br />
<br />
<br />
<br />
#define PCB_0_3_x // PCBs v0.3.x and above have some slight differances, chiefly: FET driver charge pump, and inverting schmit trigger in Stator line, and <br />
// an extra internal A/D ports which can be used for Watermaker pressure</div>
<div style="text-align: center;">
<u>Review and select hardware options matching your controller board.</u></div>
<br />
No changes here as this is for the latest board design.<br />
<br />
<br />
<br />
<br />
<h3>
Critical Faults and Limits</h3>
Many ports in your system can be monitored. Temperatures (engine, Battery, Alt, cooling water), voltages, amps to name a few. Often actions are taken to adjust the running the the generator based on these values, for example - battery target voltages are often adjusted based on the battery temperature. But if things really get out of hand we just want to stop everything. That is what this section is for. it defines critical values and limits that if exceeded will shut things down. These checks are done in a dedicated function, independent of the normal runtime code.<br />
<br />
You might want to adjust some of these parameters after the system has ran a while. <br />
<br />
<div style="border: 1px solid #ccc; font: 12px Courier,monospace, Serif; height: 250px; left: 20px; overflow: scroll; position: relative; white-space: nowrap; width: 620px;">
<br />
// ----- Critical fault values: exceeding these causes system fault and fault handler.<br />
//<br />
#define FAULT_EGT_TEMP 1.05 * EGT_SETPOINT // Above this, fault out. (All Temps are in F) 5% over EGT.<br />
#define FAULT_ENGINE_TEMP 220 // Fault if above this<br />
#define FAULT_STARTER_AMPS 275 // If starter draws more than this, we assume it is frozen and faulted.<br />
#define FAULT_EXT_TEMP_DELTA 20 // If we see the Exhaust mixer 20f above the sea water temp, fault<br />
#define FAULT_EXT_TEMP 100 // If we see the Exhaust mixer above this temperature (150f), fault<br />
#define FAULT_SWP_TEMP 150 // If the Sea Water Pump is above this temp, Fault.<br />
#define FAULT_BAT_VOLTS 14.9 // This is where we will fault. Make sure you have sufficient headroom for Over Charge voltage (if being used)<br />
// Note this limit is NOT adjusted for battery temperature, it is an abs limit. (14.9 for AGM batteries)<br />
#define FAULT_BAT_VOLTS_LOW 7.0 // Anything below this means battery is damaged, or sensing wire is missing / failing.<br />
#define FAULT_BAT_VOLTS_DELTA 0.2 * FAULT_BAT_VOLTS // If battery voltage measured by the raw (Amtel) and the ina-22x's disagree by more than 20% of expected, fault.<br />
#define FAULT_BAT_TEMP 140 // in degrees-F<br />
#define FAULT_ALT_AMPS 1.2 * ALTERNATOR_SIZE // If over alternator's rating by 20% <br />
#define FAULT_ALT_TEMP 1.2 * ALT_TEMP_SETPOINT // in degrees-F <br />
#define FAULT_ALT_WATTS FAULT_ALT_AMPS * FAULT_BAT_VOLTS<br />
#define FAULT_ENGINE_RPMS 1.2 * ENGINE_MAX_RPM // Fault if 20% over speed.<br />
#define FAULT_ENGINE_LUGGING 0.15 // Fault out if we are not able to reach within 15% of demonstrated Max RPMs while at Full Throttle.<br />
#define FAULT_STARTER_STUCK_AMPS -30 // If Amps measured less then this value while the engine is running, we can assume the starter is stuck ON...<br />
#define FAULT_ENGINE_HOLDOFF 10000 // Do not check for engine faults until it has been running for 10 seconds, give it time to stabilize temps and Amp draws, oil-pressure, etc. after starting.<br />
<br />
<br />
//----- Watermaker monitoring is interesting. Becasue it is manualy adjusted, the controller has no real idea the actualy operating state of the<br />
// watermaker. However, we do want to watch for conditions that can cause damage. So, for the Fault testing we will check to see if<br />
// either of the pressures goes above a specific limit. And when we think the system is 'operating' we will watch the pre-filter pressures<br />
// to make sure they do not go below a specific limit (we do not want the pre-filters to go into a vacumn state either!) We will use the<br />
// measured PSI on the HP side to decide if the water maker is 'active' or not.<br />
#define FAULT_WM_HP_MAX 1200 // Fault out if the Watermaker HP pump pressure goes above 1200 PSI<br />
#define FAULT_WM_PFP_MAX 45 // Fault out if the Watermaker pre-filter pressure goes above 45 PSI . . <br />
#define FAULT_WM_PFP_MIN 10 // .. or below 10psi<br />
#define CHECK_WM_PFP_ABOVE 200 // (And check for this min PFP value if the HP pressure is above 200psi)<br />
<br />
#define WM_PFP_FULL_SCALE_PSI 50 // Calibration for the Watermaker Pre-Filter pressure sender. At Full Scale, what is its PSI<br />
#define WM_HP_FULL_SCALE_PSI 2000 // Calibration for the Watermaker High-Pressue pressure sender. At Full Scale, what is its PSI<br />
// If using v0.3.x of PCB or higher, connect Pre-Filter pressure sender to A6, and HP pressure sender to A7 on the main board expansion port.<br />
// If using a prior PCB, add an external PCF8591 I2C A/D at address 0x48 (All address pins grounded on the PCF8591), and <br />
// connect Pre-Filter pressure sender to Channel-0 (Pin 1), and HP pressure sender to Channel-1 (Pin2) on the PCF8591</div>
<div style="text-align: center;">
<u>Review and adjust critical limits if desired.</u></div>
<br />
Here I only changed the Fault_bat_volts from 16.8 to 14.9v. Because AGM batteries are being used. I calculated the 14.9v based on the max allowable change for temperature compensation around the max 'equalize' voltage allowed. Remember, this value it to catch things that have gone very very wrong - meaning the core code has failed. The fault voltage will be checked against both the INA226 measurement, as well as an additional raw Atmel A/D reading as a dbl check.<br />
<br />
If the system does not use sea water cooling, I do not need to worry about the checks for Sea Water Pump, or Exhaust Mixer, as if no temperature sender is installed those checks will by bypassed.<br />
<br />
<br />
<br />
<br />
<br />
<h3>
System Tuning Parameters </h3>
The next section likely will not need to be changed. It defined timings used to manage the engine, example: How long should we 'jab' the throttle control motor each time we want to make a speed adjustment, and how long should we wait to see the results of that 'jab'. Other timings like how long we stay at idle before starting to ramp up RPMs after starting, how long to crank the starter and how many times to try it... <br />
<br />
<div style="border: 1px solid #ccc; font: 12px Courier,monospace, Serif; height: 250px; left: 20px; overflow: scroll; position: relative; white-space: nowrap; width: 620px;">
#define ENGINE_PRE_START_WARNING 500 // When being asked to start, sound the buzzer for 1/2 a second 1st to give people notice.<br />
// This is also used to cycle the throttle 1 second up, and 1 second down.<br />
#define ENGINE_PRE_START_WARNING2 3000 // And then wait 3 seconds before doing anything. (Be careful not to make this too long, else Watchdog will trigger)<br />
// (Set these two = 0 to disable startup warning buzzer)<br />
#define ENGINE_PRE_START_CRANK 0 // Give engine a short shot to make sure raw water pump is loosened up. (150 is a good number, Set = 0 to disable)<br />
#define ENGINE_PRE_START_REST 2000 // And rest 2 seconds after this short shot.<br />
#define THROTTLE_TO_IDLE_DELAY 1300 // This is the amount of time needed to move the throttle cable from Full Stop to the presumed<br />
// idle (starting) position. It is used in start_engine() to initially position the throttle cable during start up.<br />
// You will need to experiment some to get this number dialed in for your system.<br />
#define START_THROTTLE_BUMP_WIDTH 100 // Between start attempt cycles, we will advance the throttle this much more. <br />
// (Set this to 0 if you do not want the throttle to advance between start attempts. )<br />
<br />
#define ENGINE_GLOW_PLUG_DELAY 5000 // 5s for Glow Plug before starting to crank MUST BE > STARTING_CHECK_RATE<br />
#define ENGINE_START_CRANK 5000 // Crank for no more than 5 seconds per cycle . . MUST BE > STARTING_CHECK_RATE<br />
#define ENGINE_START_REST 4000 // . . . rest 4 seconds MUST BE > STARTING_CHECK_RATE<br />
#define ENGINE_MAX_START_TRY 4 // And try starting 4 times before giving up.<br />
#define STARTING_CHECK_RATE 100 // Check the engine every 100mS to see if it has started (via AMPs or RPMs)...<br />
#define ENGINE_POST_START_HOLD 40 // Keep the starter engaged for 40mS seconds after started, just to be sure....<br />
<br />
#define ENGINE_WARMUP_DURATION 60000 // Once started, let the engine warm up 60 seconds before placing a load on it.<br />
// The throttle will also be advanced over this time to Full On in anticipation of having to do something..<br />
#define WARMUP_IDLE_DURATION 10000 // And let 10 of those seconds be for just idling.<br />
#define WARMUP_RAMP_RATE 900 // This controls how quickly the throttle is increased during Warm-up. <br />
// It is the amount of delay between ;THROTTLE_PULSE_WIDTH Throttle-up shots.<br />
// Adjust it so that the throttle advances in the time remaining in the warm-up period after the idle delay.<br />
// to allow the engine to reach full throttle before the warm-up period ends. <br />
<br />
<br />
<br />
<br />
<br />
//----- This is how we can decide of the engine has started. Either by looking for a large drop in Starter AMPs draw, or via RPMs picking up.<br />
<br />
#define STARTED_AMPS_THRESH 0.50 // When we see the Starter amp draw drop to 50% of full load, we will assume the engine has picked up.<br />
// Note: In order for this feature to function, the alternator AND the Starter must share a COMMON<br />
// AMP shunt. Even if they are different voltages. Using a common GROUND shunt will often meet<br />
// this. However be careful of unwanted currents from a 2nd charging source (e.g. starter's battery)<br />
// that can cause errors in the main alternators current reading. See the Blog for more details.<br />
// If this method is selected, it is suggested to disable the Started by RPMs method below.<br />
// Set this variable = 0 to disable started determination by Starter amp draw.<br />
<br />
#define STARTED_RPM_THRESH 0 // This is the number of RPMs that must be achieved in order for the controller to recognize that the engine has<br />
// started. In order for this method to function, the FIELD_PWM_MIN variable must be configured to allow for <br />
// RPM measurements via the alternator even if it is not charging. Note, this can cause issues with excessive <br />
// starter current draw as well as potential battery overcharging. See Blog for more details.<br />
// Set this variable = 0 to disable Started by RPMs method.<br />
// NOTE: CURRENTLY RPM MEASUREMENT DURING STARTING IS NOT VERY STABLE. I HAVE DISABLED IT IN THE DEFAULT CONFIG, BUT LEFT<br />
// THE CODE IN PLACE - PERHAPS IT WILL WORK BETTER ON SOMEONE ELSE’S SYSTEM.<br />
<br />
<br />
<br />
//------- And here are delays used when doing normal shutdown of the engine. To allow for a cool-down period.<br />
#define ENGINE_COOLDOWN_DURATION 30000UL // 30 second cool-down period with no load while stopping. Also return throttle to Idle.<br />
// Set = 0 to skip cool-downs. In a FAULT condition the cool-down period is skipped. <br />
#define ENGINE_POST_STOP_LOCKOUT 10000 // Allow 10 seconds after releasing throttle to Full Stop position before you try anything else. <br />
// To make sure the engine has spun down before trying to say restart. (Note UL is not used on this #define.) <br />
<br />
<br />
<br />
<br />
<br />
// ------ Engine engine operational parameters<br />
<br />
#define THROTTLE_PULSE_WIDTH 20 // When fine-tuning throttle, pulse it this much each time we make an adjustment, then wait settle time<br />
// (BE CAREFUL WITH THIS DELAY, It is a brute-force delay in adjust_throttle() function, make it very <br />
// very short... Better to have lots of small 'pulses' then one large / long one... ). If your engine hunts<br />
// too much when at mid-RPMs, try reducing this value.<br />
#define THROTTLE_SETTLE_PERIOD 750 // After fine-tuning throttle, wait this long (3/4 second) for RPMs to stabilize at new throttle position<br />
#define EXIT_QUITE_MODE_HOLDOFF_PERIOD 5000 // If the systme has transitioned out of Quite Mode we need to hold off testing for Lugging during bulk this long<br />
// to allow for the engine to spool up to full throttle speed..<br />
<br />
<br /></div>
<div style="text-align: center;">
<u>Review and adjust as needed for different engines. Best to fine-tune these after system is running a while</u></div>
<br />
As these parameters are already adjusted for the Kubota EA-300, I made changes here.<br />
<br />
<br />
<br />
<br />
<br />
<h3>
System Running Parameters </h3>
This is where we enter the capabilities of the system. The engine speed/HP data, alternator size (Under specifying it if we want to limit the amount of heat the alternator has to put up with). We also define the max system capabilities in terms of watts - this should match the capability of your engine to keep it from being overloaded, while at the same time making sure we get the work out of it it is capable of.<br />
<br />
These values (combined with the battery charge profiles) are the core of the system - take time to review these and adjust them. After running a while, look at the debug data and make adjustments to these values. When setting up my system, I worked to get the Watts / Speed / HP limits close, but a little high. Then I let the EGT probe measure load on the engine and reduce things in real time. In this way the controller can adjust as needed depending on changing conditions such as air temperature, cooling water, etc. Get these values close - or low, and then adjust them up as you gain experience with your system.<br />
<br />
<br />
<div style="border: 1px solid #ccc; font: 12px Courier,monospace, Serif; height: 250px; left: 20px; overflow: scroll; position: relative; white-space: nowrap; width: 620px;">
<br />
<br />
<br />
<br />
#ifdef BREAKIN_ENGINE<br />
#define ALT_WM_WATTS_SETPOINT 0 // Do not allow co-gen during break-in of engine.<br />
#define EBIF 0.5 // During Engine Breakin we only want to run at 50% load.<br />
#else <br />
#define ALT_WM_WATTS_SETPOINT 875 // If not Break-in we can run, but at a reduced to 875w when watermaker is also engaged<br />
#define EBIF 1 // Not breaking inthe engine, allow 100% load.<br />
#endif<br />
<br />
<br />
#define ALTERNATOR_SIZE 150 // Size of Alternator in Amps. Will cap output if current grows above this, and Fault out if 20% higher.<br />
#define ALT_WATTS_SETPOINT 1880*EBIF // Set point for Max Watts (engine load) allowed . . . (6hp-cont @ 3,000 RPMs, 42% effic)<br />
<br />
<br />
#define ENGINE_TEMP_SETPOINT 180 // We want to run around this range. If anything above it, start backing off Alternator Field drive.<br />
// If INC_ET is enabled, the controller will work to keep the engine temp around this using cooling fan/pump before Alt.<br />
#define ALT_TEMP_SETPOINT 200 // 200f<br />
#define EGT_SETPOINT 935 // 935f<br />
<br />
<br />
<br />
<br />
<br />
<br />
int const RPM_Watts_array [][2] = { // This array is used to map RPMs needed to support a given wattage load in the engine.<br />
{1600, 2.8 *746*0.42*EBIF}, // (1st entry defines lowest speed we will run the engine under load, 1600 RPMs in this case) <br />
{1700, 3.2 *746*0.42*EBIF}, <br />
{1800, 3.6 *746*0.42*EBIF}, <br />
{1900, 3.9 *746*0.42*EBIF},<br />
{2000, 4.2 *746*0.42*EBIF},<br />
{2100, 4.5 *746*0.42*EBIF}, // Populate with RPM and the allowed watts for that RPM.<br />
{2200, 4.7 *746*0.42*EBIF}, // This array is used in the manage_engine() function.<br />
{2300, 5.0 *746*0.42*EBIF},<br />
{2400, 5.2 *746*0.42*EBIF}, // Alternator / system efficiency is assumed to be 42%<br />
{2500, 5.4 *746*0.42*EBIF}, // EBIF is Engine BreakIn Factor, reduced allowed load if BREAKIN_ENGINE flag is set.<br />
{2600, 5.5 *746*0.42*EBIF},<br />
{2700, 5.7 *746*0.42*EBIF},<br />
{2800, 5.8 *746*0.42*EBIF},<br />
{2900, 5.9 *746*0.42*EBIF}, // Spec maxs at 3,000 RPMS @ 6hp cont. <br />
{ENGINE_MAX_RPM, ALT_WATTS_SETPOINT}}; // End of array and will cause throttle to be Full on.<br />
<br />
<br />
<br />
#define RPM_SENSITIVITY 75 // If we are within +/- 75 RPMs of where we want to be, do not adjust the throttle.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
// ------ Parameters used to calibrate RPMs as measured from Alternator Stator Pulses<br />
#define RPM_IRQ_AVERAGING_FACTOR 100 // # sector pulses we count between RPM calculations, to smooth things out. 100 should give 3-6 updates / second as speed.<br />
#define IRQ_uS_TIMEOUT 10000 // If we do not see pulses every 10mS on average, figure things have stopped.<br />
#define ALTERNATOR_POLLS 14 // # of polls on alternator <br />
#define ENGINE_ALT_DRIVE_RATIO ((7.0 / 2.6) * 1.00) // engine pulley diameter / alternator diameter<br />
// * fine tuning calibration ratio. <br />
#define STARTING_FIELD_PWM 0 // Minimum alternator PWM value send to Alternator when Starting (See START_ENGINE() ). <br />
// Set this to a value sufficient to give Stator pulses and allow for RPMs to be measured, but not so high as to <br />
// actually start delivering amps. This value will need to be verified for each system. Being able to measure RPMs <br />
// while not charging is used during Starting to allow start_by_RPMS. <br />
// Set this value = 0 to disable RPMs measurements during starting. <br />
// Note: if STARTED_RPM_THRESH is set != 0, this value must also be non-zero.<br />
// NOTE: CURRENTLY RPM MEASUREMENTS DURING STARTING IS NOT VERY STABLE. I HAVE DISABLED IT IN THE DEFAULT CONFIG, BUT LEFT<br />
// THE CODE IN PLACE - PERHAPS IT WILL WORK BETTER ON SOMEONE ELSE’S SYSTEM.<br />
<br />
<br /></div>
<div style="text-align: center;">
<u>Adjusted as needed, and fine tune when system is operating.</u></div>
<br />
As this values are already set for a Kubota EA-300 system I made no changes. For the initial running the 'break-in' mode is selected, so we will be running with a light load (half power) anyway. Once break-in is finished we can see how these values fit the system. One parameter of particular interest is the Alternator_size; we might want to set this at either 220A to match the max current allowed for our 3x batteries, or perhaps set it for a slightly smaller size then the alternator specifications if we are worried about overworking the alternator (ala, using a small-frame alternator). Another parameter of interest is the Alt_watts)_setpoint: Here we can are the Alternator_size and Alt_watts_setpoint. It, combined with the HP/RPM table defines the load that will be placed on the engine.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h3>
Battery Charge Profile </h3>
This is the other key area of configuration - battery information. You have the option of configuring a standard 3-step profile (Bulk, Acceptance, Float) or 4-step (adding Overcharge step) for your system. Each phase has parameters to set voltage limits, time limits, and exit criteria. Here is also where you can select auto-stop; stopping the generator instead of remaining in Float mode.<br />
<br />
Note that because the controller measures Amps we have the ability to more closely follow manufactures recommended charge profiles. Specifically, we can <u>measure</u><i> </i>the current being accepted by the battery and use that to decide when to terminate the Acceptance phase - doing so when the battery is truly full. As opposed to using a time limit / guess. Even so it is a good idea to always define time limits, just in case - but make them long and let the Amps to the work!<br />
<br />
Note there is no equalize phase parameters, maybe I will add them in the future. For now to equalize perhaps make up a different include file and re-flash the firmware - restoring things once the equalize task is finished. <br />
<br />
<br />
<div style="border: 1px solid #ccc; font: 12px Courier,monospace, Serif; height: 250px; left: 20px; overflow: scroll; position: relative; white-space: nowrap; width: 620px;">
#define ACPT_BAT_V_SETPOINT 14.3 // Set point for Bulk and Acceptance battery voltage<br />
#define EXIT_ACPT_DURATION 12*3600000UL // Stay in Accept mode no longer then this in hours (12 hrs). <br />
#define EXIT_ACPT_AMPS 10 // If Amps being delivered falls to this level or below, exit Accept mode and go to next (OC or Float)<br />
// Set this = 0 to disable Amps based transition and only rely on timeout duration.<br />
<br />
<br />
<br />
// Overcharge mode is sometimes used with AGM batteries and occurs between Acceptance and Float phase. <br />
// In order to enable this feature, the '#define INC_OC' switch above must be defined and the OC_BAT_V_SETPOINT must be a<br />
// non-zero value AND the EXIT_OC_DURATION must be a non-zero time value.<br />
// If all three are true, the controller will add on an Over Charge mode following the Acceptance phase. <br />
#define OC_BAT_V_SETPOINT 0.0 // Set point for Over Charge battery voltage (Set this = 0 to disable)<br />
#define EXIT_OC_DURATION 0*3600000UL // Over Charge mode duration in hours. (Set this = 0 will also disable Over Charge step.)<br />
#define EXIT_OC_AMPS 0 // If Amps being delivered falls to this level or below, system will exit Overcharge mode and go to Float<br />
// Set this = 0 to disable Amps based transition and only rely on timeout duration.<br />
<br />
<br />
#define FLOAT_BAT_V_SETPOINT 13.5 // Set point for Float battery voltage<br />
#define EXIT_FLOAT_DURATION 0.0*3600000UL // Stay in Float Mode no longer then this (e.g. 0.5 hrs = 0.5*3600000UL). System will then auto-stop and return to Ready status. <br />
// Set this variable = -1L to disable time based auto-shut down in Float. (Note the missing U - Do not use -1UL) <br />
// Set = 0L to bypass Float Mode entirely and immediately turn off generator immediately when charging is completed. <br />
#define EXIT_FLOAT_AMPS 10 // If Amps being delivered falls to this level or below, auto-stop system.<br />
// Set this = 0 to disable Amps based auto-stop. <br />
<br />
<br />
<br />
#define BAT_TEMP_NOMINAL 77 // Nominal temp for above bat voltages (in deg-F). <br />
#define BAT_TEMP_1F_COMP 0.010 // Vbat temp compensation for 12v AGM batteries per degree-F (3mv/c published spec per cell, * 6 cells * 5/9 to convert to f) <br />
#define MIN_TEMP_COMP_LIMIT 59 // If the battery temp is less than 50f, cap temp compensation voltage raise to prevent overvoltage in very very cold places.<br />
#define MAX_TEMP_COMP_LIMIT 95 // If the battery temp is grater than 95f, cap temp compensation voltage raise to prevent overvoltage in very very hot places.<br />
#define BAT_MAX_CHARGE_TEMP 125 // Do not charge battery above the temp, Force into Float mode.<br />
#define BAT_MIN_CHARGE_TEMP -50 // And do not change below this temp, again forcing to Float.<br /><br />
<br />
<br />
<br /></div>
<div style="text-align: center;">
<u>Adjust to fit your battery manufactured profile</u></div>
<br />
I made a lot of changes here. The default values were selected around a large (1,800 Ah) 12v FLA battery, while this is a 12v AGM battery - we need to be very very careful with voltages.<br />
<br />
Referring to the Deka specs, it targets 14.1 to 14.4v as the acceptance voltage. I selected 14.3, towards the higher end of the range for faster recharging, but a bit lower than Max to take it a little easier on the batteries. Remember, a battery will recharge fully even at rather low voltages, it just takes longer. I put in the 12h max time for acceptance as recommended, but when it came to exit Amps I had to make a decision.<br />
<br />
Deka is one of the very few (if any) manufactures who specific their Acceptance exit criteria as a low <i>rate-of-change</i> in amps, as opposed to a % of capacity in absolute amps. Currently rate-of-change is not a coded in for an exit criteria (I may add it later); so I instead looked at other AGM batteries and noted their exit amps % used ranged from 0.1% of AH capacity to 0.6%, or in the case of this 735Ah battery bank - until the acceptance amps drops to a range of under 1 amp to almost 5A. I selected the higher end of this range, and added in an extra 5A to account for some amount of background house loads and selected 10A as the value to use for exiting Acceptance. As you define your exit criteria, do consider what, if any, baseline house loads might be present while generating - as the DC generator will be supporting (and measuring) the current needed to not only recharge the battery, but also support those house loads. <br />
<br />
These values are ones that can be adjusted to meet your total system needs and desire of how to run it. Want to recharge things faster? Increase the Acceptance Voltage limit. Want to increase battery life? Lower it. OK with using the Generator to recharge to say the 90% point, and perhaps let Solar cells do the rest? Raise the Exit Amps to say 25A. Want to make sure the battery is 100% recharged each and every time? Set it for 1A. Lots of flexibility here.<br />
<br />
Temperature limits also need to be edited to match the battery manufactures guidance. The default values are OK for most all lead-acid based batteries, but if you are using say LiFePO4 batteries typically you would set the 1F_comp to 0, and adjust the min and max charge temperatures to protect the batteries. Take special note of the Min charge temp - some LiFePO4 batteries specify 0c (32f) as the lower limit for charging batteries...<br />
<br />
<br />
<h3>
Included Modules Parameters </h3>
Here some customization of optional include modules are defined. Auto-gen startup, watermaker, etc. In the future this section may expand. Example, adding black-out time periods for the Auto-gen..<br />
<br />
<div style="border: 1px solid #ccc; font: 12px Courier,monospace, Serif; height: 250px; left: 20px; overflow: scroll; position: relative; white-space: nowrap; width: 620px;">
//------- Auto-Start parameters<br />
//<br />
//<br />
<br />
#ifdef INC_AG <br />
#define AG_VOLTS_THRESH 11.5 // If VBat falls below this voltage . . . (Set = 0 will disable Auto Gen).<br />
#define AG_HOLDOFF 5*60000UL // ... for this long (5 minutes), then we can consider auto-starting the generator<br />
// (= 0 will also disable auto-start feature)<br />
#define AG_WARMING_TIME 20000UL // Sound the beeper 20 seconds before doing the auto start. . .<br />
#define AG_WARNING_DURATION 3000 // ... and sounds it for 3 seconds.<br />
<br />
<br />
// Future will add in quite-time tables using an RTC<br />
#endif<br />
<br />
<br />
<br />
<br />
<br />
//------ Co-Gen Paramaters<br />
//<br />
//<br />
<br />
#ifdef INC_CG<br />
#define CG_TEMP_START 160 // Start up the CoGeneration waste heat pump (if IN_CG flag is defined)<br />
#define CG_TEMP_STOP 140 // If generator falls below this value (deg-F), stop the waste heat pump.<br />
#endif<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
//---- Watermaker Paramaters<br />
//<br />
//<br />
#ifdef INC_WM<br />
#define PRE_WM_HOLD 1000UL // When enabling the WM clutch, start the throttle to Full On, and delay this long.<br />
// Just to give the motor some time to start accelerating. Do not make this TOO big<br />
// as it is a raw delay, and the WM pump should be unloaded - giving time for the engine<br />
// to reach full speed.<br />
#define POST_WM_HOLD 20000UL // After the WM clutch is turned off, keep the motor at Full Speed (and running) this long (20 seconds)<br />
// incase the user re-enabled the WM (ala, when priming the filters and cycling pump on and off)<br />
#endif<br />
<br />
<br /></div>
<div style="text-align: center;">
<u>Review and adjust as needed</u></div>
<br />
As none of these modules are currently being used, I made no changes here.<br />
<br />
<br />
<br />
<br />
<br />
<h3>
System Configuration Parameters</h3>
Finally we have a grouping of system configurations to adjust. Things like the AMP shunt ratio, the address of the DS1820 temperature senders, even our 'welcome' splash on the LCD and any back light timeout we want to use.<br />
<br />
<div style="border: 1px solid #ccc; font: 12px Courier,monospace, Serif; height: 250px; left: 20px; overflow: scroll; position: relative; white-space: nowrap; width: 620px;">
#define AMP_SHUNT_RATIO (250/0.075)*1.00 // Spec of amp shunt, 250A / 75mV shunt * 0% calibrating error (Edit error later after calibrating)<br />
// Note, if Shunt voltage will exceed 80mV, then the ina-22x calibration will need to be adjusted.<br />
#define BAT_VOLT_SCALER (464+33)/33 // Scaling values of Voltage Divider resisters R42/R43 on the raw Amtel VBat sensing line.<br />
#define PBAT_SCALER (10+10)/10 // Scaling values of Voltage Divider resisters R30/R40 on the ina-22x VBat+ sensing line.<br />
<br />
<br />
// ----- One Wire addresses, need to hand code these for now.<br />
//<br />
//<br />
<br />
#define OW_NUM_DEVICES 6<br />
#define OW_ENGINE_TEMP {0x28, 0x13, 0x53, 0x60, 0x04, 0x00, 0x00, 0xC9} // Engine cooling water engine temperature<br />
#define OW_SEA_TEMP {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // Sea Water temp sensor<br />
#define OW_ALT_TEMP {0x28, 0x2E, 0xFB, 0x5F, 0x04, 0x00, 0x00, 0xB1} // Alternator Temp<br />
#define OW_ALT2_TEMP {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // 2nd Alternator Temp (if present)<br />
#define OW_BAT_TEMP {0x28, 0x28, 0x04, 0x60, 0x04, 0x00, 0x00, 0x18} // Battery Temp<br />
#define OW_EXT_TEMP {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // Exhaust Mixer Temp<br />
#define DS18x20_RESOLUTION TEMP_10_BIT // All devices work in 10 bit (0.25C) resolution mode.<br />
// (Note if DS10S20 us used, unit is fixed to 9-bit)<br />
<br />
<br />
<br />
<br />
const char welcomeScreen[] PROGMEM = { "Welcome Kubota-Gen" }; // Put your Welcome (Power on) message here. Make it as long as you wish, noting <br />
// it will wrap on the LCD screen.<br />
<br />
#define BACKLIGHT_TIMEOUT 10*60000UL // Number of minutes with no keyboard action, drop the backlight on the LCD. <br />
// Set = 0 to disable backlight diming.<br />
<br />
<br /></div>
<div style="text-align: center;">
<u>Review and adjust as needed, esp: Amp shunt ratio and DS18B20 temperature probe addresses</u></div>
<br />
Here I changed the Amp Shunt ratio to match what is being used. I also set the calibration factor to 100%, after running we can calibrate it against an accurate meter if we want. I have found the Amp Shunts are very poor in calibration - having at times as much as a 5-10% error.. Measure your system near the point that matters most, ala around 25A or so to center the calibration for use by the Acceptance Exit Amps. Notice how I entered 0x00's for the address of probes not used, like the 2nd alternator temperature sensor. This will disable any actions taken by the code around that probe, including fault checking.<br />
<br />
<br />
<br />
<br />
<h3>
All Done.</h3>
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
That is it! Save your new configuration file.
Copy it to the Arduino sketch folder in the same sub-directory as the controller
code - overwriting the default config file. As new revisions to the
source come out there may be some additional parameters added to this config.h
file, if so just copy out the new default definitions into your customized file
and adjust as appropriate</div>
<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-11887881134123479812014-07-20T13:59:00.000-07:002014-07-20T14:48:26.026-07:00A 'Reset' problem... Using external USB / TTL addapters not giving proper Reset signalThough the Integrated Engine Controller and Alternator Regulator is 'based' on Arduino, it is a separate design. Even so I work to maintain comparability with both the Arduino Uno hardware, as well as the Arduino IDE - example, keeping the Optiboot bootloader - to allow for simple modification.<br />
<br />
One area I changed a bit was to remove the on board USB logic instead using a 'service port' to bring out TTL signals via a 6-pin header. Then a low cost USB <--> TTL adapter can be used across many boards, saving space as well as cost. Much the same way the Arduino Pro and Pro-mini do things. External adapters are readily available with prices ranging from under $2 to around $20, depending on the supplier and chipset used. And also how they handle the 3.3v vs. 5v issue. . . Therein lies the problem with Reset.<br />
<br />
A core capability needed by the Arduino IDE is the ability to reset the Atmel CPU and have it look for a new sketch to be downloaded. The bootloader takes care of this by searching the serial port for a special series of bytes indicating the IDE wishes to synchronize with the target board. Once synchronization is made the new sketch binary can be downloaded updating the target boards program. This all depends on getting a reset signal to the Atmel CPU.<br />
<br />
In the Arduino Uno, and most other related designs, the falling edge of the DTR pin is routed through a capacitor to produce a negative spike, resetting the CPU. This design is simple and reliable and allows the Arduino IDE to reset the CPU into the bootloader. A typical design looks like this:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCi4vvyU4UY9dRotrt3SBXXwrqiNfQ987PvvnaRXzPX4G3PWiQ4ZxE-QK5eXw7G345Rd_jd6O3GRGwc4cMnqSU0RBx0vIpnpTnNUrBbOUg5wqSO-os1O6cF8YWXabN7xELnMUYWk7g6pv0/s1600/Before.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCi4vvyU4UY9dRotrt3SBXXwrqiNfQ987PvvnaRXzPX4G3PWiQ4ZxE-QK5eXw7G345Rd_jd6O3GRGwc4cMnqSU0RBx0vIpnpTnNUrBbOUg5wqSO-os1O6cF8YWXabN7xELnMUYWk7g6pv0/s1600/Before.png" height="265" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Typical Arduino reset circuit, DTR is in Pin #1 of the Service connector.<br />
(Not shown is another 10K pull up resister on the left side of C20)</td></tr>
</tbody></table>
<br />
DTR from the USB <--> TLL adapter board is connected to Service pin #1. When DTR is brought low, C20 will fall as well and then be recharged back up via another 10K pull up (not shown) connected to the ~Reset line. This causes a negative pulse to be presented to the ATmega328 CPU's reset pin - resetting the CPU. Here is what it should like:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLwH5mh3FS927gH5Rf6LlYI9ywJotZDbKv4l5w2SLKQxzrSw1TocUZ9I8N1vE7r5rhOgVW4vHw2mc_ofZbPXI-nHuxQvlB-4Ty6mLikYhwB1v5fCbz3BKw_lWcs2JjUZG6Vx2ui9D3WdaX/s1600/5v+Reset.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLwH5mh3FS927gH5Rf6LlYI9ywJotZDbKv4l5w2SLKQxzrSw1TocUZ9I8N1vE7r5rhOgVW4vHw2mc_ofZbPXI-nHuxQvlB-4Ty6mLikYhwB1v5fCbz3BKw_lWcs2JjUZG6Vx2ui9D3WdaX/s1600/5v+Reset.png" height="408" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Results of the standard Arduino Reset circuit with a 5v DTR voltage level</td></tr>
</tbody></table>
<br />
<br />
<br />
<br />
While checking out the latest revisions of the controller I was verifying signals vs. the ATmega328 data sheet - timing as well as voltage levels - and I found the reset spiked down to only a bit under 2v, not all the way to ground. The spec sheet calls for a reset voltage levels of under 0.5v (0.1*Vcc); even though the CPUs seem to reset - it is out of spec.<br />
<br />
After a bit of digging I determined the cause: The USB <--> TTL adapter I am using is based on the CP2102 chip. It works on 3.3v voltage levels - not 5v. So when DTR fell from 3.3v to ground, it pulled the other side of C20 from 5v to 1.7v (5v - 3.3v) before starting to raise up. The problem is the DTR from the CP2102 chip only has a 3.3v swing, not the full 5v swing, and hence I can not pull the ~RESET line from 5v down to 0v. Giving a waveform like this:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJvgRI_Z0sMqG97Yr67qEsg-fIOpt1yIsZ-1BDWcq84seqMpOzmYrhWME-GbipyddNeMKTa21O2o344V2sK6_wgQU90O-tXxb0J0inUXSLR_RDFgt3fRLEW2rOdVO5r8atwRsBJ-sgN7Xu/s1600/3.3v+Origional+reset.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJvgRI_Z0sMqG97Yr67qEsg-fIOpt1yIsZ-1BDWcq84seqMpOzmYrhWME-GbipyddNeMKTa21O2o344V2sK6_wgQU90O-tXxb0J0inUXSLR_RDFgt3fRLEW2rOdVO5r8atwRsBJ-sgN7Xu/s1600/3.3v+Origional+reset.png" height="404" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Results of the standard Arduino Reset circuit with a 3.3v DTR voltage level</td></tr>
</tbody></table>
<br />
<br />
Notice how the ~RESET pulse only goes down to about 1.5v - not what we want.<br />
<br />
<br />
The two most common USB <--> TTL adapter chips seems to be the CP2102 and the FTDI232, with an occasional PL2303 or CH340 chip in the mix. Of these the FTDI232 is considered the most mature (and was even used in some versions of Arduino's), while the CP2102 is about 1/2 the price and shows up on lower costs adapters. (The PL2303 and CH340 is even lower cost, but I have not seen too many of them sold in stand-alone adapters). All three chips run at 3.3v, output 3.3v signal levels, and will have this out-of-spec reset signal issue shown above. However, the FTD232 has the ability to optionally select 5v signal levels via the VCCIO pin. Some of the better adapter boards have a 5v / 3.3v jumper to control which voltage is sent to not only Power-Out pin, but by also routing to VCCIO are able to adjust the signal voltage levels (including DTR) as well. 5v signal levels for DTR in a 5v system. (Make sure to check the schematics, not all adapter boards enable this capability).<br />
<br />
<br />
The CP2102 and PL2303 lack this capability, but surprisingly the CH340 has it! Again, all depends on how the board is wired.<br />
<br />
How much of a problem is this? Not sure. The spec sheet is to guarantee a reset, but in the many boards I have tried out I have never had a problem with this out of spec reset pulse. Even so, it bothers me. My option was to start using $10-$15+ adapters, (vs the $1.80 I pay now), or find another way.. Here is what I came up with:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSLDfjN2VoXAVb5he8Ad-XDMTqH6_QjLreVkt0r6GGKYXd2GTVQr3Is1-g0sORUWj0fDzSPAcxYDTdq6e_lzEwt0w7ZeXn20pt6laIvyeml1V6GxfqNM-qjlwgoDIWJslq71dLPEKdAcps/s1600/After.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSLDfjN2VoXAVb5he8Ad-XDMTqH6_QjLreVkt0r6GGKYXd2GTVQr3Is1-g0sORUWj0fDzSPAcxYDTdq6e_lzEwt0w7ZeXn20pt6laIvyeml1V6GxfqNM-qjlwgoDIWJslq71dLPEKdAcps/s1600/After.png" height="286" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Addition of Q5 to provide 3.3v to 5v level shift of the DTR signal.<br />
(Still not shown is an additional 10K pull up resister on the left side of C20)</td></tr>
</tbody></table>
<br />
Q5 is added in a common-base configuration to provide a 3.3v to 5v level transformation. R69/R70 biases Q5 at 2.5v so that any time the emitter falls below approx. 1.9v Q5 will start conducting. At rest when DTR is not active (High) it will be above this trip point. Independent of of a 3.3v or 5v adapter being used Q5 will not conduct leaving R28 to pull up C20 to a 5v level. As DTR falls past the 1.9v trip point towards 0v, Q5 will start conducting and soon saturate - thus following DTR, pulling down C20, and giving us a full 5v level swing. Even when DTR is presents 3.3v levels. R71 reduces the chance of noise giving false triggers when nothing is connected to the service port.<br />
<br />
<br />
After implementing the above circuit, the waveforms now look like this:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXjxs19G7CLy6EuUJ-bTV462leUxV16Imx4aYzp8sIPy5fMvMuswbr5K4TG5enT6niPzj-nU3rN3eJK5WTB0r7fWP3XBNCVTLRr9BAXo0nAjx6h63emS_jdI51NX9zhneoPe040eylPGhZ/s1600/fixed+3.3v+reset.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXjxs19G7CLy6EuUJ-bTV462leUxV16Imx4aYzp8sIPy5fMvMuswbr5K4TG5enT6niPzj-nU3rN3eJK5WTB0r7fWP3XBNCVTLRr9BAXo0nAjx6h63emS_jdI51NX9zhneoPe040eylPGhZ/s1600/fixed+3.3v+reset.png" height="406" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Results of the modified Arduino Reset circuit with a 3.3v DTR voltage level</td></tr>
</tbody></table>
<br />
DTR is first shifted from its 3.3v level to 5v level before being applied to C20. Allowing the reset pulse to be pulled down below our needed 0.5v. A DTR already at 5v will give the same results.<br />
<br />
This solution adds under $0.10 of cost to the boards and will work for 5v as well as 3.3v adapters. Though I have never had a problem to date, I will be adding this level shifter to my future designs, meeting the specs of the ATmega CPUs, and allowing the use of the low cost USB <--> TTL adapters.<br />
<br />
<br />
<br />
<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-64467901509746486172014-07-19T15:40:00.000-07:002014-07-20T08:56:32.263-07:00Some photos of v0.3.1Just posting up a bunch of photos of the latest controller board + LCD remote. Controller board is now largely SMT, and the Remote board has been reduced in size to exactly match the LCD.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5Zs7eTuQJUrnvXW7CXV-Q2p_FqBqklpYGiHPh41ZwoQozwhepBilv3YfPbK1Kq8EmzOQSvSBRq2DRpAtTsYl8JUn-4DYchQgI-RDWn84IaAHFaTE5dCh7qoZbKujNd56eY38JmgW2fkXN/s1600/IMG_7521.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5Zs7eTuQJUrnvXW7CXV-Q2p_FqBqklpYGiHPh41ZwoQozwhepBilv3YfPbK1Kq8EmzOQSvSBRq2DRpAtTsYl8JUn-4DYchQgI-RDWn84IaAHFaTE5dCh7qoZbKujNd56eY38JmgW2fkXN/s1600/IMG_7521.JPG" height="552" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Newest revision of Controller Board.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWPv3iV0UDnCwq5CsDsiL-t0Cmmm4D7KJ4nes7ZkDJ9xF5asNlVobG9B552TGWrG87lbtkQGQDp6-jbGLYoaELxyowDryei6bUovePqWuTmnvxctWZoR4MYTcm-C3E5ggfsFtlnujbkPPx/s1600/IMG_7549.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWPv3iV0UDnCwq5CsDsiL-t0Cmmm4D7KJ4nes7ZkDJ9xF5asNlVobG9B552TGWrG87lbtkQGQDp6-jbGLYoaELxyowDryei6bUovePqWuTmnvxctWZoR4MYTcm-C3E5ggfsFtlnujbkPPx/s1600/IMG_7549.JPG" height="480" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">And remote LCD display board</td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8mCBzK8T3bBGg7vBMrgoQ0yP9vHWz-wz7QoYzf7J5PLYtVkt8Bp3fnr9yozgSFPHInj_YHN4-mKXm6m9uJd0-KrCwZfFIZ-ed_cSAnzEfu9BrnJ35p_ct4JRqcRkmzsvbGNfMXkz6z-vl/s1600/IMG_7556.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8mCBzK8T3bBGg7vBMrgoQ0yP9vHWz-wz7QoYzf7J5PLYtVkt8Bp3fnr9yozgSFPHInj_YHN4-mKXm6m9uJd0-KrCwZfFIZ-ed_cSAnzEfu9BrnJ35p_ct4JRqcRkmzsvbGNfMXkz6z-vl/s1600/IMG_7556.JPG" height="277" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQUgliY7oHPdW3ou6cklU8yun7z9851_02w2Kc_I8__7SV4DvqLPDJWo8SyVXMZS3t88MLSZ7c2KmapzSRvl-m_OY2S7ipqiDiVcHMABw6ikmYEijRnwZf7JM-A37V2WReXyQK0UTC1cKV/s1600/IMG_7554.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQUgliY7oHPdW3ou6cklU8yun7z9851_02w2Kc_I8__7SV4DvqLPDJWo8SyVXMZS3t88MLSZ7c2KmapzSRvl-m_OY2S7ipqiDiVcHMABw6ikmYEijRnwZf7JM-A37V2WReXyQK0UTC1cKV/s1600/IMG_7554.JPG" height="236" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Now same size as LCD.</td></tr>
</tbody></table>
<br />
<br />
<br />
<br />
<br />
<span id="goog_1272688039"></span><span id="goog_1272688040"></span><br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-78813412032789853892014-07-06T13:29:00.001-07:002015-04-06T20:28:21.492-07:00v0.3.1 design postedThough it has been up there for a few days, today I am announcing the availability of v0.3.1 design in the links above. This includes CAD files, parts lists, etc...<br />
<br />
This release resolved the fatal issue in v0.3.0, and represents the group build status. One thing to point out: The design and PCB for the remote LCD is largely unchanged between v0.3.0 and v0.3.1, either board will work, though I did refine some component values (ala the I2C pull-ups), so just use the 0.3.1 BOM for the latest.<br />
<br />
There is one oddity with v0.3.0 LCD remote, and this is in the the support for the optional low-cost China CR2032 battery holder. The pins are a little off, and one needs to shift the socket a little when installing it, like this:<br />
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAH4Z-oz3Rj85pHeYfa17hyS68PRt07HvaHtb9OvoFhDBzCv34uz9LS3uRKNF3L1TjoXsj0mRLS4BySs2jW5x2Ljddsguw_4f8_h6aQeVYAyF2K2Kz4-_mh6RwAeu5qKIHKZAlkAFI7cVZ/s1600/IMG_7491.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAH4Z-oz3Rj85pHeYfa17hyS68PRt07HvaHtb9OvoFhDBzCv34uz9LS3uRKNF3L1TjoXsj0mRLS4BySs2jW5x2Ljddsguw_4f8_h6aQeVYAyF2K2Kz4-_mh6RwAeu5qKIHKZAlkAFI7cVZ/s1600/IMG_7491.JPG" height="480" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Offsetting Chinese CR2032 battery holder</td></tr>
</tbody></table>
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-82666440967264711242014-07-05T14:27:00.002-07:002014-07-19T17:53:00.683-07:00Its Alive!!!Well, part of it at least. Today I soldered up one of the new remote LCD boards and powered it on:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqx9zkTbHPYQlk4t7zpSAjcRl8z2XFxXbKFdhIKFC8lVuQ692xt8gCuf7LsdoyGSKYzFybYUinwQ9wF_-bqKWcUyN6DwElVK2CXLk0QZIpMRtewciKMSgE2zb4OAYoUUxiPZ14L6WIcAsj/s1600/IMG_7488.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqx9zkTbHPYQlk4t7zpSAjcRl8z2XFxXbKFdhIKFC8lVuQ692xt8gCuf7LsdoyGSKYzFybYUinwQ9wF_-bqKWcUyN6DwElVK2CXLk0QZIpMRtewciKMSgE2zb4OAYoUUxiPZ14L6WIcAsj/s1600/IMG_7488.JPG" height="426" width="640" /></a></div>
<br />
<br />
When completed the LCD board flips over and mounts on the back under the LCD; it is exactly the same size. But here I have it bridged using a proto-board, with the Service and ICSP ports connected and supplying +5v.<br />
<br />
When I get in the revised controller boards will proof out the CAT-5 cable buffers as well.<br />
<br />
BTW, the message "We are Alive!!!" is what the Arduino sketch for this remote LCD / keyboard module displays upon power up. In use it would very quickly be overwritten by the start-up messages from the controller. But at least this gives a quick way to check things are working locally. <br />
<br />
<br />
<br />
<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-92052227042006377042014-06-12T16:48:00.002-07:002014-06-12T16:48:28.315-07:00Release v0.3.0a has fatal flawLast night I realized there is a fatal flaw in release 0.3.0 of the controller design. The snubber / ESD protection BAT54's are designed in backwards (+5 vs. gnd), and instead of providing protection they provide a direct short between +5 and gnd.<br />
<br />
I have pulled all the v0.3.0 files from the links above, once I have revised the design I will repost a new version.<br />
<br />
Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-47005189207122299102014-06-09T19:41:00.002-07:002014-06-09T19:41:46.781-07:00Managing Engine Temperature Not sure why I did not have this before, after all Engines got to be cooled, and we are sampling the engine temperature... If you engine has a built in thermostat, or temperature controlled fan great. If not, the I just added an option where the Controller can do that. A new '<span style="font-family: "Courier New",Courier,monospace;">#define INC_ET'</span> in your configuration .h file will enable Engine Temperature code, working to keep the engine around the target operating temp as defined in your setup file. (<span style="font-family: "Courier New",Courier,monospace;">#define ENGINE_TEMP_SETPOINT</span>)<br />
<br />
It will utilize the HP Pump FET if that is not already being used to actually control a high pressure Watermaker pump clutch, or a co-gen feature. In one of those cases, it will instead drive port PB4 as exposed on the ICSP pin#1 in the expansion connector row. Of course you will need some extra hardware for that.<br />
<br />
Right now the logic is simple, turn on the fan when we are approaching the desired temp, and turn it off when we fall below it. I think a good enhancement will be to add a PID to this, but will need to really think about the tuning values, as well as the sample period. Given the thermal mass of an engine it is unlikely we will need to sample every 100mS....<br />
<br />
Another thing that happens if you enable the Engine Temperature management is the Alternator Pull-back from engine temperate will target 5f higher. This will allow the cooling fan / pump to do its work before we start pulling back on the alternator.<br />
<br />
<br />I plan to use this to control a bypass value placed in parallel with the sea-water side of the heat exchanger. When enguaged it will open and cut the water flow to the exchanger. I hope this will help get my engine temp up from its current 160f operating... Watch for the next release of the Source code v0.1.6 for this feature. Going to hold off posting it in case I think of some more ideas.<br />
<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-92195959650666680322014-06-07T07:41:00.000-07:002014-06-09T19:41:38.862-07:00Monitoring Watermaker PressuresAn addition to v0.1.5 of the Source is a mode for monitoring a watermaker.<br />
<br />
Enabled via '#define CHK_WM_SENDERS' this will read pre-filter and High Pressure Pump pressure readings, alarming if they fall out of range while operational. Example: when running it is important to keep some positive pressure out of the pre-filters and presented to the input of the CAT High Pressure pump. Failure to do so can cause cavitation inside the CAT pump and potential damage. As the pre-filters fill up, one needs to keep an eye on them during operation. I would check them every 30 minutes or so. But things can change fast. With this latest addition to the code, the controller will also watch these pressures, display them on the remote LCD panel, and alarm if they fall out of range.<br />
<br />
There are two ways to attach senders to the controller, depending on which version of PCB you have. If you have v0.3.x or above, the SMT Atmel CPU exposes two additional A/D pins, so I simply brought those out as part of an expanded EXPANSION connector. Add the appropriate resister dividers to get a 0-5v signal and you are good to go.<br />
<br />
If you have a v0.1.x or v0.2.x PCB (as I do), then you will need to add an expansion board to get some additional A/D ports. I selected the PCF8591 I2C chip, it is a self contained 8-bit 4-port A/D converter that can be purchased as a module off of Ebay for very little. (Or one could make a nice plug-in expansion board with a better fit-n-finish). Here is an example schematic that could be used as a starting point:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5WDKOLcixqsdLA9yUabBYUN1xNGcQ7ih5hZ15Otr5GgXHLoaBDgsUqqqoLuIHSNaq4xPI20dBvITurPFk5K-9y68CRoK3uxJFbknK-0vyd2ZnzGKGiN0Z5EchLqlyKWhpXg3EEGr5rQ4Q/s1600/Watermaker+Reader.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5WDKOLcixqsdLA9yUabBYUN1xNGcQ7ih5hZ15Otr5GgXHLoaBDgsUqqqoLuIHSNaq4xPI20dBvITurPFk5K-9y68CRoK3uxJFbknK-0vyd2ZnzGKGiN0Z5EchLqlyKWhpXg3EEGr5rQ4Q/s1600/Watermaker+Reader.PNG" height="486" width="640" /></a></div>
<br />
I added code in the read_sensors() function to read the Atmel A/D's ports directly or the I2C expansion PCF8591 A/D converter, depending on which PCB version you have. Do note which ports to connect which pressure sender to as documented in the source file comments.<br />
<br />
A word about reading from the PCF8591: There are several examples out there, most of which make things a bit hard. The PCF8591 is a rather simple chip - it will do an A/D sampling stashing the results in a register. When one reads that register a new A/D sample cycle is initiated; you can retrieve the new A/D reading next time you read the register. Most Arduino example sources do two reads, throwing away the 1st value. The REAL reason for this is: At Power-up the PCF8591 places a 0x80 into all the registers. So, after Power-up the 1st read is of no value. Added to that there is the issue that when you do read a value out you are really getting the results of the <i>PRIOR </i>A/D cycle, not what is happening right-now. For this project sensors are sampled every 100mS, so I am not too worried about getting RIGHT NOW vs. 100mS ago. I also use a mode called Auto-increment: when I read a port the next I2C read will automatically return the next port. Making for nice simple short code and eliminating unneeded I2C bus traffic. OK, a bit of detail, but when doing research I noted folks doing this dbl read and it seemed no one really explained (or knew??) why...<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-39167556542351605182014-06-07T06:47:00.001-07:002014-06-09T19:42:27.846-07:00Posted source code release v0.1.5Today I posted source code release v0.1.5 to the links above (Source-code tab). This is a rather small release with a couple of big changes.<br />
<br />
Perhaps the biggest change is I have broken the single source file into a .ino and a separate .h file. In the SECR_config.h file are all the customization parameters needed for YOUR system installation. The idea is that with future releases of the source you will be able to cope on the new Souce - keeping your same .h file.<br />
<br />
<br />
With the SERC_config.h you can:<br />
<ul>
<li>Set some clues about the controller hardware you are using (ala, which version of TLEs, do you have the new FET drivers which need the charge pump PWM - v0.3.x and above)... </li>
<li>Decide which features you want enabled: Do you have a watermaker to support? Perhaps instead doing co-gen and want to start a pump at a set temperature?</li>
<li>Set checks / probes you have installed: Want to check the Oil Pressure? Raw Water Flow (marine installation)?</li>
</ul>
These are all deselected / selected via commenting out / uncommenting in different #define's. You will also want to set:<br />
<ul>
<li>Alarm limits for your system, temperatures, volts, etc. What do you want the controller to monitor and at what threshold do you want it to sound the alarm and shut things down.</li>
<li>Engine management timings: A number of things are done open-loop and for those there are timing values. Example, before starting we need to advance the throttle cable some to the 'start' position. Because there is no position sensor on the throttle cable we simple 'advance' it for a fixed amount of time to get it 'about' where we want it. This fixed amount of time is set by the #define THROTTLE_TO_IDLE_DELAY value. On my little Kubota 1300 (1.3 seconds) of 'advancing' is 'about right'.</li>
<li>Engine management thresholds: Another group of values are measured thresholds - ones where we have a sensor and can get feedback. Examples include all the alarm values (Overtemp, under oil pressure) as well as things like: #define STARTED_AMPS_THRESH which is used to help decide when the engine has started by a drop in measured starter amps.</li>
<li>Engine RPM/HP specs: A key configuration is how much HP the engine is specified to produce at a given RPM. This is used to limit the max load on the engine; while getting the most out of any running time. It is also used to decide the throttle position needed, allowing the engine to be slowed down towards the end of the charging cycle with active throttle management. This key table is called: RPM_Watts_array</li>
<li>Alternator and Battery management: What are your target voltages? At what point do you consider the battery fully charged? Do you want to move on into Float Mode of stop the engine when the battery is fully charged?</li>
<li>The address for all the DS18s20 temperature senders need to be typed in, see the assembly tab above for some hints on how to determine these values.</li>
<li>You will also want to set other misc parameters, such as the engine and alternator pulley size - to calibrate the measured RPMs.</li>
<li>And finally, configuration of AutoStart mode can be done. Do you want the generator to auto-start when the battery reaches a specific voltage? There is more to do in this area, ala setting block-out times via the RTC on the remote. But this is a start.</li>
</ul>
<br />
<br />
<br />
Configuring the .h file will take some time; take care in
setting this up making sure not to choose more then one option, and also
pay special attention to how values are defined. e.g., many of the
timing values end in UL, you need to make sure to retain that Unsigned
Long guidance for the compiler. Once set up you might have to tweek some settings to fine tune things, but after that things should go smoother when loading new revisions to the source.<br />
<br />
<br />
Finally: Need to point out: as I am away from the boat these days (See Viking Star blog) I have no way to testing this release outside of bench testing. Version 0.1.3 (also on the source-code tab above) is the last version of source I had actually loaded into our DC generator. This August I will be back at the boat for a check-in and will be able to verify newer releases in actual hardware.<br />
<br />
<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-80800423207759762352014-06-03T17:37:00.001-07:002014-06-03T17:37:33.046-07:00Breaking the Engine, wait - no --- -- that's Breaking-in the engine!<br />
<br />
At a suggestion, I added a new #define:<br />
<br />
#define BREAKIN_ENGINE <br />
<br />
the idea is to adjust the controller in ways that will help the engine during its first few hours of operation. Kind of like a new car cautioning you to not go above 70 MPHs, or use more then half throttle for the first 300 miles (or what-every they say these days in new cards).<br />
<br />
<br />
To enable the Breaking-in mode, uncomment the above #define in the configuration .h file. So far the behaviour changes I have are limited:<br />
<ul>
<li>Reduce engine load to 50% of its capability at all RPMs</li>
<li>Prevent co-operation of Alternator and Water-maker, only power one or the other.</li>
</ul>
<br />
This is a compile / flash option, perhaps down the road I will work harder on the remote module to perhaps allow more configuration via the remote vs. having the re-compile each time. But that will be down the road some...<br />
<br />
<br />
Look for this new capability when I post the next revision of Source. And if you have any ideas of other limits to add, please let me know..<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-74860397114679832742014-06-03T12:44:00.000-07:002014-06-03T13:48:21.115-07:00revised release v0.3.0a files - scrubbed BOMI kind of hate to do this, but figure not too many folks have pulled down the files I released yesterday. if you have, go back and look for new ones," v0.3.0a" (Note the small 'a')<br />
<br />
I have been scrubbing the reference Mouser part numbers, as when I went to place a fill-in order I found that several of the components had changed, or were now only available in large quantities. So, for the 'a' release I added in fresh new Mouser part numbers. Good for today only. . . .<br />
<br />
<br />
A comment on terminal strips: There are several terminal strips uses, esp on the remote. Rather then include individual ones I selected a single long one (36 position) that you can then cut to the length you need. Same for the 2x strips used on the controller (expansion, ICSP, etc). Just order one larger one, and in this note all the connectors are in a line next to each other, so no need to cut - just pull a row of pins between the expansion and ICSP positions and stuff. Another reason for doing this as one connector is it assures good alignment between the two ports for any future expansion boards.<br />
<br />
<br />
I also upgraded the 2N3904's to 2N2222 on the remote board. Looking at different backlighted LCD, turns out the yellow/green backlight take upward of 180mA, getting too close to the 2N3904's 200mA limit. 2N2222 have a 600mA limit with good Hfe.<br />
<br />
<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-55474106079888333982014-06-01T13:56:00.001-07:002015-04-06T20:29:57.419-07:00Released design v0.3.0 - Learnings from Stand-alone Alt Reg + SMT conversionToday I posted v0.3.0 of the controller and LCD remote to the blog (See links above, Schematic, PCB, BOM, CAD files..) This has been a MAJOR update to the design, with highlights being:<br />
<ul>
<li>Included leanings from Stand Alone Regulator, example:</li>
<ul>
<li>Universal Field FET driver, no more need for stuffing options to support 12-48v, P or N fields.</li>
<li>Upgraded to INA226 and fixed divider resisters, no more need for stuffing options voltage sample</li>
<li>System pre-regulator now 12v, largely to support universal Field FET driver </li>
</ul>
<li>Revised P-FET drivers to use a constant-current approach and thereby removing stuffing options (System voltage is still limited to 12v or 24v systems, even if Alternator / Field can go to 48v)</li>
<li>Increased a bit the robustness of CPU protection, ala adding 100 ohm resisters between clapping diodes and CPU to help protect CPU internal clamping diodes.</li>
<li>Moved most components to SMT.</li>
</ul>
<br />
This last change is perhaps the biggest, it will allow machine assembly of most all the low-power components on the board, plus a smaller PCB. Not only will one no longer need to hand-solder the small SMT parts (esp the INA226's), but by leveraging lower costs in China, we can get the partially assembled PCB w/SMT components for about the same cost as the blank PCBs alone from the prior source.<br />
<br />
<b>Note: Because the pre-regulator was modified (from 9v to 12v to support the FET driver) you MUST use a new LCD remote PCB with this new controller, or modify an existing one to use around a 12v pre-regulator. The voltages on the CAT-5 interconnect need to be about the same on both ends for the P82B96's to function correctly....</b><br />
<br />
<br />
I will be sending this design off for manufacturing Monday. There is one set of boards not spoken for, if you want it drop me a line. Else I will start making a list, and perhaps do a next round if there are enough folks after this.<br />
<br />
<br />
<br />
<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-38999885047141150152014-05-26T08:42:00.004-07:002014-05-26T08:47:28.427-07:00Driving two alternators -I was asked about the ability to drive two alternators on one engine and charging one one battery bank. Here is what I replied:<br />
<br />
<br />
<span style="font-family: Arial,Helvetica,sans-serif;">Driving two alternators. There is a massive capability in the Field FET driver ckt. Each FET has an Rds of only 8 mOhms, and is base rated for 80A. I used two in parallel just because they are not that expensive and two will assure a massive current capability with very little heat. I think the biggest limitation is the current capability of the PCB, even with large copper areas. If you note I am leaving a gap in the solder-mask on the top and bottom from the Field connectors to the FETs. On this one can solder heavy wires (like 16g or even 14g solid) to increase the current capabilities of the copper PCB. For two alternators I would suggest you do that to beef up the PCB.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">Then I would simply wire the alternators in parallel. If they are the same type / model there will be some level of current mismatch between the two, but not sure that really matters too much. I just now thought: there is a spare temperature probe connector on the PCB, you could use that to monitor the temp on the 2nd alt. I will modify the code to sample both alts temps when deciding if things need to be backed off. But as long as you do not need abs matching, I think just drive them in parallel… </span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">If one is much larger than the other, the miss-match could become large. For example if you had a 200A and a 100A, perhaps the small guy will drive harder for a given field PWM setting. In that case we could be driving the stuffing’s out of the small guy while the big one loafs along. You could measure the current of each with a clamp-on amp meter and if you need to pull back the little guy some just add in a couple of diodes into the field for the small guy, to drop its field voltage and try to bring things more back in line. (ala, thinking at any given PWM drive level you would want to have the Amps out of each alt be at about the same % of their respective max capability. If you have a 200A and a 100A alt, then when delivering 150A into the battery you would want the alts delivering 100A and 50A respectively. Not say 60A and 90A - thereby working the small guy so much harder).</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">Hope this makes sense. In short, I think all you need to do is add the copper beef-bars to the PCB, connect the Alts in parallel, connect up a 2nd temp probe to the 2nd alt. Then check with a clamp-on amp meter to see if the load splitting between the two seems reasonable.</span><br />
<br />
<br />
======================================================================<br />
<br />
Today I modified the code adding in a spot for a 2nd alternator temperature sensor. To enable it you just need to add in the address of the one-wire probe in the source:<br />
#define OW_ALT2_TEMP {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}<br />
// 2nd Alternator Temp (if present)<br />
<br />
Note that by default I have this filled with zeros, in effect disabling that temp probe.<br />
<br />
In operation the code will look at both alternator temperatures and pick the hottest one to 'manage' things with. I have not added anything into the LCD display for the 2nd probe, need to figure out where to put that at...<br />
<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-73240365081965976792014-05-25T07:55:00.000-07:002014-06-01T13:57:02.254-07:001st cut - moving to SMT; getting ready for a short assembly run.Last week I was busy revising the controller design and moving it to SMT parts. This is in preparation to having a small run of boards made up, and then machine assemble a large part of it. Major changes to the design include:<br />
<br />
<ul>
<li>Utilized universal Field driver ckt to support 12v-48v, P or N type alternators. No more need for stuffing options.</li>
<li>Also updated the FET drivers for things like starter, glow plug, etc to remove the need for stuffing options.<br />Power supply now stuffing free as well </li>
<li>Moved most of the components to SMT, and selected parts from the standard pool of parts at Smart-proto</li>
</ul>
<br />
Overall, most everything has been touched and/or refreshed. The PCB is smaller now, 15x15cm to match a ‘price break’ size for may PCB fab housed. I looked into going to 15x10cm, but just ran out of edge space for all the connectors… Moving to SMT will allow China to not only manufacture the PCBs, but also do machine assemble of as much as possible. Will decide about hand-soldering through-hole components based on the outcome of the regulators, but it is not too promising IMHO.<br />
<br />
Here are three CAD 3D renderings of the PCBs as they are now.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxTeVwmcntpkF7mfOe16S2IPPF1UuB7XjSFvWFhud-3NvNmDkP1JwrufbaTjrqge9qOWaAd9d_KBxkERcBUMQBnrq8yviynqXF9cqKnyaZZrnweC0kTx3hfgNENaWjMrDdydQWM1gzRT1o/s1600/Kubota+Generator+Control.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxTeVwmcntpkF7mfOe16S2IPPF1UuB7XjSFvWFhud-3NvNmDkP1JwrufbaTjrqge9qOWaAd9d_KBxkERcBUMQBnrq8yviynqXF9cqKnyaZZrnweC0kTx3hfgNENaWjMrDdydQWM1gzRT1o/s1600/Kubota+Generator+Control.png" height="524" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Biggest change: controller board. Now mostly SMT, except the high power parts.</td></tr>
</tbody></table>
<br />
<br />
SO much blank space. PCB is 15 x 15cm. I looked into squeezing it more, to perhaps 15 x 10cm, but just ran out of edge space for all the connectors. SMT stuff is amazing; I even tried to select somewhat 'larger' parts in case repairs, or handwork is needed. Even so - - - -<br />
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuvhSlT4uWdCe42Oh-gwmMDXf-ep2ZBZEwqRISqSyOmE2irDdpIfFOQpLOPSyQI09TP0C3g9bTfvwGKERWqviy3i0c9tiVRN1LCA47ggwGhZAv9dezkL8_KSZs3rm3zBr1q_97HRLRf0fl/s1600/Kubota+Generator+Integrated+Remote+-+board+side.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuvhSlT4uWdCe42Oh-gwmMDXf-ep2ZBZEwqRISqSyOmE2irDdpIfFOQpLOPSyQI09TP0C3g9bTfvwGKERWqviy3i0c9tiVRN1LCA47ggwGhZAv9dezkL8_KSZs3rm3zBr1q_97HRLRf0fl/s1600/Kubota+Generator+Integrated+Remote+-+board+side.png" height="285" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Only change for the remote is in the Power Supply side, to match the controller</td></tr>
</tbody></table>
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTRJFtVfocp8HNaNkg3I1XZ9JWqwzkKau7BZbnnUXh7nuAZ3XivFWIRhyHqdWGhsvnhADWuNTkdh7E6gx5Ygda-5xFyLXLRVIItHl7NyWvsI1lI5fjBNC701pUvp0eWFhFoI3qnXjGZVvg/s1600/Kubota+Generator+Integrated+Remote+-+LCD+side.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTRJFtVfocp8HNaNkg3I1XZ9JWqwzkKau7BZbnnUXh7nuAZ3XivFWIRhyHqdWGhsvnhADWuNTkdh7E6gx5Ygda-5xFyLXLRVIItHl7NyWvsI1lI5fjBNC701pUvp0eWFhFoI3qnXjGZVvg/s1600/Kubota+Generator+Integrated+Remote+-+LCD+side.png" height="350" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Notice how the PCB has been sized to match the LCD, no more overhang!</td></tr>
</tbody></table>
<br />
<br />
For now I left the remote panel as through hole. There is only one part that likely will be SMT, as the DIP-8 versions are getting hard to find. This would mean you would need to solder up the remote yourselves, all the parts as opposed to just a few. My thinking is: There really are not many more components that can be put into SMT, the CPU, about a dozen resisters and diodes; it might not be worth the extra setup costs just for those.<br />
<br />
I want to take a break over this weekend from this, and then do a review
of the design as well as the PCB layout next week before releasing the
revised schematic to the blog. One thing I need to double check is the heat disbursement; the SMTs are much smaller in that regard and I need to make sure I am not over-burdening anything. <br />
<br />
There is now people interested in 8x of these controller boards, we are looking to do a small PCB run + machine assemble of the SMT parts. If you are at all interested in joining, drop me an Email. I figure things will get moving perhaps mid June.<br />
<br />Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0tag:blogger.com,1999:blog-6109715218058168057.post-41809909375910382232014-05-24T13:38:00.003-07:002014-05-24T13:39:24.353-07:00KiCAD Lib find!!!One of the biggest issues with perhaps any CAD tool is establishing the Libs. My experience with KiCAD has been no different, with holes in the parts and some out right errors.. I have spent a lot of time not only confirming the footprints in the default libs, but also adding new ones of my own. I can do the 2D stuff, but for 3D images I have not gone too far into how...<br />
<br />
<br />
Today I was looking again for some 3D images to make my 'drawings' look nice, and stumbled across this:<br />
<br />
<a href="http://smisioto.no-ip.org/elettronica/kicad/kicad-en.htm">http://smisioto.no-ip.org/elettronica/kicad/kicad-en.htm</a><br />
<br />
<br />
All I can say is: WOW. This is a ton of work. The few modules and libs I have looked at are all good quality. And they are complete as well as integrated, from the schematic to the PCB and on to the 3D images. A ton of work has gone into scrubbing the default KiCAD libs, and augmenting them. He has the RM-42 Bluetooth modules, and even some vacuum tubes! All I can say is: For anyone working with KiCad, this is solid Gold..Viking Starhttp://www.blogger.com/profile/11269939254829503157noreply@blogger.com0