xemul 0 1 февраля, 2013 Опубликовано 1 февраля, 2013 · Жалоба But with changes in post №4 current measurements is wrong, instead x,xxxA is xA. Only one position. Calculations are right, measurements - may be. You see output exactly with format in line 229: printf(write_car_lcd,"%01ldA ",amp_lue*disp_ma); I don't know why author put an incorrect source in distributed archive. Edit line 229: printf(write_car_lcd,"%01ld,%03ldA ", amp_lue/disp_a, amp_lue*disp_ma); Цитата Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты Поделиться
maharadga 0 2 февраля, 2013 Опубликовано 2 февраля, 2013 (изменено) · Жалоба Hi, xemul. I replace line 229, as you say. Now current show x,xxxA. Yes! I replace also current line, as you say in post №4. Voltage line from same post back to old position, because U measurement is wrong. I have small problem. If no load current shows 0,000A. It's perfect. But in short circuit shows with as many as before showed no load output - from 0,001 to 0,008A . For example current max=0,200A. If current exceed this limit ( short circuit ) display shows: 0,201A for scope 1A, 0,202 for 2A scope ........and 0,208A for scope 8A. Process measurement of current bellow limit is o'key. Изменено 3 февраля, 2013 пользователем maharadga Цитата Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты Поделиться
xemul 0 4 февраля, 2013 Опубликовано 4 февраля, 2013 · Жалоба Hi, xemul. I replace line 229, as you say. Now current show x,xxxA. Yes! Are you sure 3 digits after comma has any meaning? Did you use a 0.05% or better precision elements in measurement circuits? Did you make any adjustments with approved for this precision devices? No? So you see just a digits, but not a real voltage and current values. Voltage line from same post back to old position, because U measurement is wrong. Totally wrong? Coool... As I say early, calculations in post №4 are correct in common case, but may require some adjustments in circuit or program. "volt_lue=volt_lue+2;" and "amp_lue=amp_lue+1;" in original program are author's adjustments for _his_ device, but not commonly suited and seems not suited for your ones. You would play with "amp_lue = (amp_lue + amp_lue/32) / 16 +- something;" and "volt_lue = (volt_lue + volt_lue/32) / 16 +- another_something;". I have small problem. If no load current shows 0,000A. It's perfect. But in short circuit shows with as many as before showed no load output - from 0,001 to 0,008A . For example current max=0,200A. If current exceed this limit ( short circuit ) display shows: 0,201A for scope 1A, 0,202 for 2A scope ........and 0,208A for scope 8A. It may be a current leakage of power transistors. Try short B and E pins Q1, if current measuring with shorten load leaves not zero, that is. You can also use an ordinal amperemeter to check this. Correct formats for settings and measurings outputs are 80.5: signed int16 tmp = 2*volt_set + volt_set/2; // add this before line 81 81: printf(write_car_lcd,"%01d,%03dA SET %02d,%01dV", amp_set/disp_a, (amp_set%disp_a)*disp_ma, tmp/1000, tmp%1000); 212.5: signed int16 tmp = 2*volt_lue + volt_lue/2; // add this before line 213 213: printf(write_car_lcd, "%02d,%01dV", tmp/1000, tmp%1000); 229: printf(write_car_lcd,"%01d,%03dA ", amp_lue/disp_a, (amp_lue%disp_a)*disp_ma); No needs in "ld" (long decimal) formats, "d" is enough. "signed" not needed too, but I write it by author's way. All lines numbered as in original program. May be you'll start study C and will rewrite this program at all? Цитата Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты Поделиться
maharadga 0 10 февраля, 2013 Опубликовано 10 февраля, 2013 · Жалоба Thanks, xemul. I triyed change this but can't compile file. Like I say in last posts, I'm not expert. :) I found expert that change everything. Now all is o'key. Thank you for help and given time. Цитата Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты Поделиться