March 27, 2003, Ramona Cone


After talking with the lab technician, the hardware is going to be mounted on breadboards for now. I already have most of it set up, I just need to wrap up some lose ends on the circuit: connect the 5V converter, connect battery supply to all components, connect I/O's to EMAC, and determine resistor values for 555 timer. These items were completed by March 28,2003.

The assembly code to set Timer 2 to produce a TTL square wave has been compiled and tested in lab. This signal from Timer 2 will be used to drive the motors. Design equations explaining the calculations for the timer's reload values are shown below.



Fig. 1 Equations to calculate Timer2 reload value.

Below are links to code modules used to initialize our EMAC microprocessorit's keypad and LCD display.

EMAC Setup and Initialization
Keypad Initialization and Operation
LCD Initialization and Operation

The linear actuator, that we are using to move the wheels left and right, has a feedback potentiometer. See FIG(to be inserted) for connection of potentiometer to system. The feedback voltage is connected to an A/D converter on the EMAC. From earlier testing, it was determined that the feedback voltage range was 0.2V-2.9V. Below is a table of feedback voltages corresponding with wheel angle.

Wheel Position Voltage Level
Full Left 2.9V
Center 1.52V
Full Right 200mV
Fig 2 Feedback voltage levels

I am setting the A/D range to 0-3.125V. Calculation were made to determine the hex values of voltages read from the A/D converter. Methods used will be shown below.


Fig. 3 Calculation values for comparison to AD values


Below is a list of values to use for comparison in assembly code to determine wheel position.

Voltage Level (V) Hex Value Position
0.2 10h Full Right
0.4 21h .
0.6 31h .
0.8 41h .
1.0 51h .
1.2 62h .
1.4 72h .
1.52 7Ch Center
1.6 82h .
1.8 82h .
2.0 A3h .
2.2 B3h .
2.4 C3h .
2.6 D3h .
2.8 E4h .
2.9 ECh Full Left
Fig. 4 Conversion table for hex values from A/D

Next, flowcharts to create software for motor control, wheel manuevering, and polling of the digital compass were created. They are shown below.




Figure 5 Turn Right Module



Figure 6 Turn Left Module



Figure 7 Find Center Module

The assembly code to implement these flowcharts is here:
Motor and Linear Actuator and Control




Figure 8 Poll compass Module

The assembly code to implement this flowchart is here:
Digital Compass Control

The assembly code modules for the flowcharts above have been written and partially tested. The module which controls wheel angle has been successfully tested. I ran into some problems while integrating these modules with the hardware. First, extra logic to shut the h-bridge off when the brake signal was high was needed. According to the specification sheets for the h-bridge, the PWM input also needed to be low to shut the h-bridge off. I inverted the brake signal and logical AND with the PWM signal. This corrected the problem and shut the h-brige off when the brake signal was high. I had failed to remember that port 4 on the expansion HDR3 needs pull-up resistors. I also had problems with the grounds from the 5V source, EMAC and 12V battery being referenced to each other. This problem left the circuit open somewhere and therefore it did not work. When I connected the 12V and 5V grounds the circuit would operate as expected. My first observation was that this was a problem. I was trying to take measures to protect the EMAC from high voltage spikes caused by the high power sections of the circuit. I made several attempts to correct this measure with opto-isolators that failed. In discussion with one of my advisors, it was determined that extra circuitry was not needed and connecting the two grounds would be a sufficient solution. Our decision was based on the fact that all the power is supplied from one battery. One point to remember though, is to keep the section of ground from the power circuitry a direct line with no other connections from the electronics.


March 27, 2003, Erin Cundiff


Today I worked on testing my shaft speed encoder software with the Hall Effect sensors. There are two Hall Effect sensors mounted on the vehicle, but I have decided to just use one. If my distance measurement needed to be more precise I would use both of them and average the two values, but this is not necessary for this project. Perhaps the seniors next year would have use for both sensors. I measured the circumference of the wheel of the vehicle to be 4 ft. There are 25 nuts attached to the inner part of the wheel, and they are equally spaced. The Hall Effect sensor causes a pulse when a nut is detected. On the 26th pulse from the Hall Effect sensor, the wheel will have made one complete revolution. The pulse is a TTL signal, and I am sending that signal back to external interrupt 3. Each pulse causes and interrupt, and on the interrupt, a counter is incremented. When this count reaches 13, I know that the vehicle has traveled 2 ft. I will increment the distance measurement by 2 ft. This accuracy could be easily improved, but for this project it is not necessary. I have tested this code with the vehicle and the EMAC board, and it works well. I have also been working on an outline for mapping the quad, but I will discuss that more next week. For the rest of the day I worked on wire wrapping my two acoustic sensor circuits. Next week I will test my wire wrapped circuit, and I will work on combining my code and Ramona's code for getting a software module together for testing the straight mode with the vehicle. We need to get outside as soon as possible to see how the sensors react to actual grass and concrete.

Return to Note links