00e99733435ffbb5ece2f76ba8774b82de646429
[digitaldcpower] / README.htm
1 <h2>Tuxgraphics Digital DC Power Supply Unit</h2>
2 <pre>
3
4 Compile the software and program the microcontroller:
5
6 1) edit and adapt the file hardware_settings.h 
7    (calibration and selection of the right hardware type).
8
9 2) load and compile:
10 make 
11 make load
12
13 3) set the fuse bytes to 8MHz internal with BOD:
14 make fuse
15
16 This should result in the following settings:
17
18 avrdude: Device signature = 0x1e9307
19 avrdude: safemode: lfuse reads as A4
20 avrdude: safemode: hfuse reads as D9
21
22 Fuse Low Byte details
23
24 BODLEVEL  Brown out detector trigger level = 1
25 BODEN     Brown out detector, 0=enable     = 0
26 SUT1      Select start-up time             = 1
27 SUT0      Select start-up time             = 0
28 CKSEL3    Select Clock source              = 0
29 CKSEL2    Select Clock source              = 1
30 CKSEL1    Select Clock source              = 0
31 CKSEL0    Select Clock source              = 0
32
33 The make fuse needs to be done only once
34 unless you change the Atmega8 chip. make/make load
35 need to be repeated everytime you change something
36 in the software (e.g update of hardware_settings.h). 
37
38 The poweresupply must be powered up during programming
39 but nothing should be connected to the output. Make
40 sure that you do not accidently press any button
41 during the programming (loading the software into the uC).
42
43 Compile under windows
44 =====================
45 Please use the provided Makefile.
46
47 There are as well 3 batch files which you can use
48 to run the makefile. To use them edit them and change
49 the path as per your avr-gcc installation on your PC.
50 After that run them by double-clickin in the file manager
51 on those batch files.
52
53  winmake.bat  -- comile, this is mandatory to use
54
55  winload.bat  -- load software using avrdude, may also use
56                  some other means of loading the softare. In that
57                  case you do not need to use this batch file.
58
59  winsetfuse.bat -- set fuse bytes using avrdude, may also use
60                    some other means of loading the softare. In that
61                    case you do not need to use this batch file.
62
63 Calibration
64 ===========
65 To calibrate the display edit the file hardware_settings.h
66 Here you can change also the settings between the 30V and the 22V version.
67
68 In general you should only need to change 
69 U_DIVIDER and I_RESISTOR by very small amounts. 
70
71
72 Overview
73 ========
74 This is the software for the tuxgraphics.org electronic digital DC power supply. 
75 A microncontroller controlled bench DC power supply unit. 
76
77 All of the control logic is implemented in software. This
78 saves a lot of parts compared to conventional lab-power 
79 supplies. This means it is cheaper, easier to build and
80 offers more functionallity.
81
82 Note however that this means also that the short circuit
83 protection is implemented in software. So be careful when
84 you change something in the software. If the microcontroller 
85 is not running properly due to a software fault then there
86 might not be any short circuit protection.
87
88
89 The software is prepared for 2 versions:
90 - 0-22V 0-2.5A
91 - 0-30V 0-2A
92
93 If you want to build a version that has a smaller output
94 range than any of the two version then you can just
95 modify the file hardware_settings.h.
96
97 The unit can be controlled remotely from a computer using
98 a USB serial interface. An add-on card is available from
99 http://shop.tuxgraphics.org which offers galvanic separation
100 such that you can use this power supply relative to
101 any reference point (e.g build two power supply and use
102 one as negative and one as positive power supply).
103
104 Terminal settings for remote control via your computer
105 ======================================================
106 You can e.g use putty under windows
107 http://www.chiark.greenend.org.uk/~sgtatham/putty/ 
108 it supports as well serial connections. The other common
109 option under windows is HyperTerminal but it is more complicated
110 to use than putty.
111 For Linux I can recommend picocom
112 http://code.google.com/p/picocom/
113 (use command picocom -l -b 9600 /dev/ttyUSB0)
114 Another good serial terminal for linux is gtkterm
115 http://www.jls-info.com/julien/linux/
116
117 Serial port settings for the terminal:
118
119 port       : Virtual com port (e.g /dev/ttyUSB1 or /dev/ttyUSB0
120              or COM5 under windows or ... whatever port the
121              virtual com-port maps to)
122              Under linux or Mac you can use the command dmesg
123              after you have plugged in the USB cable to see to 
124              which com-port/device the new virtual com port maps to.
125              
126 baudrate   : 9600
127 parity     : none
128 flowcontrol: none
129 stopbits   : 1
130 databits   : 8
131
132 </pre>
133 <br>
134 <img src=screenshot-cmd-interface.gif>
135 <br>
136 <br>
137 At shop.tuxgraphics.org you can get an optically insulated
138 USB to serial interface add-on kit such that your computer
139 is galvanically separated from the power supply but still able
140 to give commands. This enables you as well to use two power supplies
141 to provide positive and negative supply voltages for e.g. an operational amplifier.
142
143 <br>
144 <br>
145 <pre>
146 You can control the digital power supply by commands. A number 
147 of commands are provided for this purpose. They are at the moment
148 available for Linux and Mac:
149
150
151 ddcp-script-ttyinit   - initialize the COM port
152 ddcp-script-getval    - get current values (same as you see on the LCD)
153 ddcp-script-setval    - send a command to the power supply
154
155 ddcp-script-example.sh  - an example shell script showing how to use 
156                           the above commands
157
158 -------------------------------------------------------------------
159 Copyright: GPL V2
160 Author: Guido Socher
161 Homepage: http://www.tuxgraphics.org/electronics/
162 -------------------------------------------------------------------
163 Change history:
164 digitaldcpower-0.6.0 -- 2010-05-22 first version of the new power V3.
165                         This version is made for a new type of hardware
166                         and will not run on any previous hardware version.
167
168 digitaldcpower-0.6.1 -- 2010-06-06 Number conversion to display string
169                         improved.
170                      -- Basic uart interface prompt, no remote control yet
171
172 digitaldcpower-0.6.2 -- 2010-06-26 Full UART command interface
173 digitaldcpower-0.6.3 -- 2010-07-03 Accelerate UART command polling to
174                         not loose characters when copied/pasted at high speed.
175                         Line editing with backspace if terminal supports it.
176                         Set BOD (brown out detector enable) fuse.
177                         Script interface (ddcp-script)
178                         
179 -------------------------------------------------------------------
180 </pre>