You are on page 1of 27

T.

C DOKUZ EYLUL UNIVERSITY FACULTY OF ENGINEERING ELECTRICAL & ELECTRONIC ENGINEERING DEPARTMENT

Voltage and Current Measurement of Mobile Robot

FINAL REPORT

by
zgr Mehmet DUMAN

Advisor
Asst. Prof. Dr. AHMET ZKURT

04.05.2011 IZMIR

ABSTRACT
Mobile vehicle batterys instantaneous current and voltage information are transmitted to charge station by RF modules which are loaded on vehicle and station. Mobile vehicle is designed as three wheels, two of them are front and movement is proved by two bipolar stepping motors which are connected to front wheels. Hall effect current sensor and voltage divider circuits gives battery information of vehicle to microcontroller. Charge station contains cascaded ac to dc converter and step down converter which are controlled by microcontroller (mcu). In RF receiver module provides to take vehicle data on same station.

TABLE OF CONTENTS
Table of Contents 2 3 4 4

1. INRODUCTION 2. METHODOLOGY
2.1 Current and Voltage Measurement 2.2 Stepping Motors and Drivers 2.3 RF Communication 2.4 Lithium Polymer Charger Design

5 7 8
9 10 11 12 13
13

3. FLOW CHART CHARGE STATION 4. FLOW CHART MOBILE VEHICLE 5. BLOCK DIAGRAM MOBILE VEHICLE 6. BLOCK DIAGRAM CHARGE STATION 7. EXPERIMENTS
7.1 Current and Voltage Measurement 7.2 Stepping Motors and Drivers 7.3 RF Communication and RS232 Communication 7.4 Charger Circuit

13 14
14

8. CONCLUSION 9. REFERENCES 10. ABSTRACT


10.1 Codes

15 15

INTRODUCTION
Mobile robots are one of the most popular research topic and all industrial applications are include mobile robots for professional and quick works. Robots are located at the heart of world of future. Nowadays, movement of mobile robots is satisfied by different type motors such as DC motors which are supplied by DC voltage. Mobile robot technology develops in parallel with battery technology. This relation is provided by suitable measurements systems. Current measuring applications are realized a few different methods. Shunt resistances serial connection and hall effect current metering are two of them. Many science projects

succession is related with efficient energy measuring and data transferring. For example Nasas mobile robots on The Moon, satellites and rockets projects have efficient energy measuring and transferring systems. In this project a mobile robot is created and its battery current and voltage measuring is realized and also these data transmitted to standalone charge station.

METHODOLOGY Current and Voltage Measuring


In this project current values of mobile vehicle and charger are measured by hall effect sensors of Allegro firm. Hall effect sensors work by magnetic induction on material due to the flowing current. Flux increases due to the increasing current value; hence voltage is appeared at the output of current sensor.

Figure1: One hall effect sensor application [1]

Low costs and small packages of these sensors are attractiveness properties. In addition, only 5 volt is enough to supply the sensor, so creating different hardware to provide supply voltages isnt necessary. Acs712 hall effect current sensor is loaded on mobile vehicle, resolution is changed between 66mV/A and 185mV/A.

Figure2: Acs712 hall effect sensor and application circuit.[2]

16F877 MCU has bit ADC device so its resolution 4.887mV/Bit so at minimum resolution of sensor 0.07 A current changing increases one bit LSB of ADC. In addition the charger circuit is designed with Acs712.Voltages measuring of circuits are provided with voltage divider circuits whose ratios are 1/3.

Figure3: Voltage divider

Stepping Motors and Drivers


In this project mobile vehicle is created three wheels. Two front ones are moved with stepping motors. Back one is drunken wheel. STEPPING MOTORS Stepping motors are a type of brushless Dc motors in figure 4. Their differences with other brushless Dc motors are controllable rotor rounding angle of motor in figure 5 and ability of open loop position controlling in figure 6. Torque and speed performance are changeable due to motor company products. Stepping motors are able to find desired torque, speed and step angles. Small or big devices have stepping motors; Toys, Cd drivers, bandagers, robotic hands and future biomedical surgeons.

Figure4: Stepping Motors.[3]

Figure 5 : Principle of operation of 308 per step variable reluctance stepping motor.[3]

Figure 6: Open-loop position control using a stepping motor.[3]

STEPPING MOTOR DRIVERS In this project constant voltage drive is used. This drive method is the simplest one. The dc voltage V is chosen so that when the transistor is on, the steady current is the rated current as specified by the motor manufacturer. The current waveforms at low and high stepping rates are shown in figure4. This method is realized with L293D push-pull four channel driver with diodes.

Figure 7:Stepping motors driving with 16f628 mcu and l293d motor driver

Figure 8: Current waveform for different stepping rates[3]

In project two stepping motors have different each other one of them is supplied 5V, the other one is 7V.So two voltage regulating systems were created with Lm317 ICs.

RF Communication
In project mobile vehicle current and voltage values are transmitted to receiver of charge station. ARX-34S and ATX-34S are receiver and transmitter modules whose communication frequency 433.920 MHz at UHF band. Maximum binary data communication rate is 2400kps.

Figure9: Rf transmitter and receiver modules

Key features of transmission are data synchronization and data formats.

TX : preamble + sencron + data1+.....+dataX

Transmitter

DI(digital input)

RF

Receiver RF DO(digital output)


Figure10: Sencron rf commucination timing diagram [4]

Li iu

ly

rC

r r

Power suppl of mobile vehi le is chose lithium pol mer battery. Because of li polymer batteries are superior than the other types because of features, li ht wei ht and small package, high energy density, low self discharge, low maintenance. In this project receiver device is designed as li polymer charger. Grid electric energy is adjusted to charger supply with buck converter circuit.

Figure11:Buck Converter schematic

Figure12: Lithium Charge Characteristic[5]

FLOW CHART CHARGE STATION


Start

Initialization &Description Adjustments of Setups Main Function

While(true)

Interrupts Receive Data Start charge Voltage Read Voltage <12V


true false

Show LCD Screen

Constant Current Charging

Start Timer

Constant Voltage Charging

Time>3hr

Break

10

FLOW CHART MOBILE VEHICLE

Start Initialization &Description

Start Initialization &Description

Adjustments of Setups Main Function

Adjustments of Setups Main Function

false

false

While(true)

While(true)

Motor Drive

Current Measuring

Transmitting

Voltage Measuring

Transmitting

11

BL C

M M B LE E

CLE

12

BL C

DIAGRAM C ARGE STATION

13

EXPERIMENTS Current and Voltage Measuring


In this project, 2 lead acid batteries were connected serially for supplying mobile robots. These batteries cause weight increasing of mobile robot as 180g, Thats why step motors use high current to lift batteries. But stepping motors havent got enough torque for moving all of mobile robot so lithium polymer batteries were selected instead of lead acids but current measuring with shunt resistance and voltage measurement with voltage divider were realized with lead acid supplied experiences.

Photo1: Current measuring with shunt resistance and voltage measurement with voltage divider.

Second week of project my current (Acs12) sensors were shipped so I developed measuring system due to new sensors.

Step Motor Driving


In project two different stepping motor are used to move the mobile robot. L293D, 4 channel dc motor driver, whose channels capability of current supply are 600mA, was used to drive bipolar stepping motor. All channels were activated by 16f628 Mcu.

Photo 2-3 stepping motor drive

14

RF Communication and Rs232 Connections


Two different type Rf communication modules were bought. They werent udea firms models but they were worked like them. Voltage and current data were read as integer but in

transmission process, all numbers and letters were converted characters then every character was sent as bit by bit. To prevent current and voltage data mixing V and A letters were sent after suitable data. Every circuit has computer rs232 connection.

Photo 4-5 Rf data transfer and rs232 data transfer

Charger Circuit
Lead acid charger were designed in Embedded module project but constant current couldnt be obtained. In this project buck type dc to dc converter is applied to realize last object. Current and voltage values are realized due to charge curve of lithium polymer battery in charging process. Constant current supplying is tried by changing duty of PWM signal which is created by 16f877 mcu.

Photo7:Lipo charging

15

CONCLUSION
In this project, current and voltage measuring of any mobile vehicle then realizing communication between the vehicle and standalone system are purposed. In addition own effort, I tried to add lithium polymer charger circuit to standalone system. Shunt resistance was too small output voltage thats why lm324 opamp necessity broke the measurements. Also shunt connection to system creates all systems ground connection differences due to battery when the shunt resistance is connected to battery anode. So Acs712 hall effect sensors output provide more effective current measurement. Output voltage of sensor increases from Vcc/2 voltage with 133mV/A resolution. Stepping motors, which are used by different supply voltage, has same 7.5 degree steps angle. So speeds are same for same stepping stimulus from 16f628 mcu. But isolation must be use because when stimulus from L293d motors try to use supply of mcu so measured current isnt related with battery supplied current, therefore lm7805, 5V regulator heats after this attempt. Also two mcu are used on vehicle because of effective motor speed control. After experiments these motors couldnt suitable this vehicle because two low torque couldnt provide the movement. But vehicle shape was created according to these motors. Steps cause current changes, current measurements changed too. RF communication security is planned by different algorithm.V and A letters would be key of protections. These letters would be controlled then values are showed but cu rrent data couldnt be storage so this application couldnt be resulted.

REFERENCES
1.Datasheet of UGN3503 Linear Hall Effect Sensor of Allegro 2. Datasheet of ACS712 Hall Effect Based Linear Current Sensor of Allegro 3. HUGHES, A., Electric Motors and Drives Fundamentals,Types and Applications, pp. 307320,3rd Edition, Elsevier Inc., Burlington, Greate Britain, 12006 4. Datasheet of ATX34S RF module of Udea Firm 5. BUCHMANN, I., Batteries in a Portable World, pp. 44-95, 2nd Edition, Cadex Electronics Inc., CANADA, 2000

16

APPENDIX Codes: //////////////////////////RECEIVER//////////////////////////// #include <16f877.h>

#define Dout pin_c3

#fuses XT,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOWRT,NODEBUG,NOC PD

#use dela (clock=4000000)

#use rs232 (baud=2400, xmit=pin_C6, rcv=pin_C7, parit =N, stop=1)

#use fast_io (b) #use fast_io (c) #include <lcd.c>

long int plus0=0,plus1=0; int sa =0,satir=1,dut =1,a=1; unsigned long int bilgi; float deger1,deger2; unsigned char data=0x00;

#int_ext void ext_charge() {while(1) {{//output_high(pin_c0);

17

dela _ms(100); set_adc_channel(1); dela _us(50); bilgi=read_adc(); deger1=((bilgi*0.004828812)*3); set_adc_channel(0); dela _us(50); bilgi=read_adc(); deger2=((bilgi*0.004828812)-2.46)*1000/80; lcd_gotox (1,1); printf( lcd_putc, "Vol(V)Cur(A)" ); dela _ms(10); lcd_gotox (1,2); printf( lcd_putc,"V=%fVI=%fA",deger1,deger2); dela _ms(10);

if ((deger1<12) && (deger2<0.01)) {dut =dut +1; set_pwm1_dut (dut ); } if (deger1>=12) dut =dut -1; set_pwm1_dut (dut ); //output_low(pin_c0); dela _ms(100); }

} 18

void fivebit0(); // senkron 5 bit 0x00 okuyan alt program void fivebit1(); // senkron 5 bit 0xff i okuyan alt program void data_oku();

void main() { set_tris_b(0xFF); set_tris_c(0xFF);////////////// set_tris_a(0x0f); //set_tris_c(0x00);/////////////////////// setup_ccp1(CCP_PWM); setup_timer_2(T2_DIV_BY_1,99,1); // Timer2 ayarlar yap l yor set_pwm1_duty(duty); // PWM1 k setup_adc(adc_clock_div_32); setup_adc_ports(ALL_ANALOG); lcd_init(); enable_interrupts(INT_EXT); enable_interrupts(GLOBAL); grev sayk l belirleniyor

while (1)

{ fivebit0(); } }

void fivebit0 () { for(;;) { 19

if(input(Dout)==0) { for(;;) { delay_us(10); plus0++; if(plus0>=600) { while(input(Dout)==0); fivebit1(); return; } if(input(Dout)==1) break; } plus0=0; } } }

void fivebit1() { for(;;) { if(input(Dout)==1) { for(;;) {

20

delay_us(10); plus1++; if(plus1>=600) { while(input(Dout)==1); data_oku(); return; } if(input(Dout)==0) { plus0=0; plus1=0; return; } } } } }

void data_oku () { while(say<=7) { if(input(Dout)==1) bit_set(data,0); else bit_clear(data,0); if(say==7) break; 21

say++; data=data<<1; delay_us(230); delay_us(210); } lcd_gotoxy(1,1); printf( lcd_putc, "Cur(A) Vol(V) " );

lcd_gotoxy(satir,2); printf( lcd_putc,"%c",data); delay_ms(10); satir++; if (satir>14) {satir=1; printf(lcd_putc,"\f"); } printf("%c",data); plus0=0; plus1=0; say=0; return; } //////////////////////////////////TRANSMITTER//////////////////// #include <16f877.h>

#device ADC=10

#fuses XT,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOWRT,NODEBUG,NOC PD

22

#use delay (clock=4000000)

#use fast_io(a) #use fast_io(b) #use fast_io(d) #use fast_io(c) #define DI pin_d0

float bilgi; int count=0,i; unsigned char a,data[6]; unsigned char data_set=0x00; unsigned char mask=0x80;

void p_width() { delay_us(200); delay_us(186); }

void send(data1) {output_high(pin_c0); while (count<=7) { data_set=data1&mask; if (data_set==0x80) { output_high(DI); 23

} else { output_low(DI); } p_width(); if (count==7) { count++; break; } data1 = data1 << 1; count++; } count=0; output_low(pin_c0); return; }

void sync() {

send(0x55); send(0x55); send(0x55); send(0x55); send(0x55);

send(0x00); 24

send(0x00); send(0x00); send(0x00); send(0x00);

send(0xFF); send(0xFF); send(0xFF); send(0xFF); send(0xFF);

output_low(DI);

output_high(DI);

p_width();

void main () { setup_psp (PSP_DISABLED); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1); setup_CCP1(CCP_OFF); setup_CCP2(CCP_OFF);

set_tris_a(0x0F); 25

set_tris_b(0x00); set_tris_d(0x00); set_tris_c(0x00); output_b(0x00);

setup_adc(adc_clock_div_32); setup_adc_ports(ALL_ANALOG);

while (1) { set_adc_channel(0); delay_us(50); bilgi=read_adc();

bilgi=((bilgi*0.004828812)-2.46)*1000/80; sprintf(data,"%.3g",bilgi);

for(i=0;i<5;i++) { a=data[i]; sync(); send(a); }

sync(); send(0x41);

sync(); send(0x0D);

26

set_adc_channel(1); delay_us(50); bilgi=read_adc();

bilgi=bilgi*0.004828812*3; sprintf(data,"%.3g",bilgi);

for(i=0;i<5;i++) { a=data[i]; sync(); send(a); }

sync(); send(0x56);

sync(); send(0x0D);

27

You might also like