Controller: Arduino Pro Mini 5V (based on a ATmega328P microcontroller)
============================== main operation blocks
------ Startup:
* check for LCD presence. if none (or the programming button in the programming state), launch in the serial-controlled mode
* 2 timeouts - one 5 sec for config, one 10 sec for power setting. can be interrupled by any button
* check mains voltage. If 120, limit power to ~1.5kW
------ Charging (CV or CC):
* modulate duty cycle per PID loop calculations running at 250Hz (double the line frequency)
* break when exit condition satisfied or stop / pause commands received
======== SERIAL COMMAND SYNTAX =================
M,ccc,vvv,sss,E - start charger from 'READY' state with ccc CC point and vvv CV point
charger will echo settings. make sure they are what you sent,
sss is a checksum = (ccc + vvv) % 1000
M,001,000,001,E - stop charge
======== SERIAL STATUS REPORTING ===============
every 100ms or so, the charger will report its status.
Generally a dump of the critical charging parameters in the following format:
'M,D0,C965,V334,T-68,O1,R0,E' - [D]uty 0%, output [C]urrent 96.5A, output
[V]oltage 334V, heatsink [T]emp -68C, [O]utput charge 0.1AH, [R]untime 0 minutes
Original version created Jan 2011 by Valery Miftakhov, Electric Motor Werks, LLC & Inc. All rights reserved. Copyright 2014