code and electronic projects

pretty much everything i do has been electronic or had electronics and code buried within it forever, but not much of it has made it to the intertubes. it should be no surprise that most of this is now code, and electronics to support that code. (since the world remains firmly analog there remains analog electronics, mostly as interface to code.) everything i do is embedded, no graphics, no commodity audio, no social media, etc.

"recently" i've made a pair of boards that stack onto Mega/DUE Arduino boards (i always need all the pins) that handle interfacing. these are here, below.

roadster code

all of the electrics in my rambler roadster are implemented in code, on purpose-made but generalized hardware, in a four-processor distributed configuration. this code is thefull-blown version of my a definite method multitasking strategy and has a super-robust inter-process/inter-processor communication system.

here is a description of the the roadster code system, the roadster electronics.

at the moment it's the only description of the multitasking strategy, but i will break out a much smaller-scope project, without all the multi-processor and IPC complexity.

external documents

MISRA-C:2004 has many great guidelines for writing C. the anti-C++ bias was relaxed in later years (// comments etc) but most of the good-practices suggestions are ways to avoid the pitfalls of some of C's behavior (eg. automatic type conversion).

half of the MISRA stuff is about testing and development environments and production accountability; those don't apply (much) to me or individual coders, but they sure do apply to folks at places like Toyota, where truly horrific coding practices caused actual deadly death. bad practice writ large: 10,000 global variables in multi-task code withg life safety entangled. idiots.

because the U.S. court system is open and public the full transcripts of the highly technical evidence is now public record. and it is fascinating. i read it on a long air flight. the judge is no dummy, but he's not a nerd; talented consultants rendered the truly horrific coding practices of toyota's programmers visible.

reading this sent me down a long path that has culminated in me reading and modifying all of my Roadster code work to meet most of the appropriate MISRA-C:2004 coding standards. they're actually very good recommendations; in fact i found a number of errors in my own code simply reading it. (most were due to implied casts and size of variable issues).

most of my code now at least approximates the MISRA-C:2004 spec, as far as coding style goes.

here are copies of the Toyota disaster documentation:





electronics

pretty much everything i do has been electronic or had electronics buried in it, but not much of it has made it to the intertubes. it should be no surprise that most of this is now code, and electronics to support that code. (since the world remains firmly analog there remains analog electronics, mostly as interface to code.) everything i do is embedded, no graphics, no commodity audio, no social media, etc.

roadster electronics

the hardware here was designed for the roadster project but it's quite generalized. it's aimed at closed loop motor/motion control with analog feedback and various digital and analog controls and sensors. automotive environment meaning norminal 12 volts negative ground, high current (1 to 25 amp) nasty inductive loads (so things like LEDs are trivial). sensors and inputs are low-impedance. power control, management, and filtration designed in. PWM control of everything heavy. internal thermal management. flexible/configurable analog/logic input networks.

there are two boards, POWER and ANALOG. these are Arduino Mega 2560 stackable boards, use either or both (roadster computers all use both). here is the documentation for the boards, schematics and gerber files. if the Eagle files are interesting let me know i'll put them up. the BOMs are not very good however.

40mm fan, POWER, ANALOG boards on Arduino Mega 2560

analog schematic analog board Gerbers
power schematic power board Gerbers

here is the code that drives this hardware. the Cooling computer has it's own page.

ANALOG

the analog board has analog and logical inputs, and four modest power outputs.

ANALOG board, revised mar18

POWER

the power board contains eight high-current automotive high-side drivers, board/system power management, output load current sense, load power source voltmeter. the VN5E010 chips provide short-circuit protection, load dump and reverse battery protection, and have internal thermal management and feedback, all supported by the board and code.

POWER board, revised mar18
solder sides

ASSEMBLY

the boards stack onto each other, and an Arduino Mega 2560, and fit into a semi-open plastic box which is mounted to the inner firewall. the boards are plastic spray coated to protect against condensation.

analog and power boards stack on a Mega 2560
stacked with thermal
as installed. the two small black cables are Uplink and Downlink.