Battery Testing and Embedded Instrumentation Systems with NI & LabView

The video linked below is a reasonably quick tour (half an hour) of a common approach to instrumentation and control problems based on the CompactRIO/single board RIO platforms developed and sold by NI. The video briefly describes the external hardware setup which is a bespoke linear trans-conductance amplifier. It then describes how the user interface software, real time PC software and FPGA firmware are linked together and how they communicate to provide both the intended instrumentation and control but also act to ensure the safety of the system so that it can operate unattended. The detailed programming of the user interface and real-time systems are glossed over partly to keep the video to a reasonable length and partly because I have used parts of this code (which are not shown) in other applications where, although I own the code, one of the end-users would prefer some aspects not to be public knowledge. Specifically, the setup of the file system, how the config files are read and parsed and how the grammar is written to interpret some aspects of the user input and how the data files are named, stored and backed up automatically.

Therefore the video concentrates on the FPGA “code” which is a fairly simple PI(D) based battery charger/dis-charger and cycling system. The FPGA code is applicable, without very great changes, to a wide range of instrumentation and control problems where the plant is linear or may be assumed to be reasonably linear and has no long delays. This generality makes it good video material.

This kind of approach (PID) would be unsuitable in situations with a significant plant delay. In sampled time systems z-1, a pure delay, translates to continuous time (s domain) lagging phase shift. This acts to reduce the phase margin of the feedback system leading to either very sedentary dynamic response but little overshoot or fast response with a good deal of overshoot and a long settling time. The designer can choose their preferred response defect but, the only way to escape it to improve the phase margin. Often other control strategies are implemented that are not so sensitive to plant delay such as Smith prediction + PID or a model predictive control approach. Fortunately, while batteries can be described as non-linear systems* they don’t have appreciable delays so PI control in this application is certainly sufficient.

*Stefan Maxwell/Nernst Plank + Navier–Stokes + Thermo-mechanical stuff, Kirchhoff and Ohm’s laws all coupled together with plenty of CPU cycles and a forest of RAM behind it – I can almost smell the virtual electrolyte. Bear’s have a very good sense of smell…

I have worked on battery testing, battery management and modelling of batteries/cells both at a system level (Simulink) and an electro-chemical ‘multi-physics approach’ level (COMSOL) for a number of years.

The engineers at bear instruments hold at least CLD status from NI and have more than 10 years experience in labview programming and NI hardware including the DAQ and RIO platforms.