ekit - tool for learning signals, circuits and electronic...

6
EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS AND ELECTRONIC SYSTEMS Nuno Lucas, Jos´ e Gaspar, Jo˜ ao Sequeira Instituto de Sistemas e Rob ´ otica, Instituto Superior T´ ecnico, Universidade T´ ecnica de Lisboa, Portugal [email protected], {jag,jseq}@isr.ist.utl.pt Keywords: Microcontroller based interfaces, Analog to digital conversion, e-Learning. Abstract: The increase of student mobility in Europe and in other countries, and the recent attempt to harmonise Eu- ropean curricula at the graduation and post-graduation levels lead towards an increasing co-operation among universities to develop educational modules with a common background [5] . With Bolonha coming into ef- fect in most universities the self-learning processes lead to the abolition of many experimental classes in the electronic graduations courses. This paper describes a project to help and promote the self-learning skills on signals, circuits and electronic systems. Experiments of measuring resistors, capacitors and DC motor pa- rameters, show that an inexpensive USB/microcontroller device constitutes an effective minimal equipment setup. 1 INTRODUCTION The self-learning processes imposed by the Bolonha process [2] left aside an important compo- nent of the basis of electronics engineering, namely the interaction in laboratory with the most basic phys- ical devices. Since the signal acquisition and analysis usually requires expensive hardware such as oscillo- scopes, signals generators, data acquisition devices. It seems that in fact the self-learning will be contradict- ing the experimental learning. While the conventional laboratory teaching of cir- cuits tends to decrease its prevalence, in fact the self- learning of electronics is actually growing, mostly as- sociated to hobbies as remotely commanding model cars or planes, or by participating in robotics compe- titions [1]. Some of these learning dynamics can for sure be helpful for the transition process of the teach- ing and learning for circuit analysis, associated to the Bolonha process. The main purpose of this paper is therefore to dis- cuss a framework for teaching and learning circuit theory and analysis, termed the EKit project, and to show that despite the decreasing of the time of pres- ence learning in the Bolonha paradigm, a simple hard- ware device still allows realizing a comprehensive va- riety of the experiments that were standard in pre- Bolonha circuit analysis courses. The device is based on a reconfigurable microcontroller (PIC), combined with a USB interface to allow importing data directly to a ordinary desktop or laptop. The structure of the paper is the following. Sec- tion 2 presents a general teaching and learning frame- work on which the USB/microcontroller device plays a major role. Section 3 details examples of experi- ments on electronics that can be done with the device. Section 4 draws some conclusions. 2 LEARNING AND TEACHING FRAMEWORK The EKit project aims to provide students enrolled in Electric, Electronics and Computer (EEC) engi- neering courses, the necessary tools for autonomously conducting experiments similar to the ones carried out in first courses of circuit analysis. These tools are ex- pected to be lent by the universities or in cases of per- sonal interest, e.g. hobby applications, acquired by the students. Commonly, first year EEC students have too lit-

Upload: others

Post on 19-Mar-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS AND ELECTRONIC SYSTEMSwelcome.isr.tecnico.ulisboa.pt/wp-content/uploads/2015/... · 2015-07-02 · EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS

EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS ANDELECTRONIC SYSTEMS

Nuno Lucas, Jose Gaspar, Joao SequeiraInstituto de Sistemas e Robotica, Instituto Superior Tecnico,

Universidade Tecnica de Lisboa, [email protected],{jag,jseq}@isr.ist.utl.pt

Keywords: Microcontroller based interfaces, Analog to digital conversion, e-Learning.

Abstract: The increase of student mobility in Europe and in other countries, and the recent attempt to harmonise Eu-ropean curricula at the graduation and post-graduation levels lead towards an increasing co-operation amonguniversities to develop educational modules with a common background [5] . With Bolonha coming into ef-fect in most universities the self-learning processes lead to the abolition of many experimental classes in theelectronic graduations courses. This paper describes a project to helpand promote the self-learning skills onsignals, circuits and electronic systems. Experiments of measuring resistors, capacitors and DC motor pa-rameters, show that an inexpensive USB/microcontroller device constitutes an effective minimal equipmentsetup.

1 INTRODUCTION

The self-learning processes imposed by theBolonha process [2] left aside an important compo-nent of the basis of electronics engineering, namelythe interaction in laboratory with the most basic phys-ical devices. Since the signal acquisition and analysisusually requires expensive hardware such as oscillo-scopes, signals generators, data acquisition devices. Itseems that in fact the self-learning will be contradict-ing the experimental learning.

While the conventional laboratory teaching of cir-cuits tends to decrease its prevalence, in fact the self-learning of electronics is actually growing, mostly as-sociated to hobbies as remotely commanding modelcars or planes, or by participating in robotics compe-titions [1]. Some of these learning dynamics can forsure be helpful for the transition process of the teach-ing and learning for circuit analysis, associated to theBolonha process.

The main purpose of this paper is therefore to dis-cuss a framework for teaching and learning circuittheory and analysis, termed the EKit project, and toshow that despite the decreasing of the time of pres-ence learning in the Bolonha paradigm, a simple hard-ware device still allows realizing a comprehensive va-

riety of the experiments that were standard in pre-Bolonha circuit analysis courses. The device is basedon a reconfigurable microcontroller (PIC), combinedwith a USB interface to allow importing data directlyto a ordinary desktop or laptop.

The structure of the paper is the following. Sec-tion 2 presents a general teaching and learning frame-work on which the USB/microcontroller device playsa major role. Section 3 details examples of experi-ments on electronics that can be done with the device.Section 4 draws some conclusions.

2 LEARNING AND TEACHINGFRAMEWORK

The EKit project aims to provide students enrolledin Electric, Electronics and Computer (EEC) engi-neering courses, the necessary tools for autonomouslyconducting experiments similar to the ones carried outin first courses of circuit analysis. These tools are ex-pected to be lent by the universities or in cases of per-sonal interest, e.g. hobby applications, acquired bythe students.

Commonly, first year EEC students have too lit-

jag
Typewritten Text
in Proc. of IV Jornadas de Engenharia Electrónica e Telecomunicações e de Computadores, pp35-40 November 2008, Lisbon, Portugal
Page 2: EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS AND ELECTRONIC SYSTEMSwelcome.isr.tecnico.ulisboa.pt/wp-content/uploads/2015/... · 2015-07-02 · EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS

tle acquaintance with electronic devices. The EKitproject has therefore to be user friendly in its variousfacets. Three very important of those facets are (i)having the required hardware capabilities, (ii) beingeasy to use, and (iii) being affordable. These threefacets seem at first hard to fulfill simultaneously. Forexample first courses on circuit analysis involve usingpower supplies, wave signal generators and oscillo-scopes, which is equipment usually not easy to use byinexperienced users and is definitely expensive.

However, there are two very important recenttrends that change completely the previous scenario.The first one is that almost all students have their ownpersonal computer (PC). The second was the intro-duction in the last decade of very inexpensive mi-crocontrollers, containing very good analog-to-digitaland digital-to-analog converters. Combining thesetwo through a USB connection, one can obtain an al-most complete solution: the microcontroller can gen-erate signals to simple circuits (e.g. a voltage divider),acquire the signals of interest and send them to thePC. Then, the PC makes the role of the oscilloscopei.e. displays the resulting signals. Considering thatthe PC is already owned by the student, all that has tobe bought is the microcontroller with the USB inter-face, which is certainly under the price of a text-book.

This is however an incomplete solution, not be-cause of lacking capabilities or the price, but becauseit is missing the easy of use aspect, for students andteachers. Analyzing in more detail the teaching pointof view, there are two additional important aspects toconsider: the logistics within the university and thedifferentiated interfacing with the students, Both as-pects should not consume additional resources of theuniversity. Simple logistics imply that the hardwaremust be easy to acquire, maybe from various brandsto be available from multiple vendors, easy to replacewith novel versions, and simultaneously always guar-anteeing that the work done at the university for thehardware is never lost. Interfacing to the students im-plies being able to assign specific works to the indi-vidual students and providing help. All these aspectscall for flexibility on the devices, or in other words,properly designed software solutions.

Flexible software solutions comprise: (i) a web-page with drivers, software and installation manuals,(ii) a public forum for general support and discussion,and (iii) e-learning tools for distributing and gradingassignments [6]. Designing a stable driver interfaceto the USB/microcontroller solves most of the issuesrelated with supporting multiple brands and upgrad-ing the hardware without losing the developed ap-plications. The discussion forum solves most of thesupport to the students without too many teaching re-

sources. The e-learning tools guarantee that the stu-dent is actually self-learning, as they make possibleto give differentiated assignments though individuallogins and to automatically grade them. In this pa-per we explore precisely the differentiation aspect, bylisting a variety of experiments that can be done witha USB/microcontroller device.

Considering conventional circuit analysis courses[4], the typical experiments range from resistive cir-cuits analysis, as voltage division and load effect, tillthe analysis of dynamic systems as Resistor-Capacitor(RC) circuits or DC motors, both involving transientresponses, time constants, DC gains, etc. In the fol-lowing section on experiments we want therefore toprove that a simple USB/microcontroller device caneffectively touch the concepts of most of the conven-tional experiments.

3 EXPERIMENTS

In these section we propose three experiments: (i)measuring resistors, using a simple voltage divider,(ii) measuring capacities based on the step responsefunction, and (iii) measuring the DC gain and timeconstant of a DC motor, using techniques similar tothe measurement of the capacities.

In our experiments we use mainly theUSB/microcontroller deviceDLP-2232PB-G man-ufactured by DLP [3]. It comprises one USB-FIFOinterface and one PIC Microchip 16F877A mi-crocontroller. It is a USB 1.1/2.0 compatible andsends/receives data over USB to a host computerat up to 2 megabits per second. It has 16 digitalI/O lines (5 can be configured as A/D inputs). TheMicrochip 16F877A has a processor with 8K FLASHROM, 368 bytes RAM, and a multi-channel, 10-bitA/D converter.

3.1 Measuring resistors

Considering a voltage divider of a supply voltage,Vsthrough a calibrated resistor,Ri and a resistor load tomeasure,R, one has an expression for the voltage atthe load,Vr = VsR/(R+Ri). Hence, if one knowsVs,Ri and measuresVr , then one can estimateR simplyas:

R= RiVr/(Vs−Vr)

Using the USB/microcontroller device, one caneasily obtain the necessary measurements. Figure 1shows the voltage divider circuit connected to suchdevice.

An experiment was conducted for measuring 1K,10K and 100K resistors, using one calibrated 1K re-

Page 3: EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS AND ELECTRONIC SYSTEMSwelcome.isr.tecnico.ulisboa.pt/wp-content/uploads/2015/... · 2015-07-02 · EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS

Figure 1: Resistor measuring circuit diagram (top) and im-age of the real setup (bottom).

sistor. The experiment was repeated 100 times foreach resistor and has shown standard deviations of0.37%, 1.09% and 7.95%, respectively. In otherwords, results show that the measurement noise of thedevice is small enough to allow using one calibrated1K resistor to measure other resistors up-to an orderof magnitude larger, within about 1% accuracy.

3.2 Measuring capacitors

A serial RC circuit is a typical way of measuring acapacity. For example one can actuate the RC circuitwith a step voltage source,vs and measure the voltageon the capacitor,vc(t). The voltagevc(t) allows cal-culating the time constant,τ of the RC circuit, and incase of knowing precisely theR, one obtains directlythe capacity,C.

Again using the USB/microcontroller device, onecan easily obtain these measurements. Figure 2 showsthe device connected to the RC circuit, actuatingthrough an output port, i.e. generatingvs and read-ing vc(t).

Figure 2: RC series setup to measure the capacityC.

There are several ways of measuring the capac-ity, C from the time response,vc(t) of a RC circuit

charged by a constant source. We will detail herethree ways of estimatingC, starting from: (i) the lo-cal increments of the capacitor’s voltage and the inte-gral of the current, (ii) as the previous case, but tak-ing longer time periods, and (iii) directly the time re-sponse.

In order to apply the first two methods, one needsto estimate the capacitor’s current,ic(t), which comesdirectly from the knowledge ofvs andRas:

ic(t) =vs−vc (t)

R(1)

The current flowing onto the capacitor is by defini-tion the rate at which charge is being stored,ic(t) =C · dvc(t)/dt. So the charge on the capacitor equalsthe integral of the current with respect to time, lead-ing toC =

R t1t0

ic(t)dt/(vc(t1)−vc(t0)) and thus we ar-rive to a local formula by converting the continuous todiscrete time:

C(k) ∼=Ts

2ic((k+1)Ts)+ ic(kTs)

vc((k+1)Ts)−vc(kTs)(2)

whereTs denotes the sampling time andk the samplenumber.

In method (ii) we consider a more dilated time in-terval, and thus we need to account for all the localincrements in the current:

C(k) ∼=Ts

2

k−1∑

n=0ic((k+1)Ts)+ ic(kTs)

vc(kTs)−vc(0). (3)

Method (iii) uses the knowledge of the time re-sponse function, i.e. the capacitor’s charging functionvc(t) = vs(1− e−t/τ) which can be solved explicitlyfor τ, and then forC sinceτ = R·C:

C(t) =−t

R· log(1−vc(t)/vs)(4)

wheret = kTs.Figure 3 shows the time response of the RC cir-

cuit to the input voltagevs = 5.12[V], and the esti-mates of a capacitor with nominal valueC = 1µF, us-ing each of the three methods. It is interesting to notethat despite having noisy local estimates of the currentflowing on the capacitor, which has a direct impacton the estimates ofC using method (i), one can ob-tain good results using method (ii) provided that onetakes enough integration time. The result of method(ii) is smooth along time, due to its integrating nature,and is interesting even when compared to method (iii),whereC cannot be estimated as soon asvc(t) gets tooclose tovs. This smoothness property of (ii) is conve-nient for example if one does not want to implementa detector ofvc(t) ∼= vs.

Page 4: EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS AND ELECTRONIC SYSTEMSwelcome.isr.tecnico.ulisboa.pt/wp-content/uploads/2015/... · 2015-07-02 · EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS

−0.2 0 0.2 0.4 0.6 0.8 1 1.2

0

1

2

3

4

5

6

Vc

[V]

0 0.5 1−1

0

1

2

3x 10

−6

C [F

]

0 0.5 1−1

0

1

2

3x 10

−6

0 0.5 1−1

0

1

2

3x 10

−6

Figure 3: Time response of the RC circuit and estimates ofthe capacity using methods (i), (ii) and (iii) (see text).

3.3 DC motor parameters

The experiment on a brush DC motor consists onmeasuring its parameters from its response to a stepinput. In this section we will be interested in find-ing the parameters of a didactic DC motor setup, builtby Quanser, for control courses. Figure 4 shows thepower driver and the motor.

Figure 4: Power driver (left), the motor and sensors (right).

The methods for parameters estimation will fol-low closely the ones used for the RC circuit, sincethey have in essence the same model. A DC motorwith the input voltage,vs and the output angular ve-locity, ω can be approximately described by a first or-der transfer functionG(s) = k0/(1+ τs), whereτ isthe time constant andk0 is the DC gain (note that inthe RC circuitk0 = 1). The response of the system tothe input step voltage is therefore given by:

ω(t) = vsk0

(

1−e−t/τ)

(5)

whereω(t) is the motor speed measured as a voltageby a tachometer. This response, Eq.5 can be used as amodel to estimate the motor parameters,k0 andτ.

After acquiring the motor speed (Fig. 5) the DCgain and time constant can be estimated by two meth-ods, inverting the step response and using a curve fit-ting algorithm.

Inverting the step response - Firstly we need to es-timate the DC gain. Given that the step response isa monotonic function, we can estimate the DC gainfrom the maximum value of the step response. In or-der to deal with noise, in practice we estimate the DCgain from the median of all the values in a five percentrange of the tachometer maximum voltage:

k0 = median{ω(t) : ω(t) ≥ 0.95max(ω(t))} (6)

The time constant is then calculated from Eq.5:

τ(t) =−t

log(1−ω(t)/(vsk0))(7)

In order to test the above procedure we ac-quired step responses of the DC motor, using ourUSB/microcontroller device to generate the referencesignals (to the power driver of the motor) and readthe velocity signals generated by the tachometer. Todemonstrate the potential of this microcontroller as adata acquisition device this experiment was made alsowith a National Instruments NI PCI-6221 signal ac-quisition board. Using both devices the data acquisi-tion was conducted 200 times for the same input stepvoltage with a sampling frequency of about 500Hz.See Fig.5(a,b).

The time constant was computed for the timesamples along the length of each experiment. Fig-ure 5(c,d) shows that the measurement noise led togood results only in the central time-samples. Noticethat the uncertainty grows ast → ∞, due to the DCmotor reaching the steady state. In the case of the PIC,the uncertainty is also large in the beginning which isdue to some clock inaccuracy on the PC motivated bythe operating system.

Hence, in order to estimate a singleτ value foreach experiment we selectedτ := τ(t), with t the timesample where the standard deviation of theτ(t) isa minimum considering the 200 experiments. Fig-ure 5(e,f) shows the estimates(k0,τ) for the 200 stepresponses. The uncertainty of the estimates is dueto some mechanical uncertainty (the load of DC mo-tor implies more friction in some angles) and to themeasurement noise. As expected the PIC yields somemore uncertainty due to its lesser precision of the ana-log to digital converters (10 bits, instead of the 12 bitsin the NI acquisition board). Nevertheless, it shouldbe pointed out that the difference between the two ac-quisition devices is less than 2% in both parameters,k0 andτ.

Page 5: EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS AND ELECTRONIC SYSTEMSwelcome.isr.tecnico.ulisboa.pt/wp-content/uploads/2015/... · 2015-07-02 · EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS

0 0.05 0.1 0.15 0.20

1

2

3

4

5PIC acquisition

time [sec]

w [v

]

0 0.05 0.1 0.15 0.20

1

2

3

4

5NI−daq acquisition

time [sec]

w [v

](a) (b)

0 0.05 0.1 0.15 0.20

20

40

60

80

Tau

vs

tim

e [m

sec]

0 0.05 0.1 0.15 0.20

20

40

60

80

(c) (d)

3.9 4 4.1 4.2

24

26

28

30

32

Tau

[mse

c] v

s k

0

3.9 4 4.1 4.2

24

26

28

30

32

(e) (f)

Figure 5: 200 step responses of the DC motor (a,b). PIC(left-column) and NI board (right-column). Time constant,τ [msec] estimated using Eq.7 (c,d). Time constant vs DCgainK0 (e,f). The red circle denotes the medianτ andk0 inthe 200 experiments.

Optimal curve fitting - The goal of this optimiza-tion is to find the time constant and the DC gain si-multaneously so that the theoretical model (Eq.5) fitsas well as possible the measurements. The cost func-tion used in our optimization algorithm is simply asquared distance:

(k0,τ)∗ = argk0,τ minN

∑i=1

(

ω(ti)−vsk0(1−e−ti/τ))2

(8)The non-linear optimization is done in our case withthe Matlab functionfminsearch that finds the mini-mum of a scalar function of several variables, startingat an initial estimate.

Figure 6 and table 1 show estimates ofτ andk0 us-ing both acquisition devices. The estimates are noisierthan the ones of the previous section due to the non-existence of a data selection mechanism for remov-ing samples not so precisely timed (timing done bythe PC) or noisier due to the analog to digital conver-sion process (remember thatτ in the previous sectionis estimated from the central, more precise measure-ments). The offset of about 1ms between theτ esti-mates obtained using both devices is justified mainly

by the timing imprecision at the PC. Note that theUSB has itself a timing schedule that imposes somesignificant timing discretization errors.

Overall, table 1 shows that the NI PCI-6221 al-lows to obtain slightly smaller variances in the esti-mates. However one important observation is that themeasurement of the DC motor parameters using thePIC is reliable enough for many applications and amuch cheaper solution.

3.9 4 4.1 4.2

24

26

28

30

32

Tau

[mse

c] v

s k

0

3.9 4 4.1 4.2

24

26

28

30

32

(a) (b)

Figure 6: Time constantτ vs DC gainK0 estimated usingthe optimization procedure Eq.8 based on the PIC (a) or onthe NI board (b) data. The red circle denotes the medianτandk0 in the 200 experiments.

device PIC NI PCI-6221k0 mean 4.033 4.010k0 std 0.0311 0.0241

τ mean [msec] 28.87 27.66τ std 0.6049 0.4301

Table 1:k0 andτ comparison estimated using both devices.

4 CONCLUSIONS

With the self-learning processes imposed byBolonha the development of cheap and accessibletools for EEC students autonomously learn and ex-periment circuit analysis is a priority. The Ekit wasdeveloped with the DLP-2232PB-G USB Adapter butwith generic SW programming it can be used withseveral USB data acquisition devices. The potential ofthese microcontrollers along with their low cost makethem a powerful and essential tool for EEC students.The experiments conducted in this paper provide firstyear students an experimental glance at electronic cir-cuits.

Future experiments like filter identification, Bodediagrams, systems control (digital displays or ser-vomechanisms), sinusoidal signal generators can beaccomplished with these devices allowing them to beuseful for a wider range of EEC classes. The Ekit im-plemented with the PIC is an excellent and above ofall cheap solution for signal and data acquisition. It

Page 6: EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS AND ELECTRONIC SYSTEMSwelcome.isr.tecnico.ulisboa.pt/wp-content/uploads/2015/... · 2015-07-02 · EKIT - TOOL FOR LEARNING SIGNALS, CIRCUITS

provides quick learning processes and incentives fu-ture applications as well as advanced signal process-ing and system control studies.

5 ACKNOWLEDGEMENTS

Research partly funded by the Portuguese FCTPrograma Operacional Sociedade de Informacao(POSI) in the frame of QCA III, the PortugueseFCT/ISR/IST plurianual funding through the POSConhecimento Program that includes FEDER fundsand the European Project EU-FP6-NEST-5010 -CONTACT.

REFERENCES

[1] Univ. Aveiro. Robotica2008 8th portuguese roboticsopen. http://robotica.ua.pt/robotica2008/index-en.htm, 2008.

[2] European Commision. The bologna processtowards the european higher education area.http://ec.europa.eu/education/policies/educ/bologna/bologna_en.html, 2007.

[3] Future Technology Devices International. Dlp de-sign - dlp-2232pb-g. http://www.ftdichip.com/Products/EvaluationKits/DIPModules.htm#DLP-2232PB-G, 2007.

[4] J. David Irwin. Basic Enginering Circuit Analysis.J.Wiley, 7th edition edition, 2002.

[5] P. Ruffio. Changing the university: The supporting roleof the erasmus thematic networks (a three-year perspec-tive). Technical report, European Union: Eucen, Brus-sels, Belgium, Jan. 2000.

[6] Moodle team. Moodle - a free, open source course man-agement system for online learning.http://moodle.org/, 2008.