We use cookies to give you the best experience possible. By continuing we’ll assume you’re on board with our cookie policy

See Pricing

What's Your Topic?

Hire a Professional Writer Now

The input space is limited by 250 symbols

What's Your Deadline?

Choose 3 Hours or More.
Back
2/4 steps

How Many Pages?

Back
3/4 steps

Sign Up and See Pricing

"You must agree to out terms of services and privacy policy"
Back
Get Offer

Remote control car

Hire a Professional Writer Now

The input space is limited by 250 symbols

Deadline:2 days left
"You must agree to out terms of services and privacy policy"
Write my paper

Abstract
Team Robot Cell Inc. developed a working model of a one-way control link between a user control device (joystick) and a dumb robot (RC car) using two cell phones. The joystick provides the user with proportional control over the speed and steering of the RC car from a remote location. Included in this report are detailed descriptions of the subsystems and integration of this model. The major subsystems described are the control signal generator (transmitter), the filtering system, the speed control circuitry, and the steering control circuitry.

The conception, implementation, and integration of the subsystems are explained. The resulting integrated performance of the subsystems and the system as a whole is documented as well.

Don't use plagiarized sources. Get Your Custom Essay on
Remote control car
Just from $13,9/Page
Get custom paper

2

Table of Contents
Abstract …………………………………………………………………………………………………………………………. 2 Table of Contents……………………………………………………………………………………………………………. 3 Table of Figures …………………………………………………………………..
…………………………………………. 4 Introduction……………………………………………………………………………………………………………………. 5 Objective ……………………………………………………………………………………………………………………. 5 Specifications……………………………………………………………………………………………………………… 6 Design ……………………………………………………………………………………………………………………….. 7 Transmitter (Richard)………………………………………………………………………………………………………. 9 Approach to solution……………………………………………………………………………………………………. 9 Establishing a Control Signal through the Cell Phones (Michael) ……………………………………. 11 Received Signal (Michael)……………………………………………………………………………………………… 13 Filtering of the Received Signal ………………………………………………………………………………….. 13 High-Pass Filter …………………………………………………………………………………………………….. 14 Low-Pass Filter ……………………………………………………………………………………………………… 16 Speed Control System (Raj)……………………………………………………………………………………………. 17 Comparator Circuit …………………………………………………………………………………………………….

18 Microcontroller Circuit ………………………………………………………………………………………………. 18 Control Circuit ………………………………………………………………………………………………………….. 22 H-Bridge and Rear Motor …………………………………………………………………………………………… 22 Steering Control System (Justin) …………………………………………………………………..
………………… 23 Reverse Engineering ………………………………………………………………………………………………….. 23 Solution:…………………………………………………………………………………………………………………… 24 PIC Program……………………………………………………………………………………………………………… 25 H-Bridge ………………………………………………………………………………………………………………….. 25 Power (Justin) ………………………………………………………………………………………………………………. 26 Results and Conclusions ………………………………………………………………………………………………… 27 References……………………………………………………………………………………………………………………. 28 APPENDIX A………………………………………………………………………………………………………………. 29 APPENDIX B ………………………………………………………………………………………………………………. 40 APPENDIX C ………………………………………………………………………………………………………………. 43 APPENDIX D………………………………………………………………………………………………………………. 47 APPENDIX E ………………………………………………………………………………………………………………. 60 APPENDIX F……………………………………………………………………………………………………………….. 62 APPENDIX G………………………………………………………………………………………………………………. 67 APPENDIX H………………………………………………………………………………………………………………. 82

3

Table of Figures
Figure 1 – Project Idea. ……………………………………………………………………………………………………. 5 Figure 2 – Block Diagram ………………………………………………………………………………………………… 8 Figure 3 – Control Signal to Phone Connection ………………………………………………………………… 11 Figure 4 – Speed Control Logic ………………………………………………………………………………………. 17 Table 1 – Frequency Vs Duty Cycle. ……………………………………………………………………………….. 20 Figure 5 – Duty Cycle Vs Frequency ……………………………………………………………………………….. 20 Figure 6 – Duty Cycle Vs Count ……………………………………………………………………………………… 21 Table 2 – Control Bit Value and Pulses ……………………………………………………………………………. 22 Figure 7 – Diagram of Steering system…………………………………………………………………………….. 23 Figure A.1 – Transmitter Block Diagram…………………………………………………………………………. 30 Figure A.2 – Preliminary Design for a Sine Wave Generator (Not Used in Final Design) ……… 30 Figure A.3 – Second Preliminary Design for Sine Wave Generator …………………………………….. 30 Figure A.4 – Pseudo Sine Wave Generator (Used in Final Design)……………………………………… 31 Figure A.5 – Output of One Pseudo Sine Wave Generator (High Frequency Channel) ………….. 31 Figure A.6 – Voltage Divider and Operational Amplifier Buffer ………………………………………… 31 Figure A.7 – Summing Amplifier……………………………………………………………………………………. 32 Figure A.8 – Control Signal Generator (Transmitter) Schematic…………………………………………. 32 Figure A.9 – Comparator Circuit…………………………………………………………….
………………………. 33 Figure A.10 – Low-to-High Transition Interrupts………………………………………………………………. 33 Figure A.11 – Flow Chart for Acquiring Number of Counts from Timer upon Interrupts……….. 33 Figure A.12 – Servo Motors Control Circuit…………………………………………………………………….. 34 Figure A.13 – UAF42A Universal Active Filter IC Circuit Diagram …………………………………… 34 Figure A.14 – UAF42A Typical Application Circuit …………………………………………………………. 34 Figure A.15 – Actual High-Pass (Band-Pass) Filter Frequency Response…………………………….. 35 Figure A.16 – Maxim MAX291 8th Order Low-Pass Filter Typical Circuit ………………………….. 35 Figure A.17 – Low-Pass Filter Actual Frequency Response Plot ………………………………………… 35 Figure A.18 – Theoretical Low-Pass Filter Response From MAX291 Datasheet[2]………………. 36 Figure A.19 – Generated Final Control Signal ………………………………………………………………….. 36 Figure A.20 – Signal Generated (Top) and Signal Received ………………………………………………. 37 Figure A.21 – Latency of about 300ms between the Signal Generated and Signal Received…… 37 Figure A.22 – Receiver Board…………………………………………………………………………………………. 38 Figure A.23 – ADC Setup ………………………………………………………………………………………………. 39 Figure B.1 – Joystick and Signal Generator Box……………………………………………………………….. 41 Figure B.2 – Female Two Pin Headset Cord to Circuit Connector ………………………………………. 41 Figure B.4 – A Typical Servo Motor………………………………………………………………………………… 42 Figure C.1 – Band-Pass Filter with center frequency of 2.2 kHz …………………………………………. 44 Figure C.2 – Program Indicates Nearly -3dB Attenuation at Low Cut-off Frequency
……………. 44 Figure C.3 – Program Indicates Nearly -3dB Attenuation at High Cut-off Frequency……………. 45 Figure C.4 – Resistance Values for Use with Figure A.15 to Build Filter …………………………….. 45 Figure C.5 – Cascade Layout to Obtain a 4th Order Filter Using Two UAF42As ………………….. 46 Figure C.6 – Theoretical High-Pass Filter Frequency Response………………………………………….. 46 Figure E.1: Budget………………………………………………………………………………………………………… 61

4

Introduction
Objective
The primary objective of this project was to build a cell phone link between a transmitter and a dumb robot and provide the capability to operate the robot from a remote location. The purpose of using the cell phone was to make the operation possible from any remote location in the world where cell phone use is available. The product would include two interface systems. One interface would operate between the transmitter and a sending cell phone, and a second interface would operate between the receiving cell phone and the dumb robot. The interface on the sending side would allow production and encoding of signals suitable for transmission via a cell phone. The interface on the receiving end would process the signals received by the cell phone and control the dumb robot. The simple diagram below illustrates the concept of the project.

Interface 1

Transmitter
(Joystick)

Interface 2

Sending
Cell Phone

Receiving
Cell Phone

RC Car
(dumb robot)

Figure 1 – Project Idea.

5

Specifications:
The specifications and the constraints that the team had to meet in order to successfully complete the project are listed below.

The operation of the robot would be indistinguishable from an off-the-shelf model with the exception of a small delay caused by the cell-phone connection. As long as this delay was negligible, the robot would perform just as well.

The off-the-shelf model would have variable and proportional speed and steering control to allow full control. Therefore, the final design would have this function also.

The cell phone could not be modified. Only the standard available features (speaker, microphone, hands-free set, etc.) could be used.

The cell phones used for the connection could be specified models to ensure working communication through a hands-free jack. However a custom-built cell phone was not permissible.

The hand-held transmitter used could be a custom-built transmitter. Using the actual transmitter that came with the dumb robot is not a requirement.

The system would be an open-loop system. The robot would not communicate back to the transmitter or make decisions.

The connection between cell phones could be manually activated. The transmitter and receiver did not have to make or receive a call.

The system should be a low power device. It must be portable, operating off reasonable number of batteries.

The final product should be presentable, with components laid out on PCB. The circuitry should be covered, packaged in an aesthetically presentable manner.

6

Design
The dumb robot chosen for the project was a RC car since it was easier to control. Several options were considered for the design of the system. The first option was to send DTMF signals through the cell phone and decode it
at the receiving end and control the car. However, since the robot needed to be fully controllable and a DTMF circuit could only send 16 tones at maximum, this idea was not chosen. The other option was to use actual voice commands to control the robot. However the team could not come up with a satisfactory decoding scheme and this idea was not implemented either. The team decided to use another option, which was to send two single-tone frequencies in a continuous manner and decode them at the receiving end. This option worked best with the requirements of the project since the two frequencies sent could be easily adjusted on the transmitter side. This would allow a larger continuous range of frequencies to be used which would allow a full analog range of control for the car. On the receiving end, it would be relatively easy to decode the signal and change it into control signals.

7

The following block diagram summarizes the overall final design that used to solve the problem. The subsystems shown in the diagram are explained in more detail below.

HANDHELD TRANSMITTER
(TWO PSEUDO-SINE WAVE GENERATORS)
STEERING SIGNAL FREQUENCY
GENERATOR
1500 HZ – 3000Hz

SPEED SIGNAL FREQUENCY
GENERATOR
320 HZ – 1000Hz
SUMMER

SENDING CELL PHONE

RECEIVING CELL PHONE

HIGH PASS FILTER

LOW PASS FILTER

STEERING CONTROL LOGIC

SPEED CONTROL LOGIC

RC CAR
Figure 2 – Block Diagram

8

Transmitter (Richard)
The hand-held control signal generator (transmitter) contains two signal generators which produce signals that are used to control the speed and the steering of the car. These signal generators are called pseudo-sine wave generators. The first generator generates frequencies ranging from 320 Hertz to1000 Hertz; this signal is used to control the speed. The second generator generates frequencies ranging from 1500 Hertz to 3000 Hertz; this signal is used to control the steering of the robot. The two sets of frequencies are added together by an operational amplifier summer and sent to the sending cell phone. The block diagram and circuit schematic of the entire transmitting system are shown in Appendix A (Figures A.1 and A.9, respectively). Approach to solution

Many parameters were taken into consideration while designing the transmitter. A transmitter that was low powered, easy to build, used a reasonably low number of components, inexpensive, reliable, and, most importantly, generated variable frequencies up to about 3500 Hertz (to utilize the human voice and cell phone frequency range) was desired. The initial approach was to use the original transmitter that came with the robot (car) and to modify it as necessary. After several considerations, the team realized that it was more difficult to modify a product to fit all the requirements. After discussions with the advisor, the team realized
designing a new transmitter was the most viable option. The team then decided to design and build a new transmitter which would have two sine wave generators: one signal to control the speed and one to control the steering.

One of the first preliminary designs of the transmitter is shown in Appendix A (Figure A.2). This design was built on the breadboard level and tested. However, it did not work well as the frequency was hard to change using only one parameter. Another preliminary design is shown in Figure A.3 of Appendix A. The frequency of this circuit needed to be digitally controlled and would require an additional digital circuit. This would only increase the required size and complexity of the transmitter and, therefore, was not implemented. A third design used a 555 timer to create an oscillating square wave. This design was used in a few tests involving the cell

9

phones. However, the square waves had to be filtered down to sine waves before being summed, and proved to be less controllable than the final design.
The final design decided upon by the team is the circuit in Figure A.4 of Appendix A. This circuit satisfied all the requirements and produced frequencies which were easily controllable using potentiometers. The frequencies produced by the original circuit ranged from 6 Hertz to 6 Kilohertz. In order to generate signals with frequencies in the human voice range the team modified the circuit by replacing the 1 Mega-ohm (R5) resistor. A 5 Kilo-ohm potentiometer was used to generate the higher signal range. A 50 Kilo-ohm potentiometer was placed in parallel with a 47 Kilo-ohm resistor and in series with a 4.7 Kilo-ohm resistor to generate the lower signal range. The circuit had three outputs: the pseudo-sine, square and triangle waves. The team had the option to choose the signal that worked the best through the cell phones. The pseudo-sine wave was chosen because it would produce the least number of harmonics and was the best choice for summing two signals together. As the name implies, the pseudo-sine wave is not a pure sine wave but an approximation of a sine wave produced from a diode rectified square wave. The duty cycle of the pseudo sine wave was not
fifty-percent, but this proved to be inconsequential. Appendix A (Figure A.5) shows the wave form of one of the sine wave generators. As one can see, the signals also contained a certain level of DC. The amplitudes of the original sine waves were too high (approximately 3 volts) for the cell phone microphone input and needed to be reduced. This was done using the circuit in Figure A.6 of Appendix A which is simply a voltage divider and an operational amplifier as a buffer to isolate the divided output from rest of the circuit.

Both sine waves were then sent through the cell phones to control the speed and the steering simultaneously. To accomplish this task, a summing amplifier was implemented to add the two sine waves together. The circuit for this summing amplifier is given in Figure A.7 of Appendix A. The signal output of this summing amplifier was sent to the sending phone. A waveform of the final control signal from summing amplifier is shown in Appendix A (Figure A.19). This is described more in the following section of this report.

10

In addition to battery connectors and power switch, a reset button was installed. This switch (synchronization button) was placed in series with a 10 ohm resistance and connected between the final control signal (the output of the summing amplifier) and ground. The purpose of this button was to correct a stability issue that occurred when sending signals through the cell phones. This stability issued occurred occasionally but unpredictably, causing the receiving cell phone to stop receiving anything other than noise. When the button is pressed, the 10 ohm resistor connection between signal and ground clears (brings to ground) the control signal momentarily and allows the receiving phone to re-acquire the signal. The 10 ohm resistor was necessary to keeps the signal from shorting to ground entirely, as this would sends a signal to the cell phone to end the call. The circuit of the final design is shown in Figure A.8 of Appendix A. This circuit is powered with two 9 volts batteries, one for the positive rail and one for the negative rail.

Establishing a Control Signal through the Cell Phones (Michael) The control signal is sent to the sending cell phone through a hands-free headset cord. Every standard headset cord is comprised of four wires which are for the microphone signal, the speaker signal, and two common or ground signals. However, not every headset cord has the same cell phone connector. A headset cord connection to the cell phone was used on the sending and receiving end of this system. Using this direct connection to the cell phone ensured that the cleanest and most intact signal was sent to or received from the phone. The microphone ground wire is connected directly to the local ground of the signal generator circuit while the microphone signal connection wire is connected directly to the output of the summing amplifier to relay the control signal. The simple diagram in Figure 3 below demonstrates this connection.

Figure 3 – Control Signal to Phone Connection

11

The headset cord used in this system is only compatible with a Sony Ericsson T610 model cell phone. However, the system could be modified to connect to any cell phone with a hands-free jack and a microphone input. This modification can be done by splicing the required headset cord and soldering a two-pin male connector to the microphone and ground wires. The two-pin male connector must be one which is compatible with the two-pin female connector inside the control signal generator (transmitter) box. Similarly, the headset cord used on the receiving end of this system is compatible only with a Nokia 6019i model phone, but the receiving end connector can be modified in the same way described for the sending connector. To better understand the sending and receiving cell phone connections, a photograph of the two pin male and female connectors is provided in Appendix B (Figure B.2 and Figure B.3). The control signal provided by the summing amplifier, has an amplitude of approximately 580 millivolts, Peak-to-Peak. This amplitude is ideal for microphone input. In early attempts to send a sinusoidal signal through a cell phone, only an extremely distorted signal could be salvaged
at the receiving end. This was due to the amplitude of the sine wave being extremely too high for the microphone input of the cell phone. Before understanding that the control signal must be reduced, a speaker taped to a microphone was used. Although this allowed the signal to be sent and received, this method introduced a large amount of unwanted noise into the system.

12

Received Signal (Michael)
Once a connection is established between the cell phones, the received signal has a typical amplitude of 1 volt Peak-to-Peak. The amplitude of the received signal is contingent upon the specific phone model used as well as the speaker volume level setting of the phone. The Nokia 6019i was set at volume level five. The receiving interface was fine tuned for this particular phone model and volume level. This fine tuning included placing a 10 Kilo-ohm resistor between the speaker signal and the ground connections at the receiving end. If a different model phone and headset connector cord is used by the method previously indicated, this resistance could be changed to better match the impedance of the specific phone’s headset jack and increase the clarity and stability of the received signal. The system may operate with a different model phone without any modification of this resistance, but the stability of the received signal could be compromised.

The received signal always includes noise, but this noise can be filtered out to provide a clean, reliable signal. The noise is expected due to the voice-quality sound transmission inherent to cell phones.

Filtering of the Received Signal
The received signal is doubled and buffered using a TL074IN DIP (Dual In-line Package) lownoise quadruple operational amplifier IC (Integrated Circuit). The 2 volt signal is connected directly to the input of the high-pass filter. The low-pass filter expects a positive signal oscillating somewhere between 0 and 4 volts. Before the signal is sent to the low-pass filter, the 2 volt signal is amplified again to about 4 volts Peak-to-Peak using another
operational amplifier included in the TL074IN package. It is also shifted up to approximately range from 0 to 4 volts by the addition of a 2 volt DC signal. For a more detailed picture of the connections and resistance values used for the amplifiers please see the receiving circuit schematic in Appendix A (Figure A.22).

13

Both, the low-pass and high-pass, filters are Butterworth filters. Butterworth filters were used because they provide monotonic pass-band and stop-band frequency responses. This characteristic was desirable for this system to prevent potential erratic responses to any unexpected frequency ranges which might damage the circuitry of our system or cause the servo motors on the RC car to respond in an unpredictable manner. Butterworth filters are also the most familiar and, therefore, were the easiest to work with.

High-Pass Filter
The signal sent to the input of the high-pass filter is a 2 volt Peak-to-Peak signal which comes from an output of the TL074IN IC. The high-pass filter expects a 0 volt DC input signal, and therefore, no DC is added to the signal until after it has been filtered. Two UAF42A DIP universal active filter IC chips are used to create a 4th order Butterworth band-pass filter to isolate the high frequency channel. The 4th order Butterworth polynomial which describes the frequency response is given by the following equation:

A band-pass filter is actually used instead of a high-pass filter to remove very high frequency harmonic distortions and noise in the signal which may be aliased as lower frequency artifacts (signal pieces) and cause interference. The filter will still be referred to as the high-pass filter for distinguishing and referencing purposes.

Each of the UAF42A universal filter chips is capable of providing a 2nd order filter. Cascading two chips creates a 4th order filter. The UAF42A IC is comprised of three low-noise operational amplifiers and several precise (+/-
0.5%) discrete resistors and capacitors. Positive and negative 9 volt supplies are used to power each IC. The circuit diagram for the UAF42A can be found in Appendix A (Figure A.13). Please refer to the references section of this report to find the hyperlink to the complete datasheet for this filter IC [4].

14

The design of the high-pass filter was done using a DOS-based computer program specifically for the UAF42 IC [5]. The computer program allowed the specification of the filter type, center frequency, and bandwidth of the filter to be used. The program provided resistance values to be used between certain pins of the IC as specified in the typical filter application circuit shown in Figure A.14 of Appendix A. Figure C.4 of Appendix C provides a screenshot of the filter program indicating the correct resistance values to be used to create the desired filter. A center frequency of 2.2 Kilohertz was specified which gives a lower cut-off frequency of 1.477 Kilohertz and an upper cut-off frequency of 3.277 Kilohertz (where the center frequency equals the square root of the product of the lower and upper cut-off frequencies.) The lower cutoff frequency of 1.477 Kilohertz is near-ideal because the frequencies created by the control signal generator were very near this frequency. Frequencies below 1 Kilohertz needed to have enough attenuation as to not interfere with the low frequency channel. This filter accomplishes these requirements. The upper cut-off frequency was not as ideal. However, the upper-cutoff frequency was not as critical, since frequencies above 3 Kilohertz were not created by the control signal generator (transmitter.) An actual frequency response plot for this filter can be found in Appendix A (Figure A.15). The measured frequency response was found with the filter as a part of the complete integrated system.

A similar active high pass filter could have been designed using other low-noise operational amplifiers and discrete components without the need for IC chips. However, the ICs provided precise capacitor values and dependable Operational Amplifiers. This combination resulted in a much more
reliable response than what the other alternative would have provided.

15

Low-Pass Filter
The signal received by the input of the low-pass filter is a 4 Volt Peak-to-Peak signal centered at about 2 Volts (2 Volt DC offset). The signal comes from the TL074IN IC. The low-pass filter IC will accept an input signal between -1 volts and 4 volts.

A Maxim MAX291 IC is used to create an 8th order Butterworth low-pass filter. The 8th order Butterworth polynomial which describes the frequency response is given by the following equation:
H8(s) =

The low-pass filter was created using the example circuit diagram from the MAX291 datasheet as shown in Appendix A (Figure A.16). The circuit is powered using positive 5 volts and ground (0 Volts). The circuit contains a built in oscillator which can be set using a capacitance between pin one of the IC and ground of the circuit. The internal oscillator value is defined by the following equation:

The cut-off frequency is equal to 1/100th of the internal oscillator frequency. Using COSC = 330 picofarads, the internal oscillator frequency and the corresponding cut-off frequency is 100 kilohertz and 1 kilohertz, respectively. The theoretical frequency response for this filter from the Maxim MAX291 datasheet [6] is shown in Appendix A (Figure A.18). The actual frequency response of this filter is very nice (as expected for an 8th order filter.) The high attenuation of frequencies before 1500 Hertz is the most important feature. The actual frequency response plot for this filter when fully integrated is shown in Appendix A (Figure A.17).

16

Speed Control System (Raj)
The speed control subsystem was responsible for converting the low frequency band signals (320Hz-1000Hz) into signals that would control the rear motor (speed) of the car. The initial idea for this setup was to use a frequency to voltage converter chip and convert the incoming signals into voltages that would control the motor. However, due to insufficient knowledge about the operation of the chip and unsuccessful attempts of converting frequencies into desired voltage ranges, a different idea was incorporated. The idea was to use a microprocessor (PIC) to measure the frequency of the incoming signal and produce pulse-widthmodulated (PWM) signals based on the frequency of the incoming signal. The block diagram for the speed control logic is presented below in Figure 4. The individual blocks in the speed control logic are discussed in the following sections. Square

Wave

Microcontroller
Circuit

Comparator
Circuit

Low Pass
Filter Output

Control Bit
Forward
Pulse

Rear Motor

Forward
Pulse

Reverse
Pulse

Control Circuit

H-Bridge
Reverse
Pulse

Forward
Pulse

Reverse
Pulse

Figure 4 – Speed Control Logic

17

Comparator Circuit
The function of the comparator circuit is to convert the output of the low pass filter into square waves of amplitude 0 volts to 5 volts. This was necessary because the amplitude of the sine wave output of the filter had magnitudes varying between 0 volts and 4 volts with a DC offset of 2.2 volts. These amplitude values would not always be high or low enough for the microcontroller to register low-to-high transitions in the input. For more information on use of low-to-high transitions, please refer to the Microcontroller Circuit section following this section. The comparator circuit was built using a LM358 low power operational amplifier. Refer to Appendix A.9 for the diagram. The threshold value for the comparator was set to about 2.2 volts using a voltage divider. To get the 2.2 volts, a 10 Kilo-ohm resistor is used along with a 10 Kiloohm potentiometer in series with a 5.1 Kilo-ohm resistor. The output of this comparator circuit was a square wave ranging from 0 volts to 5 volts with the same frequency as the incoming wave.

Microcontroller Circuit
The function of the microcontroller circuit was to read in the frequency of the incoming signal. This was done using a PIC16F876A microcontroller which is a 28-pin DIP chip. The PIC has a built in feature that can read low-to-high and high-to-low transition on specific pins as an “Interrupt” function and can be programmed to perform a different subroutine in case of an “Interrupt.” Refer to Figure A.10 for a diagram of Interrupts. The PIC also has another built in feature called “Timer.” The function of the “Timer” is to count up in units of instruction cycles. An instruction cycle for a PIC is determined by the oscillator which provides the microcontroller with a clock. Four clock cycles for the oscillator is equivalent to one instruction cycle. For example, if a 20MHz oscillator is used for clocking the PIC, 1 clock cycle =

1
= 0.05 microseconds
20,000,000

1 instruction cycle = 4 clock cycle = 0.2 microsecond.

18

Therefore the “Timer” of a PIC clocked with a 20 Megahertz oscillator can count up in units of 0.2 microseconds.
The “Timer” feature of the PIC, along with the “Interrupt” feature can be combined to measure the time duration between two interrupts. Please refer to Appendix A.11 for a flow chart of how to measure counts with interrupts.

Whenever the PIC receives an interrupt, it goes to an Interrupt Subroutine. The value of count from the timer is stored and the timer is reset to 0 and the PIC comes out of the subroutine and timer starts counting. When another interrupt occurs, the PIC goes back to the subroutine, gets the number of counts between the last interrupt, resets the timer again, and this process continues. The time duration between any two interrupts can thus be measured and this time duration is the Time Period of the incoming signal. The following formulas can be used to calculate the time period and frequency of
the incoming signal. Time Period = (No. of Counts from Timer) * 0.2 microsecond.

Frequency = 1/ (Time Period)
Once the frequency/time period of the incoming signal is found, it is mapped into a PWM signal of duty cycle varying between 0% and 95 %. The duty cycle is determined by the time period of the incoming signal which in term is determined by the position of the joystick in the y-direction. As the joystick changes is position along y-axis, so does the frequency produced by the transmitter and so does the Timer Values of the PIC. The following table shows the relationship between the joystick position, frequency produced, duty cycle produced and the direction of motion produced.

19

Joystick Position
(with reference to yaxis)

Frequency
Range

Counts

PWM Duty
Cycle Range

Motion

0

440Hz

11363

0%

Neutral

0

+ve

440Hz-1000Hz

11363 5000

0%-95%

Forward

0

-ve

440Hz-320Hz

11363 15625

0%-95%

Reverse

Table 1 – Frequency Vs Duty Cycle
As seen from the table, when the joystick is in the 0 position with respect to y-axis, the frequency produced is 440 Hertz and there is no motion in either the forward or the reverse direction (i.e. this is the “neutral” position.) When the joystick is moved in the +ve direction, the frequency increases from 440 Hertz to 1000 Hertz and so does the duty cycle from 0% to 95% in the forward direction. Similarly when the joystick moves from the 0 position to –ve direction, the frequency decreases from 440 Hertz to 320
Hertz and the duty cycle increases from 0% to 95% with the motion being in the reverse direction.

The relationship in the above table can also be represented in graphical form as shown below

Duty Cycle Vs Frequency
Duty Cycle (%)

Reverse

Forward

95%

Frequency (Hz)
320

440

1000

Figure 5 – Duty Cycle Vs Frequency
20

The above graph shows non-linear relationship between the duty cycle and frequency. This is because the transmitter itself has a non-linear relationship between the frequency and the joystick position. The joystick’s movement in +ve direction produces about 560 Hertz change in frequency where as in the reverse direction the change in frequency is only about 120 Hertz. However in terms of period of the signal and the number of counts provided by the counter, the graph looks as shown following figure.

Duty Cycle Vs Count (Timer Value)
Duty Cycle (%)

Reverse

Forward

95%

Counts (Timer)
15625

11363
Figure 6 – Duty Cycle Vs Count

5000

As seen from the above figure, the relationship of duty cycle versus count (from timer) is linear due to the fact that there is a big difference in count values at lower frequency where as there is relatively smaller difference in count values at higher frequencies. A frequency of 440Hertz maps to count of 11364, frequency of 320 Hertz maps to 15625 and frequency of 1000 Hertz maps to 5000. As we can see, the difference between the count values is not very much. There are also some safety bands added to the boundaries of the actual expected frequency band of 320 Hertz to 1000 Hertz. Many times there are glitches in the cell phone or in the transmitter itself that produces frequencies outside the expected band. The safety band on the lower frequency side is about 70 Hertz and on the upper frequency is about 100 Hertz. So any signal between 320Hz and 250 Hz would be considered 320 Hertz and treated as full reverse (95% duty cycle). Similarly, any signal between 1000 Hertz and 1100 Hertz is considered 1000 Hertz and treated as full forward.(95% duty cycle). There is also another feature that reduces the effect of

21

glitches that cause the frequency to drastically change. In case of any
erroneously large changes in frequency, the PIC rejects the change in frequency and uses the previous frequency. For the actual program, code and the flow chart for the program, please refer to Appendix C. Control Circuit

The function of the control circuit is to ensure that the motor is not damaged due to any glitches in the circuit that causes both forward and reverse pulse to be sent out at the same time. This is done by using the “Control Bit” sent by the microcontroller along with the Forward and Reverse pulse and using discrete logic 7400 series chips. Please refer to Appendix A (Figure A.12) for the circuit diagram.

The circuit contains an inverter (SN74LS04) and two 2-input AND gates (SN74LS08) and are connected as shown in the diagram (Figure A.12). The following table illustrates how the control bit controls which pulse to allow to the motor.

Control Bit

Pulse Allowed

0

Reverse

1

Forward

Table 2 – Control Bit Value and Pulses
As seen from the table when the control bit is high (or 1), the forward pulse is allowed and when the control bit is low (or 0), the reverse pulse is allowed. H-Bridge and Rear Motor
The function of the H-Bridge is to provide sufficient current amplification so that the Forward and Reverse Pulses can turn the rear motor forward and reverse.

The H-bridge and motor used were both present in the RC car already. Reverse engineering was done to find out the connections going into the H-bridges and the Forward and Reverse pulses were directed to these connections.

22

Steering Control System (Justin)

Steering System
Square wave representing
desired turning angle

PIC
Microcontroller
Circuit
Left Steer

ADC measuring
current steering
angle

Right Steer

Control Bit

Control Circuit

Potentiometer

H-Bridge
Front Motor

Steering Shaft

Figure 7 – Diagram of Steering system
Reverse Engineering
Work on the Steering System began by again looking at how the original car was controlled. The car’s steering system consisted of a basic servo motor setup similar to the one shown in Figure B.4. A typical directional servo consists of a motor, a potentiometer, and the circuitry necessary to control the angle of the motor shaft given a Pulse Width Modulated (PWM) signal representing the desired angle. The motor shaft is then connected to the steering shaft through a number of gears. The potentiometer is mounted on the steering shaft to measure the current angle of the steering shaft. The circuitry then compares the desired angle to the current angle and sends control signals to the motor to make the necessary correction. Unfortunately, in the attempt to discover how the original system could be used within the new system, the original control circuitry for the servo was damaged.

23

Solution
It was determined that the motor and potentiometer alone could be used to control the steering angle. The idea was to use a PWM signal created by the same PIC used to measure the higher frequencies which correspond to the desired steering angle. In order for this to work, the desired angle was compared to the current angle and powered the motor in the appropriate correcting manner. The PIC already has the desired angle after measuring the incoming frequency. The potentiometer would obviously be used to get the current angle, however an Analog-to-Digital Converter (ADC) circuit would have to be constructed for this purpose. Three wires previously ran from the car’s servo to the potentiometer. These wires were cut and connected directly from the potentiometer to the receiving circuitry instead. The green wire runs to one end, the yellow wire runs to the other end, and the white wire runs to the middle terminal, known as the wiper terminal. The green wire is connected to the regulated 5 volt supply, and the yellow wire is connected to ground. The white wire is then the center of a voltage divider and used as the output signal. The voltage at the white wire is then
directly related to the current position of the steering shaft. As the shaft, moves in one direction or the other, the potentiometer rotates that direction which causes the voltage of the white wire to increase or decrease appropriately. The purpose of the ADC is then to convert this voltage to a binary number that the PIC can use. The PIC 876A actually has Analog-to-Digital pins with built-in ADCs (Analog-to-Digital Converters.) However, an external parallel connecting 8-bit ADC was chosen instead. The ADC is then connected directly to an 8 pin port on the PIC. The decision to go with the external ADC was made for two reasons. The first was that the value of the ADC could be easily read by placing either a voltmeter or an oscilloscope at the 8 output pins. LEDs were placed at the outputs in a similar manner to that shown in Appendix A (Figure A.23). This allowed a visual for the binary values that were being sent to the PIC. The second was that the team had little experience using internal ADC methods in PICs, and a successful method was never determined. The ADC chosen was an ADC0804. The values of the ADC were recorded for the middle position and the two extremes, left and right of the steering shaft. The ADC value was approximately 128 in the center. It got as low as 74, and as high as 181.

24

PIC Program
The program measures the period of the incoming signal using the interrupt procedure described above. The number of counts is then scaled to range from 128 to 256. Then the 8 bit number corresponding to the current angle of the shaft is read in from the ADC. This number is scaled to range from 0 to 128 using the reference values measured earlier. This allows the correcting value (desired – current) to range from 0 to 256. This method eliminates the need for negative numbers by making 128 correspond to no error between the desired value and the current value. If the correcting value is greater than 128, a correction is needed in the right direction; if the value is less than 128, a correction is needed in the left direction. The plan was to start with proportional control and then move to more advanced control for the motor the steering if necessary. However, in the first few tests, there was a large amount of drag on the motor by the turning front wheels, and the
motor reaction time was very low. The decision was made to just make the wheels turn quickly at a fixed rate until the error was very small, and then to start doing proportional control to bring the error close enough to zero that the steering angle would be considered correct by the user. This was set as a dead band in the code. If the wheels are within about 10 degrees of the desired angle, the software considers this good enough and quits reacting until the desired changes again. This system of control seemed to work very well, with the exception of a few coding bugs. For example, the ADC value actually started going beyond the previously measured maximums and minimums causing the program to freeze up. This was easily corrected however by adding a few lines of code that set the variable to the extreme whenever the reading went pas the extreme. This control system was then set as our final controller. However, the PIC also needed a way to power the front motor.

H-Bridge
It has already been stated that the rear motor was powered with an H-bridge circuit already present on the car. However, there was not a convenient device available to power the front motor. The PWM control discussed above along with another H-bridge to move the motor appropriately was used. The H-bridge chosen was a SN754410NE-1. It is a Quadruple Half-H Driver. It was chosen because it comes in a 16 pin DIP and it was readily available. It supplied the necessary power to move the motor and responded to 5 volt inputs from logic chips.

25

Therefore, the same logic safety control circuit could be used that was used for the rear motor. The advanced Proportional Control System including the H-bridge moved the motor appropriately and the drag on the wheels minimized overshoot issues. The system performed well enough to give a descent amount of proportional steering. That is, you could turn the wheels to a desired angle, within a degree of acceptable error, as specified by the amount of movement in the joystick.

Power (Justin)
The team originally hoped to power the logic and the motors with the same battery. The battery that came with the car was a 7.2V 1500mAH rechargeable battery. Unfortunately, the rear motor put a very large load on this battery, and the voltage often fell well below 5 volts when driving hard. This would make it very difficult to regulate and keep a consistent 5 volt supply necessary for control of the logic chips and micro-controllers. Therefore, when integrating the systems, the truck carried 4 batteries— the original 7.2 to power only the rear motor (for speed), one 9V battery for a +9V rail, one 9V for a -9V rail, and one 9V that supplied power to the front motor and to a 5V regulator that powered the ICs. However, the last 9V would run low very quickly; a quick fix for this was to add a fifth battery to separate the ICs from the steering. The next step was to cut the number of batteries down. It was decided that the 7.2V battery should remain devoted to the rear motor. To power everything that required a positive voltage, a rechargeable 9.6V 100maH battery was used. This supplied power to the 5V regulating circuit and to the Hbridge for the front motor (for steering), and it also acted as the approximate +9V rail. Another battery was necessary for the negative rail however and a standard 9V battery was still used for this.

On the transmitter side, the power requirements were of course much less, and only two batteries were necessary. One 9V for the positive rail and one 9V for the negative rail were used.

The 7.2V (1500mAH) battery for the speed of the car should last approximately 69 minutes since it draws 1.3 A at full speed. The battery used is old, however, and does not last as long as it should. Similarly, the 9.6V (1000mAH) battery for the steering should last approximately 260 minutes (130 mA constant consumption, 230 mA consumption when turning.)

26

Results and Conclusions
The overall performance of the system was satisfactory and it met all the
specifications. The user could send signals though the cell phone and control both speed and steering of the car. The transmitter produced the correct frequency ranges and the receiver received them correctly (please refer to Figure A.20.). The speed and steering control system decoded the signals and controlled the car very well. The latency of the overall system was around 300ms (please refer to Figure A.21). The majority of the latency was introduced by the cell phone-to-cell phone communication. The latency was calculated with the two cell phones in close proximity. It can be expected to increase as the distance between the cell phones increase because the signal transmission time between the cell phones would increase (if having to route through more towers, satellite, etc). However, the processing time in both the transmitter and receiver circuitry was minimal and thus the overall system performance was fast enough. The car was moving and steering smoothly and the delay was negligible. With more time and money, a camera could be integrated on the car to get a visual for where the car is going. This project was very challenging, but the team prevailed.

In conclusion, the project was a success. There were many obstacles that really tested the team’s resolve. Disagreements and misunderstandings created tension between team members and even with the team’s faculty advisor. However, keeping a professional approach with a determination to successfully complete the project held the team together. The team members grew more and more accustomed to working together. Working hard and relying on each other, the team succeeded on completing the project on time, and succeeded in demonstrating its performance.

27

References
[1] Analog Edge, “A Quick Sine Wave Generator,” December 11, 2005 http://www.national.com/nationaledge/jun04/article.html

[2] Dallas Semiconductor, “Digitally Controlled Sine-Wave Generator,” December 11, 2005 http://www.maxim-ic.com/appnotes.cfm/appnote_number/2081

[3] Instructions, Parts List, and Schematic. Operational Amplifier Function Generator, CK103 – Opamp Function Generator, October 2005.
http://electronickits.com/kit/complete/meas/ck102.pdf

[4] Datasheet, UAF42AP, Burr-Brown (Texas Instruments) Universal Active Filter, November 2005.
http://focus.ti.com/lit/ds/symlink/uaf42.pdf.

[5] Burr-Brown Corporation, Texas Instruments, Inc. (1991, 2001). Filter42 [Computer program]. UAF42 Design Program. Tucson, AZ: Applications Engineering. (Application Program No. AB-035)
http://focus.ti.com/docs/toolsw/folders/print/filter42.html
[6] Datasheet, MAX 291, Maxim 8th-Order, Low-Pass, Switched-Capacitor Filters, October 2005.
http://pdfserv.maxim-ic.com/en/ds/MAX291-MAX296.pdf

[7] Photograph, “A servo disassembled,” Seattle Robotics Society, November 2005.
http://seattlerobotics.org/guide/servos.html

[8] Datasheet, ADC0804, National Semiconductor 8 bit A/D Converter, November 2005. http://www.national.com/ds/DC/ADC0801.pdf

28

APPENDIX A
System Schematics, Diagrams, and Plots

29

JOYSTICK

STEERING SIGNAL
(PSEUDO-SINE WAVE)
1500HZ – 3000Hz

DIVIDER/BUFFER

SPEED SIGNAL
(PSEUDO-SINEWAVE)
320HZ – 1000Hz

DIVIDER/BUFFER

SUMMER

TO SENDING PHONE

Figure A.1 – Transmitter Block Diagram

Figure A.2 – Preliminary Design for a Sine Wave Generator (Not Used in Final Design) [1]

Figure A.3 – Second Preliminary Design for Sine Wave Generator [2]

30

Figure A.4 – Pseudo Sine Wave Generator (Used in Final Design) [3]

Figure A.5 – Output of One Pseudo Sine Wave Generator (High Frequency Channel)

7
1

V+

3 +

R20
Vin

U5
6

Vout

4
5

2 LM741

R18
V-

Figure A.6 – Voltage Divider and Operational Amplifier Buffer

31

R16
R15
V+

R12

V+

Vin 1

U3

6

2

+

Vout

7
1

3

LM741
6

+

3

R14

R13
Vin 2

4
5

4
5

U4
LM741

2

7
1

R17
V-

V-

Figure A.7 – Summing Amplifier

J1
R POT(JOY STICK)

VCC
R16

2
1

VCC
10k
R4
560

R20
10k

square

U1

triangle
1
2
3
4
5
6
7

VCC
470k R9
R10
1M

1OUT
1IN1IN+
VCC+
2IN+
2IN2OUT

R1
82k

R3
15k

8.2k R11

U3
R12
U2

R18

1
2
3
4
5
6
7

100K
4OUT
4IN4IN+
VCC_
3IN+
3IN3OUT

14
13
12
11
10
9
8

R2
100k

C1
47n

1IN- NULL5
1IN+
V+1
NULL1 OUT1
VNULL4
NULL2 OUT2
2IN+
V+2
2IN- NULL3

10k

14
13
12
11
10
9
8

3
R17
4
3.3k

R13

V-

6

Output

5

Of f Null

LM741CN

R15
100K

sine

R14

VCC

R

R5
10k

R

3
4

V–

D2

VCC

U4
1
2

R7
820
DIODE

Of f set NullNC
INV+
IN+
V-

Output
Of f Null

LM741CN

DIODE
D4

J1
R POT(JOY STICK)

DIODE R8
2
1

D1DIODE

IN+

R19

R6
10k

D3

8
7

Of f set NullNC
INV+

10k

LM747
C2
47n

LM348N

1
2

2
1

1k

J3
OUTPUT TO CELL PHONE

R4
560
square

U1

triangle
1
2
3
4
5
6
7

VCC
470k R9
R10
1M

1OUT
1IN1IN+
VCC+
2IN+
2IN2OUT

4OUT
4IN4IN+
VCC_
3IN+
3IN3OUT

R1
82k

R3
15k

8.2k R11
14
13
12
11
10
9
8

C1
47n

R2
100k

C2
47n

LM348N
R6
10k
sine

VCC

D3

R7
820
DIODE
D2

DIODE
D4
D1DIODE

DIODE R8
1k

Figure A.8 – Control Signal Generator (Transmitter) Schematic 32

8
7
6
5

Figure A.9 – Comparator Circuit

INTERRUPT

INTERRUPT

Figure A.10 – Low-to-High Transition Interrupts

Interrupt

Get “No of Counts” from
Timer

Reset Timer=0

Wait for Interrupt
Figure A.11 – Flow Chart for Acquiring Number of Counts from Timer upon Interrupts.

33

Figure A.12 – Servo Motors Control Circuit

Figure A.13 – UAF42A Universal Active Filter IC Circuit Diagram [4]

Figure A.14 – UAF42A Typical Application Circuit [4]

34

High Pass Filter Frequency Response

Attenuation (dB)

0

1000

2000

3000

4000

5000

Cite this Remote control car

Remote control car. (2016, May 07). Retrieved from https://graduateway.com/remote-control-car/

Show less
  • Use multiple resourses when assembling your essay
  • Get help form professional writers when not sure you can do it yourself
  • Use Plagiarism Checker to double check your essay
  • Do not copy and paste free to download essays
Get plagiarism free essay

Search for essay samples now

Haven't found the Essay You Want?

Get my paper now

For Only $13.90/page