no functional change
[digitaldcpower] / README.htm
1 <h2>Tuxgraphics Digital DC Power Supply Unit</h2>
2 Software for the version 3 hardware.
3 <pre>
4
5 Compiling the software and programming 
6 the microcontroller (atmega8 or atmega8a):
7 ==========================================
8
9 1) edit and adapt the file hardware_settings.h 
10    (calibration and selection of the right hardware type).
11    You can as well just copy one of the pre-set versions
12    on top of hardware_settings.h. 
13    Example: cp hardware_settings.h-22V hardware_settings.h
14
15 2) load and compile:
16 make 
17 make load
18
19 3) set the fuse bytes to 8MHz internal with BOD:
20 make fuse
21
22 This should result in the following settings:
23
24   Device signature = 0x1e9307
25    lfuse reads as A4
26    hfuse reads as D9
27
28 Fuse Low Byte details
29
30 BODLEVEL  Brown out detector trigger level = 1
31 BODEN     Brown out detector, 0=enable     = 0
32 SUT1      Select start-up time             = 1
33 SUT0      Select start-up time             = 0
34 CKSEL3    Select Clock source              = 0
35 CKSEL2    Select Clock source              = 1
36 CKSEL1    Select Clock source              = 0
37 CKSEL0    Select Clock source              = 0
38
39 The "make fuse" needs to be done only once
40 unless you change the Atmega8/Atmega8a chip. make/make load
41 need to be repeated everytime you change something
42 in the software (e.g update of hardware_settings.h). 
43
44 The poweresupply must be powered up during programming
45 but nothing should be connected on the output. Make
46 sure that you do not accidently press any button
47 during the programming (while loading the software into the uC).
48
49 Compile under windows
50 =====================
51 Please use the provided Makefile.
52
53 There are as well 3 batch files which you can use
54 to run the makefile. To use them edit them and change
55 the path as per your avr-gcc installation on your PC.
56 After that run them by double-clicking on them in the 
57 file manager.
58
59  winmake.bat  -- comile, this is mandatory to use
60
61  winclean.bat -- delete all files generated during compilation
62
63  winload.bat  -- load software using avrdude, may also use
64                  some other means of loading the softare. In that
65                  case you do not need to use this batch file.
66
67  winsetfuse.bat -- set fuse bytes using avrdude. You may as well use
68                    some other means of changing the fuse bytes. In that
69                    case you do not need to use this batch file.
70
71 Calibration
72 ===========
73 To calibrate the display edit the file hardware_settings.h
74 Here you can change also the settings between the 30V and the 22V version.
75
76 In general you should only need to change 
77 U_DIVIDER and I_RESISTOR by very small amounts. 
78
79
80 Overview
81 ========
82 This is the software for the tuxgraphics.org electronic digital DC power supply. 
83 A microncontroller controlled bench DC power supply unit. 
84
85 All of the control logic is implemented in software. This
86 saves a lot of parts compared to conventional lab-power 
87 supplies and means it is cheaper, easier to build and
88 offers more functionallity.
89
90 Note however that this means also that the short circuit
91 protection is implemented in software. Be careful when
92 you change something in the software. If the microcontroller 
93 is not running properly due to a software fault then there
94 might not be any short circuit protection.
95
96 The software is prepared for 2 versions:
97 - 0-22V 0-2.5A
98 - 0-30V 0-2A
99
100 If you want to build a version that has a smaller output
101 range than any of the two version then you can just
102 modify the file hardware_settings.h.
103
104 Remote control from your PC
105 ===========================
106 The unit can be controlled remotely from a computer using
107 a USB serial interface. An add-on card is available from
108 http://shop.tuxgraphics.org which offers galvanic separation
109 such that you can use this power supply relative to
110 any reference point (e.g build two power supplies and use
111 one as negative and one as positive power supply).
112
113 Terminal settings for remote control via your computer
114 ======================================================
115 You can e.g use putty under windows
116 http://www.chiark.greenend.org.uk/~sgtatham/putty/ 
117 Putty supports as serial connections. The other common
118 option under windows is HyperTerminal but it is more complicated
119 to use than putty.
120 For Linux I can recommend picocom
121 http://code.google.com/p/picocom/
122 (use command picocom -l -b 9600 /dev/ttyUSB0)
123 Another good serial terminal for linux is gtkterm
124 http://www.jls-info.com/julien/linux/
125
126 Serial port settings for the terminal:
127
128 port       : Virtual com port (e.g /dev/ttyUSB1 or /dev/ttyUSB0
129              or COM5 under windows or ... whatever port the
130              virtual com-port maps to)
131              Under linux or Mac you can use the command dmesg
132              after you have plugged in the USB cable to see to 
133              which com-port/device the new virtual com port maps to.
134              Under windows you look at Control Panel-&gt;Hardware-&gt;Devices
135              and click on FT232R USB UART-&gt;Hardware to see the COM
136              port.
137              
138 baudrate   : 9600
139 parity     : none
140 flowcontrol: none
141 stopbits   : 1
142 databits   : 8
143
144 </pre>
145 <br>
146 <img src=screenshot-cmd-interface.gif>
147 <br>
148 <br>
149 <pre>
150 Controling the power supply with scriptable commands
151 ====================================================
152 You can control the digital power supply by commands. A number 
153 of commands are provided for this purpose. They are at the moment
154 available for Linux, Mac and Windows:
155
156
157 ddcp-script-ttyinit   - initialize the COM port (run this once at
158                         at the beginning)
159 ddcp-script-getval    - get current values (same as you see on the LCD)
160 ddcp-script-setval    - send a command to the power supply
161
162 ddcp-script-example.sh  - an example unix shell script showing how to use 
163                           the above commands
164
165 To compile the ddcp-script commands under linux and on the mac
166 use the command:
167
168 make ddcp-script
169
170 The windows versions of those commands are available in the
171 sub-directory "ddcp-script-windows". The windows versions
172 are compiled in that sub-directory with the command:
173
174 make
175
176 Pre-compiled binaries are available for winXP.
177
178 -------------------------------------------------------------------
179 Software License:
180 Copyright: GPL V2 (see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html )
181 Author: Guido Socher (guidosocher@gmail.com)
182 Homepage: http://www.tuxgraphics.org/electronics/
183 -------------------------------------------------------------------
184 Change history:
185 digitaldcpower-0.6.0 -- 2010-05-22 first version of the new power V3.
186                          This version is made for a new type of hardware
187                          and will not run on any previous hardware version.
188
189 digitaldcpower-0.6.1 -- 2010-06-06 Number conversion to display string
190                          improved.
191                          Basic uart interface prompt, no remote control yet
192
193 digitaldcpower-0.6.2 -- 2010-06-26 Full UART command interface
194
195 digitaldcpower-0.6.3 -- 2010-07-03 Accelerate UART command polling to
196                          not loose characters when copied/pasted at high speed.
197                          Line editing with backspace if terminal supports it.
198                          Set BOD (brown out detector enable) fuse.
199                          Script interface (ddcp-script)
200 digitaldcpower-0.6.4 -- 2010-07-11 added ddcp-script interface 
201                          commands for windows.
202 digitaldcpower-0.6.5 -- 2012-04-14 There was a fault in the range setting
203                          for the PWM (ICR1L in dac.c). Thanks to Weitao Li (james)
204                          for reporting this. This fault reduced the precision
205                          a bit.
206                      -- 2012-04-14 some minor improvemnents in main.c and analog.c to 
207                         regulate the voltage drop over the current measuremtns shunts 
208                         faster.
209
210 digitaldcpower-0.6.6 -- 2012-07-17 Adapt the code to compile clean with the latest
211                         avr-libc (http://www.nongnu.org/avr-libc/changes-1.8.html)
212                         prog_char is now depricated.
213 -------------------------------------------------------------------
214  vim: set sw=8 ts=8 si et :
215 </pre>