Author Topic: Truck Software Revision History  (Read 1894 times)

0 Members and 1 Guest are viewing this topic.

Offline MadScientist267

  • Impossible Condition Curator
  • Moderator
  • Hero Member
  • *****
  • Posts: 1514
  • Karma: +44/-4
  • Rules? What rules?
Truck Software Revision History
« on: November 02, 2015, 12:10:53 pm »
Thought this might be fun... This is compiled from the emails I sent to myself as offline backups and archives. I'll update this original post with the new revisions as they come up, and add a tag reply to note the revision has been tacked on. It's nice having all of this in one place now, and why not share it... Worth a few laughs, fill in some gaps in the big picture, and so on, eh? :)

They are arranged in the traditional way, newest at the top. Enjoy!



Truck 2.151.00
Aug 13

Added new fans to lightsfans and changed the labels within appropriately to match the descriptions on the new fan controller page. The other areas listed in the TODO still need to be addressed.

Aug 15

Added Battery Pair B-A Delta calculation and plot. Positive number indicates Pair B is higher than A, negative indicates B is lower than A.

Added the plot to the battery page and minor rearranging of the related plots on the page.

Aug 21

Not exactly a software revision, but a recent related software update to monitor the problem; Removed the Classic -> Master Bus Disconnect switch this morning and simply bypassed it's functionality for the time being to see the differences in the graphs. The switch is there purely as a convenient means to power cycle the Classic if the need arises. For now, things are better off without it at all. After some data rolls in, I'll re-evaluate the situation and see what should happen next. One intermediate plan on the agenda is to drill out the rivets that hold the switch together and see if the contacts are simply oxidized from the high humidity or if they've been trashed by the resistance issues that have been happening inside.

Moved (actually just commented out) the thermostat and thermodyne buttons from the main page to the thermal page since the buttons are all completely incorrectly labeled at this point, the thermostat daemon has been indefinitely been stopped, and the thermodyne logic isn't correct for any condition. This puts them out of the way but not out of reach if for some reason I need or want to go in and look at or tinker with something involving them. With the advent of the A/C unit, thermostat may very well come back as a mirror image of it's current self, but there's work to be done there first. The Pi needs to have control over the compressor at the very least, which can really only be run with any level of practicality from the genset.

Seems the concept of the logic adjustment also was left out in the Aug 13 entry above regarding lightsfans. The behavior is currently set to turn on Hi Duct, Overhead, and Lo Duct fans for correct ventilation when the box is closed and the truck running. Also changed the behavior of the eco light cutoff. Starting the truck no longer turns off the lights if they are on; they remain in their existing state. When the engine is stopped, operation is the same as before, eco lights are turned (or kept) on.



Truck 2.150.00
Aug 13

Changed active peltier cool temp from 25.4 to 30.4; changed passive cool temp from 24.0 to 29.0

Added Pair A/Pair B summed ADC readings to ranges as "shadows" for the main voltage plot (classic reading). This is to observe the differences caused by known resistance issues in the main bus that need to be resolved.



Truck 2.149.00
Aug 12

Commented out thermostat from smwd. The corresponding hardware was reallocated some time ago for other purposes and the daemon is no longer relevant.

Created cgi_fans to put the all of the environmental fans in one location and to finally give them their proper names (or at least something much closer)

Created dedicated fans.css file

Verified functionality of all but the crossflow fan (which is not yet physically connected to the reserved RFSW channel)

The cgi_fans page does not interfere with the Thermodyne (nor the Thermostat page, both of which remain incorrectly labeled). It simply writes the appropriate RFSW channel control file directly. If a daemon is in control of a given channel for whatever reason, operation will revert back to the wishes of the daemon in question as soon as the next pass for said daemon occurs).

Tacked on a button on the main page which points to cgi_fans.

Boolean plots "Environmental Thermal Boolean" and "Environmental Fan Boolean" need to be revamped to reflect the new labels and categories imposed by these changes. (added this to the TODO)

Likewise, Thermodyne and Thermostat need to be changed to reflect the new labels. (added this to the TODO as well)

Fixed a minor logging bug in overlord (was not affecting core functionality; var name continuity issue was not calling out a respawned 'smwd' thread by name in the master log)



Master Backup atver 2.148.00
Jul 23

Added the Pair A/B plots to the battery page and rearranged their structure. May still need a little tweaking to make the data most useful.

Jul 24

---- In progress - Fine tuning and trimming fat from the watchdogs, as well as prepping to give them conf files for easy maintenance. ----

Fixed some inconsistency issues in README

Made master backup in prep to make clones of the SD



Truck 2.147.00
Jul 2

Added 2 more departure plots to reveal issues inherently hidden by the nature of the plots themselves. These contain only the 2 blocks in each string, but are identical otherwise to the "vs pair" plot. They are labeled "Pair A" and "Pair B", 1/2 and 3/4 respectively. It has become apparent that some of the artifacts being seen in these plots are due to the high(er) impedance sources they're connected to (dividers) and that caps and ferrites will be needed to help supress the noise in the bands that they appear sensitive to.

Jul 5

Fixed a bug in pyfridge that was causing it to crash when it ran up against the polling busy retry delay.

Jul 8

Added a pre-average scheme to Pyro_DSP module to effectively double the sample rate (interpolation) to help smooth out sudden changes. This should help when there's just a single sample that comes back overcast and the sun is lower in the sky as in morning or afternoon. It is achieved by taking the last raw pyro ADC sample, and averaging it with the last derived average. The result is a smoother transition instead of the jagged edges that can instantly shut down the fridge erroneously under the right circumstances.

Changed morning boost pulse from -0.5h offset, 4.0h width, to 0h offset, 4.5h width to account for trees on horizon in alternate location. These values (along with amplitude) should eventually be moved to user-adjustable, but the extra hassle right now means they can't easily be accidentally changed and go unnoticed. Once the new crystal ball is in place, I'll change this.



Truck 2.146.00
Jun 28

Adjusted peltier night optimizer section to trigger shutdown much earlier on when the hot side-battery delta is below 3.0C to further improve ROI efficiency near target temp and minimal power, where the fans overtake the TEC as the greater load.

Added master log to master loop and master start.

Refined headers for new and existing entries to include date, type, and offending module for those modules that are intrinsically less verbose. SMWD and Overlord are also called out as "core daemon" rather than just "daemon" for the services; transients are referred to as "master loop transients". A couple of largely unimportant tasks were left without sophisticated or even any entry at all for the logs, due to complexity vs usefulness or other reasons. If they should prove to become problematic at some point, they will be given entries as well.



Truck 2.145.00
Jun 25

Added master log to smwd/overlord.

Added tail viewer for master log to Piag (stats).

Jun 26

Changed file operation from mv to cp in the master loop to avoid a glitch being caused by the momentarily missing cosine data file before the updated file had been created.

Changed tail length in Piag from 10 to 25 lines.

Added clearing mechanism for master log.

Fixed missing daemon entries in Piag.



Truck 2.144.02
Jun 20

Fixed another unrelated bug that was preventing the passive cooling from engaging properly due to the latest mods.

Added Pyro Power Deficit DSP plot to battery page for easier access while observing other aspects of their relationship.



Truck 2.144.01
Jun 20

(Hopefully) Fixed a bug in the "poll loop busy" mechanism that could cause a crash due to a previously undefined variable. If the variable didn't get set properly during the IPC call that reads it, PyFridge would crash and not start the compressor (potentially indefinitely). The variable has been "pacified" now just as many before it have to fix the same issue, and the module should no longer experience a crash associated with this issue.

Fixed a bug in the night peltier optimizer that would lock out operation, and let the battery temp rise indefinitely, until the hot side sink temp was above the battery's temp.

Fixed a bug that the above fix introduced that would have prevented passive cooling from ever occurring.

The logic works now as follows:

If all of these statements are true:

1. If it's night (Cosine < 0)
2. The battery temp is less than the active cooling target +0.2C
3. The battery temp is greater than the active cooling target -0.1C
4. The peltier hot side is cooler than the battery
5. Running in full on mode
...Set to full off (Reason: Night Optimize)



Truck 2.144.00
Jun 19

Fridge confirmed as handling end of day shutdown with excellent precision under normal load conditions. Still need to test a few levels of Pload etc to confirm that the correction factors are set properly.

Added night peltier optimizer to shutdown the fans when: 1. There is no sun, 2. There is a negative hotside-battery delta, and 3. The temp is at or above the active target. When these 3 conditions coexisted, the fans would continue to run with the peltier throttled completely down, essentially doing nothing but wasting power on the fans and making noise at night. The modification sets the peltier to full off. Presently only applies to cooling mode.



Truck 2.143.00

Jun 11

Hardcoded the top 5% SoC math to defeat it's original purpose of sensing end of day shutdown by battery falling below 100%. New algo should pinpoint the correct time without drawing any surface charge off the battery at this point.

There's still the "plugged in" implementation that will need to be moved and reworked as appropriate to finalize this move.

The score graph will now only have 1 player influencing "Overall", and as such, this plot will become useless, but will remain for the time being in case it needs to be reverted to it's original state. The "red teeth" in the power and current plots should be a thing of the past now! :)

Jun 14

Fixed a bug that was causing the peltier power curve to behave as NaN when it was zero

Added a "polling busy" signaling scheme to the master loop and fridge code so as to prevent anomalies caused by compressor start spikes.

The fridge will hold a pending start request for up to 2 minutes when it sees this signal so that it doesn't cause data misalignment (eg the voltage gets read, a compressor start sneaks in between, then net current is read, etc). The (albeit very rare) misalignments cause disruption of proper Pload/DSP subsystem operation caused by the compressor start spike, and create "paranoid anomalies" on the power graph (Pload specifically).

The flag is cleared after all power related polling is complete, at which time the compressor can then immediately start (it is imposed after the 5 minute equalization delay). If for some reason the busy signal remains on (due to an issue elsewhere), the fridge routine won't hang indefinitely, and will reset the flag file itself if the 2 minute timer expires. There should be an alarm condition already present if this ever were to occur.



Truck 2.142.01
Jun 9

Added dkgrey color alias to ranges.

Added [Zero] line to Pyro DSP plot (dkgrey).

Rearranged order of data so that values that regularly settle on zero are obscured by the [Zero] line.

Renamed Ptotal_deficit to Ptotal_deficit_DSP and Pdeficit to Pdeficit_DSP likewise to more accurately depict them as not being an actual power value but a value that only means something in the context of the raw Pyro mV input scale (where all of the math is performed for the control algo).

Renamed the "Pyro Power TEST" plot to "Pyro Power Deficit DSP" and replaced the former in the fridge webapp page with the latter.



Truck 2.142.00
Jun 9

Cleaned up PyroDSP module and enabled the power deficit code that shuts down the fridge when the sky is not providing enough power to run the fridge and other loads.

Changed the Pyro DSP Graph from 0 to 1500 into -1000 to +2000 to enable the total deficit to be sensibly displayed as a value below 0.

There is probably still a little tweaking that needs to be done to the factoring values for both Pload and Ppeltier but the logic all seems correct and upon it's introduction into the algo, the fridge immediately shut down (nearing end of solar day, laptop is on, battery was beginning to deficit). Can't complain with what little I've seen so far.



Truck 2.141.00
May 27

Tweaked: Fridge Core Average from 3 to 1 day and re-seeded. Changed name in plot from "Core_3_Day_Avg" to "Core_Avg".

June 8

Added conversion for peltier input voltage to power consumption. This isn't really more than an estimation as the modules aren't quite linear and is also affected by the temperatures found on either side of them. As the output is only used to sway the fridge control algo, this is close enough.

This should complete the remaining necessary variables to properly control the fridge via the pyranometer. As before, the values are all still in observe mode, will go live with them after a short period of observation and factor tweaking.

Added Peltier Input Power plot to battery page.



Truck 2.140.00
May 27

Added fridge average core temp (3 day) to fridge core temp plot. This value will be used to calculate approximate percentage of core reserve in a future revision.

Fridge label power had been tweaked to 120W again at some point... not quite enough... looks like 125W might be just about right. Tricky to set because of anomalies in the data that constructs the load curve.



Truck 2.139.00
May 12

Tweaked DSP baseload value from 25 to 35W.

Tweaked fridge manual -> auto mode reset from midnight to 5AM.

May 13

Reconfigured LEDd for long and short blips, and changed existing code that uses it to use the new folder structure. Foundation is also set for the new alarm daemons and limits (created folders)



Truck 2.138.01
May 11

Added pre-emptive compressor state grab to master loop to reduce glitches caused by delays between the classic polling and the Pyro DSP run. Updated Pyro DSP with the new data file location.

Adjusted fridge compressor consumption constant from 125 to 110W.



Truck 2.138.00
May 10

Adjusted peltier active/passive cooling temps to 25.5/24.5 respectively, and minimum passive cooling delta to -3.0C.

May 11

Added load power factoring to the Pyro DSP code and set up a graph to debug it. It takes Pload and averages it, much like the Pyro input, and then reads the fridge compressor state and offsets it by the configured power consumption constant. It then takes the offset and supresses the base load and multiplies it by a correction factor. This is the value that will be used to persuade the fridge algo. Currently it is not actually influencing fridge operation, it is only in testing phase as of this moment. Tweaks before final implement to be done as bugfix revisions.

Added DSP TEST graph to fridge page in webapp.



Truck 2.137.00
May 9

SysMon system needed some maintenance, things had gotten out of alignment due to hasty introduction of a couple of daemons. Watchdogs, CGI, and service manipulation scripts are now in alignment once again.



Truck 2.136.00
May 9

Fixed bug caused by copypasta in Peltier code. Now correctly states reason for passive cooling fan shutdown.

Tweaked operation of lightsfans. Now does not change state of overhead vent when truck engine is started.



Truck 2.135.00
May 9

Cleaned up Ranges database and conf file.



Truck 2.134.00
May 8

Rearranged battery page in the webapp.

Updated Peltier control code to model the cooling function based on the successful heating function logic. The irrelevant passive cooling code has been commented out, as well as gentle mode disabled for the moment to prevent interference with the classic. As such, the classic mode section was also commented out as the feedback does not seem to be an issue in cooling mode as it is in heat mode. It has been left in place in case re-enabling gentle mode at a future date causes the classic to get confused.



Truck 2.133.00
Apr 23

Changed thermodyne function to "Catalyst On/Pilot Only/Gas Off" and "Auto/Manual" (relocated "Check Propane" to main page). While it worked the old way, it was a nuisance and occasionally caused glitches (incorrect states) in the thermal boolean plot. This is also in preparation for the truck signal to kill the heat valve at some point in the future. "Catalyst On" and "Pilot Only" force auto/manual to "Auto"; truck signal changes these to "Gas Off" and "Manual" respectively, so as to take full control of the ventilation fans, as well as provide drop in support for catalytic heater safety kill in the future.

Tweaked thermostat target adjustments to +/- 0.1C instead of 0.5C now, mainly for better aux fan granularity.



Truck 2.132.00
Apr 11

Made adjustments to the logic in thermodyne. Ceiling fan operation is now based around a threshold for the master throttle. There may be other adjustments like this to take place, as the required behavior is very difficult to work out for "every" scenario.

Aux fan thresholds have been adjusted to be closer to the actual target temp.

Apr 15:

Commented out intake relay channel control lines. Functionally, the separate control of the coil was extraneous. This channel is now marked as reserved for future reallocation.

Back to two departure plots. The single was renamed as "Battery Block Departure Voltages (vs Bank)" and the new plot is "vs Pair". Unlike the first go around with this, the voltages presented are accurate, however they are observing two different perspectives. "vs Pair" is each block against the average of itself and its twin, "vs Bank" is each block against the average of the entire bank. This was done to give an alternate view without the distortion that the overall average imposes.

Updated battery page in webapp to reflect the new structure.



Truck 2.131.00
Apr 5

Added a crude Thermodyne daemon, and placed in smwd. This sequences the fans according to heat distribution needs. Right now it has only been seeded with some very rough estimates, and will need a lot of tinkering to get it to a reasonable point. With summer lurking around the corner, it's actually not likely to get much attention beyond some simple gross error correction for the time being.

Added "Passive" to the thermodyne mode switch sequence. Button now needs to be set to "Manual/Off" to manually operate the fans; in any other mode the code takes over.

Because the truck takes over some of the fans when the engine is running, it sets the mode to "Manual/Off" for now when this condition is present. This may change in the future, but for now meets minimum requirements to keep things compatible.

Apr 6

Added relay to fresh intake fan using RFSW A1D1. When actuated, it ties the intake to the aux fan. When released, it connects to the normal intake fan control via the speed control buck converter. When "Catalyst On" is selected, Thermodyne sets it to normal intake mode to ensure a fresh air supply is being provided.

Changed the criteria to engage/shut down the overhead vent; is now OR'd with a threshold for minimum master throttle. Below the set level (currently hardcoded), the vent disengages. This allows small tweaks to be made to the thermal delta that allows the room to absorb heat for later release.

Reverted to x-((1+2+3+4)/4) method for calculating battery average departures, as a single plot. Cleaned up block monitor calculator and tweaked web app appropriately.

There are lingering issues as a result of the modifications; namely the usage of the A1D1 RFSW channel and how it's labeled. Until the coarse experimentation is over, this will remain as-is to prevent a mess in the plots.

Truck 2.131.00.tar.gz


Truck 2.130.01
Apr 4

Mostly timing related tweaks and fixes:

Hopefully fixed a bug that was introduced when the flow was modified earlier. At the top of the hour, a fair percentage of the graphs were missing, I suspect this was due to the presence of the busy flag that was translated over to encompass the entire process. Parachute isn't aware of this flag in order to ensure backups take place, and may have caused some of the plot gifs to remain in temporary storage. No crashes were logged, so this is highly likely the issue. Increased the delay that parachute waits to execute the backup.

Gave the ADC and therm calls strict constraints to run in, with ~20% margin based on several runs. After the delay expires the master loop continues on whether the new information has been collected or not.

Removed the delay that was inserted as (what turned out to be) the result of the network issues caused by the defunct router. With the router having already been replaced, and parachute now staggered, there should be no issues with the plots turning up missing in the remote push, and the loop can run unimpeded. The standard normal loop (no parachute, no push) takes just under a minute to complete at this point in time. Normal loop with a single observed push took about 2.5 minutes. Observed a completed parachute with snapshot, it completed in less than 6 seconds. All appears well, and there is plenty of margin to move things around if still needed.

Removed an old precautionary folder that contained a (now useless) copy of the parachute files. It simply wasn't deleted after it was no longer done serving it's purpose, and was just eating space in the archives.

Truck 2.130.01.tar.gz


Truck 2.130.00
Apr 4

Rearranged the "master" script flow to keep things more organized. There are now only 2 masters; master_start (brings everything up after boot), and master_loop, calls everything (in order) that runs under the 5 minute cron.

Moved the battery math from readadc into it's own module.

Updated README with crontab.

Changed Departure Method 1 from comparison with "block less the other 3 blocks", to block less the voltage reported by the classic divided in half. This probably won't last; the classic has a resolution of 100mV, the ADC readings have 1mV resolution. This is going to result in some sawtooth patterns in the plot, which may effectively render it useless. I'm leaving it for now mostly for giggle's sake, and will probably just outright remove it later, leaving "Method 2" as the only plot (and appropriately renamed as the sole plot)

Added "last" to the SnapShot code. No more rough guessing and "walking" my way to the latest plots.

Added a "History" section to the main page, copied the pool button (for the normal historical views) and added a "Snap Shots" button that links to "last", above.



Truck 2.129.00
Mar 27

Added "midcyan" as a color in ranges, changed all cyan entries to midcyan. This is to make them more visible against the white background of the plots.

Changed thermodyne page to make graph clickable. Now can toggle between ambient temps and fan throttle plots. Unfortunately had to use some inline css to pacify the main control tablet's browser. Not really looking to update that unit to fix small bugs.



Truck 2.128.00
Mar 23

Fixed bug in snapshots that was causing graphs to disappear if the one preceding it had too long of a name in the gif title.

Moved block voltage button up to a more sensible location on the battery page in the webapp.

Fixed missing </div> tag in battery page in the webapp.

Removed/Commented out superseded/unnecessary functionality in the thermal analysis page in the webapp.

Mar 22

Calibrated ADC



Truck 2.127.00
Mar 20

Permanently wired in the divider resistors for the battery block monitors. Voltages seem accurate when measured against them, but some more snapshots should be done to confirm full scale calibration is correct. Added a new average departure plot, changing the original one to "Method 1", which is derived by averaging each block, sans itself. "Method 2" includes all 4 blocks in the outcome. The data will be similar, but will provide a slightly different angle to help catch things that may hide from method 1.

Added "Environment Fan Master Throttle" plot. Indicates the master buck converter's output voltage that drives the fans when they are on. Does not reflect any particular fan, and will read an output even when all fans are off. The plot is zero supressed at 2000mV, where the most sensitive fan begins to spin.

Added the new departure plot to battery page in webapp.

Added fan throttle plot to thermal page in webapp.

Removed abandoned "Battery Jumper DeltaV" plot in ranges/webapp.



Truck 2.126.00
Mar 16

Excellent opportunity revealed itself to make adjustments to the pyro correction factor. Clear sky with minimal absorbtive clutter. Wide open parking lot, approximate alignment east/west, forward facing east. Some distortion will still be in the value due to physical alignment issue that's visible from the ground. I've taken this into account and will be adjusting it according to the pyro's solar noon in anticipation of the nicer upcoming seasonal weather. Looks like 0.615 is pretty close to the magic number.

Added "Full Scale Load Power" plot, 0-2000W, all by itself... Useful if you happen to have one of them new-fangled inverter microwave oven thingies on board ;)

Added "Full Scale System Current" plot, 0-200A, again alone, and for the same reason as above.

Added full scale plots to the battery page in the web app.



Truck 2.125.00
Mar 13

Added DST/EST code to Cosine. Manual changeover is necessary because the master clock is the Classic, which doesn't do a jump of it's own, and no other NTP sync source is in use/available.



Truck 2.124.02
Mar 10

Stopgap #2 in place for the ADC, currently in a rather ratnest form simply for testing. After it goes thru a couple of good cycles and works correctly, the permanent version will be connected. Now using mode 3 on the ADC (-600.00mV to 600.00mV) and modifications to the resistor network that feeds each channel. Appears as of the moment to be working correctly.

Added crude battery block reader to main battery page in the app.

Fixed bug in ADC calculation (made integer) that was causing wrapping issues in the battery voltage display, resulting in weird wrapping issues.



Truck 2.124.01
Mar 8

Found and fixed the issue with the ADC. Unfortunately, it ultimately will need to be redone on the hardware end, but for now the output is at least sane with no goofy magic tricks in the software.

Added crude cgi page for reading battery block voltages in "across the room format"... And I'm only getting younger...



Truck 2.124.00
Mar 8

Attempted calibration for the monitors, however there may be an issue with the board that may make it unsuitable for this purpose. Time will tell as the voltages are checked against the meter at various points in the future as well as how the curves behave.

Lifted the pen on DeltaV plot (NaN); if all goes according to plan, this will no longer be a necessary graph and the ADC channel will be reallocated.



Truck 2.123.00
Mar 7

Added the second ADC board and implemented individual battery block monitoring. Reads each block separately and calculates the departure from the average of the other 3 blocks. Cabling still needs to be done.

This will replace the delta monitor, as while it was able to detect that there was a problem, it alone cannot provide enough data about what is going on to pinpoint a specific issue. This was born out of necessity, as block 3 appears to be weaker than its twin (#4) and I will need documentation to provide to the battery vendor for replacement.

Added new plots to battery page in webapp.



Truck 2.122.00
Mar 6

Finally got a full tank of propane from empty, 4.4 gallons is what's officially going to be used as the reference.

Made some changes to the algo for time remaining, things should make more sense at the output now. Still keeps track of run time but instead of displaying how much time is left based on a separate calculation, it now infers it from the HPG and remaining propane.

Mar 5

Added start time shifting to Pyro DSP boost pulse code. Can now tweak the phase of the boost in relation to the cosine trigger. Increased amplitude from 450 to 500 and length from 3 to 4 hours, with a 0.5 hour shift early start. These controls now need to be brought out to files and into the webapp for easier access.

Truck 2.122.00.tar.gz


Truck 2.121.00
Mar 4

Added "Pilot Only" mechanism to thermodyne system. Presently only tracks the amount of time spent on pilot alone, so that all of the propane consumption is accounted for. This may prove too difficult to measure with enough accuracy to be useful, but as spring comes, the milder days find the pilot as a "chill cutter" at night, and this is throwing the usage enough that the gauge is reading too high toward the end of the tank.

Renamed "Propane_Usage" to "Catalyst_Usage" in ranges and associated propane tracking code and added "Pilot_Only" to the running time plot.

Restructured Environmental Boolean to reflect addition of Pilot_Only logic.



Truck 2.120.06
Mar 1

Fixed a bug in PyFridge that was causing the operating mode to not plot correctly in ranges.



Truck 2.120.05
Feb 27

Fixed a bug in the environment thermal boolean that had 2 tracks transposed.



Truck 2.120.04
Feb 26

Fixed bugs that were preventing the catalyst as well as smps power/charge modes from showing up in boolean. The latter required adding explicit outputs to the SMPS daemon; the original issue was misinterpretation of filenames, resulting in no plot.



Truck 2.120.03
Feb 26

Fixed a bug that was causing 4 fans to be hidden in their boolean plot.



Truck 2.120.02
Feb 26

Fixed a bug in PyFridge/NaN_Boolean that was causing the caller to revert to solid emergent mode with no operation. Now uses 1=Normal, 0=Null, -1=Emergent to track the caller.



Truck 2.120.01
Feb 26

Fixed init bug for fridge operating mode state, defaults to "2" (auto)



Truck 2.120.00
Feb 26

Minor noting in PyFridge regarding the caller mechanism tracking for normal manual (non-locking) start. Relay in inverter really is the target here, not software.

Added functionality for normal and emergent start requests anyway, even tho the normal request can really only be used to 'hint' upcoming conditions when the DSP isn't still holding it locked out. Beats jumping thru hoops with forced overrides when those rare conditions exist (such as trying to get a jump on the day without annoying the neighbors with the genset).

Updated the crude manual control page with the new buttons (however as of this writing, confirmation that everything operates correctly has not been completed).

Updated README with visudo (yes, there's still a little of that going on as the feature creep slows down).

Added operating mode state output file into PyFridge in preparation for new boolean plots.

More work done to NaN_Boolean.WIP code. Counterparts for ranges written as well. No fatal bugs as of the moment, but complete accuracy of the positioning of each track will be a work in progress for a bit. Replaced the deprecated graphs in the fridge and battery pages in the webapp, and created an additional basic boolean display page with the complete set.

Added CGiTunes to entertainment page in webapp.



Truck 2.119.01
Feb 19

A little more tweaking of the estimation code. Pessimism factor cut in half, and tank reset bumped from 4.1 to 4.2 gallons, even tho this is almost a pointless adjustment. In theory, the number should be closer to 4.7, but still haven't seen this actually proven yet.

Updated the actual usage stats for better future accuracy, now using 3 fills instead of the one to work out the typical rate of consumption.

Clearification tweaks made in peltier/status modules for quicker interpretation of logic reasoning.

More work done on new boolean state interpreter for ranges plots.



Truck 2.119.00
Feb 16

Added "Check Propane" page to webapp. Still crude, it provides the gallons remainder graph, displays gallons and time remaining, and allows for reset when the tank is swapped/filled.

Annotated the code a little better, and reiterating here; the app pages work with the /Math/Propane_Monitor daemon. The code and nomenclature all need some cleaning up and reorganizing. Some cleanup already done in the check propane page.

Adjusted the gallon/timing windows within ranges for the propane plots and fixed a bug that was causing them to scale incorrectly. The values themselves will still very likely need adjustment once the complete capacity of a tank is known. Calculations so far are within good tolerance, about a half hour or so variance between the two fills. The next tank should be a complete one if I've timed it correctly.



Truck 2.118.00
Feb 10

Adjusted active heating temp in peltier from 20C to 17.5C to improve usage of passive heating and reduce energy needs when it is in active mode.

Changed jumper deltaV probe over to problem jumper and adjusted scale in ranges appropriately so this cable can be monitored closely until it can be replaced.

LightsFans is verified as operating correctly now. The original cause is still under investigation but the sanity checks in the script are preventing it from triggering the lights in the middle of the night and whenever else it felt like it.

Fixed a bug in Pyro_DSP that was causing the sync pulse to only follow whole hours (how was this not caught sooner?!)

Added a new thermal management page, and called it "Thermodyne". Thermostat was 1, already designating the electric heat page, and 2, this doesn't actually control the heater. It has a button for telling it that the heater has been started/stopped, a check propane button (to bring up a not-yet-written page that shows the calculated usage plot and provides for resetting it when the tank is changed/refilled). Another difference is that in addition to the 4 fan groups that the thermostat page controls, this one also has the fresh air intake included. In the future, "turning on the gas" will automatically preconfigure the fans to operate as necessary for both comfort and safety; the electric version does not need the safety control for fresh air et al. As such, a bit of associated functionality with this page is not complete.

Added propane monitor and associated plot. Estimates amount remaining in the given cylinder based on the average consumptions calculated from fills. Toggling the "Catalyst On/Off" button decrements the tracking file according to past calculated usage. Eventually I'd like to make this a learning algo, but as it sits, there's plenty of room for error anyway. The resolution of the filling pumps is 0.1 gallon, a 5 minute "slice" consumes about 0.003 gallons. At present, it must be manually reset because the actual total capacity of an empty cylinder is not precisely known at this point in time, and all of this is just easier to do all at once.



Truck 2.117.00
Feb 4

More hunting done for the lightsfans bug. It appears that it may be related to how the trigger is written or possibly that pin reads are not always occurring properly. The exact root cause is still unclear, however the false triggering should be a thing of the past, as there is now robust sanity checking in place.

Cleared the old crash trap files for RFSW. There was one that had been left "hot" that was preventing the "last crash" trap from working correctly because it was always being seen as the last event. Hopefully this will help resolve any crash related issues involving the lightsfans issue.

Changed passive heating target temp in peltier from 25.0C to 22.5C. The regulation of the temp is much better now with the logic changes that have been made recently, now just fine tuning to keep temp shifts as slow as possible yet keep fair regulation.

Changed Jumper deltaV offset to 0mV (likely need to check for temp coefficient). Battery balancing is in progress, calibration was detected as being off during this process.

Fixed bug causing absorb extend to push the trigger off scale. Should now properly set to 12.0V (12000mV in the code, eyeroll).



Truck 2.116.00
Jan 30

Began work on adding the remaining boolean states to the NaN translator for ranges.

More work done on the peltier daemon:

Adjusted passive heating threshold from +3C to +2C.

Cleaned up heating side code. Changed explicit verbose outputs to diagnostic vars that get put into the now revised status generator. Shows final outcome of the heat loop as well as the reason it landed in that state.

Added outside ("hot") side sink to battery temp delta calculator to status generator.

Forked heat target setting script into active and passive versions.



Truck 2.115.00 
Jan 26

Fixed a bug in peltier that was causing the fridge state to be misinterpreted. Caught a related bug that hadn't manifested itself yet for the classic state.

Adjusted passive heating threshold from +5C to +3C.

Fixed a bug in SMPS that wasn't allowing the power control relay to be turned off while the truck is running.

Changed behavior of SMPS while the truck is running, to allow bulk/float mode manipulation as well as power relay control. The previous inception of this function did not work correctly, and this section of the code was completely revamped. It has a lockout period where it completely ignores any input whatsoever following the reception of the truck running signal, allowing manual override only after the startup sequence is complete. The default startup sets the mode to float.

The code still has an issue of not allowing a forced float when the battery average is below threshold when the truck is off; this will be addressed after the bug surrounding the absorb extend is resolved, as they are related.



Truck 2.114.00
Jan 25

Fixed bug in smwd that was causing fixpermz to be started every cycle of the watchdog.

Set up primitive log to catch possible issue with new lightsfans daemon. Eco lights came on out of nowhere, verified that it was initialized internally due to tracking file state change (as opposed to stray radio signal), but no webapp activity in the logs, nothing unusual security-wise. Only remaining source for the action is lightsfans (which seems to work properly otherwise but is new and related).

Fixed a bug in SMPS that was not allowing the absorb extend routine to init correctly. Verified it now functions, however due to the way the internal timing works, it may take an extra plot cycle to show up on the graphs. It is also setting the average to 0 instead of 12.0 as intended. The extension should however still work as designed, but until this bug is fixed, the average will go off scale until near the end of the extension.

Changed the forced float mode when the truck is running to allow bulk mode to run. I'm calling this ***HIGHLY*** discouraged for most situations, but I found at least one circumstance where it would be acceptable and even necessary to use.

Added classic and fridge state sensing to the peltier, as well as a passive heating prerequisite. Fans shut down if the "hot" heatsink is not at least 5 degrees warmer than the battery while in passive mode. Peltier is disabled unless fridge compressor is off and classic is either resting or floating. This is because there is some undesireable interaction between the peltier and classic when it is under MPPT; oscillations confuse the classic's algorithm.

The issue in FTPush may have finally been somewhat narrowed down to a logic construct in the dual-mode trap set up in the beginning of the code.



Truck 2.113.00

Changed behavior for SMPS power relay to turn off instead of remain on when the truck is shut off (to reduce parasitic load).

Added some IP viewable diagnostics to FTPush. That is still one flaky SOB.

Added barebone New Anti-Draft controls and associated scripts to Thermal page as a temporary patch until the thermostat page can be revised properly.

Updated README with visudo.

Added LightsFans daemon. Shuts down lights and sets up fans appropriately for travel (primarily ensures exhaust vent is running to keep any vapors evacuated).

Added LightsFans to smwd.

Added LightsFans to Services page.



Truck 2.112.01

"Verified SnapShots is now working correctly." ... well... as far as I was checking it, anyway...

Fixed a bug that was causing the year to decrement/increment instead of the day of year for the prev/next links and manually corrected the affected index files.



Truck 2.112.00
Jan 6

Implemented 2 different target temps for the peltier control since in heat mode at night, it's much more efficient to passively heat than to drive the peltier.

"Gentle mode" has now been made "softer"; still controlled by a hard variable, but is staged to be controlled by a file once the new logic is proven, and it can be correctly implemented into cooling mode as well.

Interesting side note in all of this is that with all 4 batteries installed, the analog oscillation of the peltier controller has completely vanished. Time will tell what effects the additional thermal mass and heat source has on cooling mode.

Verified SnapShots is now working correctly.



Truck 2.111.00
Jan 4/5 2016

Allocated A1D0 to new anti-draft fan test channel and set as on.

Added some evaluation code for "gentle mode" heating in the Peltier module. Presently is hardcoded to turn off the peltiers if the battery box air temp is >= battery temp + 1. Fans continue to run while the module is shut down. Should help to prevent hot spots in the box. Status also displays air temp as well now to assist with diagnostics and optimization.

Some tweaking done to rfsw/rfswd in both the associated master timing setting as well as internal, to help improve the lag (particularly in the lights where it is most annoying). There could still be some performance improvement but it's quite a bit better compared to what it was.

Fixed a bug in snapshots that was breaking the links beginning at 2016. Also added CSS link to template. Previous snapshots will need to be manually edited.



Truck 2.110.00
Dec 30

Calibrated jumper delta and checked/tightened all battery connections. Delta appeared to be trending more and more negative, now staying closer to zero again.

TODO: Might be worthwhile to create a rolling average that spans over the course of several days to track the general trend. Theoretically, the average should net zero across cycles. Also along these lines is a rough impedance estimation calculation based on A/V or something along that line. I expect it will roughly track the jumper delta as a "rectified" version.

Fixed a bug in the smps code that was causing the absorb extend routine to malfunction.

Brought the remaining "normal" control (power, absorb extend) files "to the surface" for future use within cgi. Added to existing smps control page for testing.



Truck 2.109.00
Dec 25

Introduced the brain for the pushback charging system to smps. It now sequences the start of the MSW and SMPS when the IG1 signal is detected:

   Forces float mode to reduce stress on the alternator after startup is complete.

   Waits 60 seconds (for cranker voltage etc to stabilize)
   Sends the control signal to turn the MSW on

   After another 10 seconds or so, the power control relay in the SMPS is engaged
   The TDR inside the charger subsequently connects it to the rails with a soft start.
Shutdown is a bit simpler when the IG1 signal disappears:

   It clears all related attributes to running in pushback mode
   Shuts down the MSW
   Leaves the SMPS power relay engaged (for the time being this is required as it's the only "signal" that turns it on).
Had to rearrange the timing mechanism for the original averaging system and charging algo. Now uses epoch instead of tick based delay. This was a poltergeist of bad code from nearly the beginning that needed to be exorcized because the entire loop was being held up by the master sleep. It now has a master timing entry just like all the other daemons and cycles at ~ 1Hz, with the averaging algo triggered by it's own epoch timer.

Verified functionality.

At the moment there are override code/files in place, but no cgi control associated with them outside of bending the bulk/float buttons, so that it wasn't left completely on it's own between stopping points during the transition to full automation.

The LED on the cab receiver is presently set up to go green when the SMPS relay is engaged, however this behavior is subject to change, as this indicator may become the cab counterpart to the alarm strobe at some point in the future.

Reworded a comment in the fridge I happened to catch while swiping a copy of a chunk of code from it.

The snapshot system has been verified to be functioning correctly.



Truck 2.108.00
Dec 21

Fixed a bug in ranges config causing the "Truck_Run" pen to not show up in System States plot.

Fixed yet another bug in the FTPush system, and did some tweaking on the related scripts. It now won't interrupt itself erroneously if the auto trigger should pass by and attempt to start the script. It now requires that auto mode be enabled for the auto trigger to perform a pkill to interrupt an existing run. Hitting Off at any time will kill any push in progress and turn off auto mode if it is enabled.

Renamed "Pushlist_Auto" to "Pushlist_Last", a more accurate description of it's existence. The file is generated regardless of trigger.

Implemented a snapshot system. Runs after the midnight parachute each night (to ensure the plots are not presently being modified). Creates a folder with +%Y_%j format (Year_DayOfYear), and generates reference links to the day prior to and following the present. The saved graphs are the complete daily set with a human-readable reference in the header line. Random file selection can be performed by directly manipulating the URL. This will not yet be available to the public, but may someday make it out there. YTBD. Gotta make sure it runs correctly first :)



Truck 2.107.00
Dec 21

Installed Truck IG1 detection wiring and reworked the mechanism in the fridge module so that it reads the port directly rather than using a file (that would have necessitated another polling service somewhere). It reads the pin itself and then writes the state out for other modules to use. This feature's primary purpose is to shut down the compressor whenever the engine is running, so as to help protect it from additional (possibly excessive) motion that gyro effects may have within due to driving conditions. The signal will also be used as part of the logic that controls pushback charging.



Truck 2.106.00
Dec 21

Persistent alarm due to rfsw has led to an alarm disable option for this subsystem. This isn't the permanent fix, but since there does not appear to have been any real issues associated with it ever, this is a bandaid to get past it for now so that more important things can get done. There are a couple of thoughts on the table to fix the root problem; as opportunity allows, they will be looked into as the final solutions. Until then, worst thing that happens is there's a delay processing the instruction(s) sent to rfsw.

Created new lights page in webapp, removed old page/buttons/code.

Added Battery Jumper Delta V plot to battery page.

Added SMPS Power control to SMPS override page.

Added Graph Pool Push Enable/Disable/One-Shot to the system page.



Truck 2.105.00
Dec 20

There's still a bug causing rfsw to puke on various state control file changes. The RFSWd timing was slowed back down from .1 to 1 sec, so there should be a lot less chance of interference for at least the time being. The real fix would involve better sanity checks within rfsw itself.

Added Battery Jumper DeltaV plot. Monitors the voltage difference between the two sets of battery jumpers. This is able to detect a loose or otherwise failing connection anywhere inside the box all the way up to the junction bar on the power board. After observation for "normal", an alarm threshold will be set that can stabilize the system and/or disconnect loads/charge sources to bring the net current as close to zero as possible so as to minimize the chance of a spark. In addition, this will also gradually grow as the batteries age, providing more insight to their overall health.

Fixed a bug in pushplot that was causing the last file in the auto-generated list to be improperly formatted for curl, triggering an alarm.

Changed delay in ranges master relating to pushplot that is believed to have been conflicting with parachute, triggering an alarm.

Fixed another bug in pushplot in the internet connection test that was triggering an undesired alarm when the web was not available. As originally envisioned, it now simply ignores the lack of connection and aborts the sequence.

Tossed a dirty hacked up alarm clear button in place for the moment. What's one more on a pile too tall to see the top of? :)

Changed rfswd master timing from .1 to 1



Master Backup atver 2.104.00
Dec 19

Found the workaround for the "GPIO bug" involving RFSW. Inspiring the changes in the SysMon mechanisms, it now writes out stderr to dedicated dump files for each channel into a special subfolder within CrashData, which is ignored during the alarm checks. It then checks the exit code of the call, which is a 0 if the only issue was the pullup resistor warning. Upon discovery of the 0, it clears the associated dump. Actual crashes fall through the bottom, and are pushed into CrashData, where they trip the alarm until cleared. Bunch of extra CPU cycles for something that "we all knew" before the warning was added and everything worked just fine...

Reworked the entire master start and SysMon mechanism:

   Removed all direct daemons calls in master_start. As of now, only the secondary watchdog is started from this script. The startup sequence then cascades to the primary watchdog, which starts all of the other services. This greatly simplifies maintenance on this end of things. Also cleaned up old commented out garbage at the bottom of the script.

   Added a new ramdrive, mounts to SysMon/CrashData; Old file tree is no longer compatible (hence the master atver). As of the present, the dump files are not kept by a parachute if the system is cycled or downed. If the need should develop down the road, it'll be addressed then, as it's a relatively easy addition but unwarranted at this point, since many of them are self-clearing anyway.

   Renamed "sm_overlord" to just plain "overlord". The "sm_" was a workaround for a bug caused by the structure that's being replaced, and is no longer needed.

   Renamed sysmon to LEDd. Doesn't make any sense to you either? Yep, you guessed it. Place has been a mess.

   Changed dumpfile paths and filenames for:

      Overlord (overlord)
      SMWD (smwd)
      LEDd (LEDd)
      CrashMon (crashmon)
      RFSWd (rfswd)
      PyFridge (PyFridge)
      SMPS (smps)
      Peltier (peltier, status)
      Inverter (inverter)
      GenSet (genset)
      Thermostat (thermostat)

   Correct startup operation verified.

Non-daemon dumpfiles:

   Changed dumpfile paths and filenames for:

      Math (master)
      Therm (collect_temps)
      ADC (readadc)
      FTPush (pushplot)
      Deadman (trigger)
Garbage collection for old crash.output files performed.
Added cycling log. Reports when master script was run and what Overlord's "exit" status was, and "Parachuted" calls (cycle/down).

Fixed a bug in FTPush caused by the addition of the recent disable mechanism.

Moved DS modprobes and NFS bug workaround from rc.local to master_start.

Added perm check to initial startup sequence in the primary watchdog to ensure ramdrive permissions are correct.

Removed old fan control page and associated buttons from webapp.

(Hopefully) fixed a bug in thermostat that was causing the A1D2 control file to be written incorrectly, causing RFSW to crash on rare, seemingly random occasion. Bit of a head scratcher, but the lack of a \n is the only thing that came out of the woodwork. A1D0 was also affected, and has been an abandoned (unallocated) channel for a while, but wrote it out with the newline as well just to prevent potential issues (if that's indeed the cause). A1D2 is the heating element channel, which has been working correctly, so... Shrug. This is what physical interlocks are for :)

Updated README with fstab and rc.local

New hardware tested: Added power control relay to SMPS; GPIO 22. No brains for it yet, functionality verified only with Set_Pin.



Truck 2.103.00
Dec 17

Moved fan controls over to thermostat page. Thermostat page can now be considered fully functional. Some aesthetic tweaking might be in order with the CSS, but it has been verified to be fully operational.

Renamed "Summer Bed Fan" to "Ceiling Fan"

Renamed "Winter Bed Fan" to "Aux Fan"

Found issue in RFSW mechanism where thermostat module was interfering with other GPIO interactions for the radio. The thermostat was set up to call the RFSW module directly, and with decreased delay to improve response of the heater, the odds of two instructions colliding were higher, causing the secondary instruction (eg light on/off, etc) to be ignored. Created a new service, RFSWd, that now has sole control of the actual transmitter. States are changed as they always have been, but the "punch" is no longer handled by the module making the requested change.

Added a "GenSet Response Delay" file to the master timing list. This is used by the thermostat and fridge as the delay to allow spoolup before connecting the load. Tentatively set to 2 seconds, this may need tweaking both in the master timing file and/or the code itself (possibly an additional second placed before the flag file is sent). The value in this is heavily dependent on the other master timings, particularly the thermostat and fridge. If it is too short, the genset will not have been spooled up before the load is connected, too long and it just keeps it running full out for nothing.

Removed "start_muted_thermostat". Thermostat module is now called directly again, since there is no GPIO warning issues associated with a RFSW call anymore. It strictly writes the flag file that controls the heater.

Updated SMWD with the changes and have RFSWd marked as experimental (resource code is commented out above it, to be removed in a future garbage run).

Moved several now usele
Wanted: Schrödinger's cat, dead and alive.

Offline MadScientist267

  • Impossible Condition Curator
  • Moderator
  • Hero Member
  • *****
  • Posts: 1514
  • Karma: +44/-4
  • Rules? What rules?
Re: Truck Software Revision History
« Reply #1 on: August 21, 2016, 09:57:18 am »
Consolidated the old additions into one post.

Also, Yes, I'm aware that the log post has long started rolling off the bottom due to board thread limits. I will hopefully be implementing a workaround for this in the near future, making the entire text file available somehow or another as a more "real time updated" downloadable file.

November 09, 2015, 01:30:23 AM
Added 2.76.01 to 2.80.00

November 22, 2015, 06:54:18 PM
Added 2.80.01 - 2.90.00

December 09, 2015, 07:30:07 PM
Added 2.91.00 - 2.99.00

December 20, 2015, 02:08:14 AM
Added 2.100.00 - 2.104.00

January 27, 2016, 12:17:42 AM
Added 2.105.00 - 2.115.00

February 26, 2016, 03:20:18 PM
Added 2.116.00 - 2.120.00

March 13, 2016, 09:42:45 PM
Added 2.120.01 - 2.125.00

April 04, 2016, 06:59:08 PM
Added 2.126.00 - 2.130.00

June 18, 2016, 12:29:29 AM
Added 2.130.01 - 2.143.00

August 21, 2016 09:57:18 AM
Added 2.144.00 - 2.151.00

Wanted: Schrödinger's cat, dead and alive.