Engineering application grimblebot report

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.


The report describes the different stages executed during the requirement to testing stages of "Grimblebot". The robot was two-wheeled and was capable of balancing itself by means of the provided feedback system. The project was divided into two stages mainly based on the two main challenges faced:

  • How to make the robot aware of its position
  • How to restore the robot so that the wheels stay under its centre of gravity thereby achieving balance

An ultrasonic sensor was at the core of the feedback system. The signals from the ultrasonic sensor was read and interpreted. Following this, the angle made by the robot with the ground was calculated. From the angle, the rotation required to balance the robot can be calculated.

The circuit design used to interact with the sensors, the way the signals were interpreted and processed and finally the way stability was achieved by varying the motor speed and direction will also be described in the upcoming sections.


Grimblebot is made up of mainly four functional modules which are

  • Ultrasonic Sensor
  • The Ultrasonic PCB Board
  • Main Motherboard
  • Motor

2.1 Operation Process

The sensor on the Ultrasonic PCB sensor works on a request-respond basis. The reading from the sensor is sent back as pulses to the Ultrasonic PCB board receiver when a request is received from the Ultrasonic PCB board. The Ultrasonic PCB board, upon receiving the signal from the sensor, converts the received signal to a digital value and passes it on to the main/mother board. The motherboard does the computation and sets the motor velocity, direction and rotation angle to obtain balance.

2.2 Ultrasonic PCB Board

The signal transmitted/received to/from the sensor to position Grimblebot is generated/interpreted by the Ultrasonic PCB. The Ultrasonic PCB board is functionally composed of two main components:

  • Ultrasonic Transmitter
    ü Ultrasonic Receiver

2.2.1 The Transmitter

The main components of the transmitter module are a microprocessor, a CD4000 and 6 1.2V batteries. The signal produced by the transmitter is amplified by the CD4000 chip. The 6 batteries connected in series produces a cumulative voltage of 7.2 V. This is required mainly because the microprocessor produces a 50 KHz signal which is only 3.3V.

This signal is further amplified by differential signalling before being fed in to the transducer. Differential signalling:

In differential signalling of a double ended system (i.e. with a positive and negative Voltage Vs and -Vs), a voltage VS represents the high voltage level and the low logic level is 0 V. The difference between the two levels is therefore VS - 0V = VS. Now consider a differential system with the same supply voltage. The voltage difference in the high state, where one wire is at VS and the other at 0 V, is VS - 0V = VS. The voltage difference in the low state, where the voltages on the wires are exchanged, is 0V - VS = - VS. The difference between high and low logic levels is therefore VS - (- VS) = 2VS; twice the voltage of the system

This means the potential difference across the transducer will be 7.2V-(-7.2V) = 14.4V.

In effect, the signal has been doubled and can now be fed through the transducer. Level shifting:

The 3.3V produced, by the Microprocessor is beneath that of the logic gates voltage threshold and thus needed to be level shifted to the 7.2V required. This is done using transistors as shown in the circuit below.

Here the transistor acts as a switch. If the microprocessor outputs a low signal i.e. transistor off, the voltage of the input will be pulled high to the 7.2V rail voltage, and this is interpreted as a logic 1by the NOT gate.

When the microprocessor outputs a high signal, the transistor turns on and the voltage drops to zero. This is interpreted as a logic 0 by the NOT gate.

2.2.2 The Receiver

The receiver is responsible for detecting the reflected signal from ground. The received signal is translated to voltage and amplified and sent back to the microprocessor. The comparator on the motherboard compares the two output signals and finds the bigger signal. The Op-amp Filter:

The Op-amp used has a gain of 50. It has a cut-off of 70KHz and acts as a low-pass filter.

The project utilized the TLV2772 dual op-amp. The Comparator:

The comparator is used when there are two voltages or current to be compared. The output of a comparator is the larger of the two input voltages. The comparator in the below given figure won't give an output until the voltage exceeds 2 V is generated by the Op-amp. Until then the output won't go high.

2.2.3 Assembly of the Ultrasonic PCB

When the output from the circuit matched with the expected values, the Ultrasonic PCB development was complete. Then the daughter board was soldered on to the motherboard.

2.3 Microprocessor and Motor Driver

2.3.1 Microprocessor

The microprocessor's main function was to accept the signal being reflected from the ground and being sent by the receiver. The time taken for the signal to receive the microprocessor was used to calculate the angle made by Grimblebot with the ground. This time could be calculated by knowing the clock frequency and the received signal. The algorithm pre-pre-programmed in to microprocessor was adapted accordingly after trial and error tests.

2.3.2Motor Driver

H-Bridge circuit was used to drive the motors in the project.

6 1.2V volt batteries were connected in series to produce 7.2V in total. The motor drives clockwise if Q1 and Q4 are closed and Q2 and Q3 are open. The reversal of this causes the motor to rotate anti-clockwise.





Effect on Motor





Moves it to the right





Moves it to the left





Undesired state











The main objective of microprocessor was to perform the computation and produce the desired signals to keep Grimblebot in equilibrium. But the signal produced by the microprocessor is not high enough to drive the motor. And it is also necessary that analog output is given to the motor.

Digital signals are not good enough to rotate the motor because that would render the bot unstable. Instead, the current passed to the motor must vary as per the feedback obtained so that stability is attained.

PWM is capable of rendering a range of current to a desired device. So as per the requirement, the current supplied to the motor is varied between zero and full power.

The frequency of the current passed on to the motor is maintained a constant. Instead, the width of the signal is varied so as to provide intermediate stages of power. The square wave used in Grimblebot was 20KHz.

2.4 Power Rails

To circuit is powered by:-

  • 6 1.2 V batteries connected in series to produce 7.2 V.
  • 5V connection to power the mother board.
  • 3.3 V to power the Ultrasonic logic board.

2.5 The Motherboard

The completion of the daughter board (Ultrasonic logic board) was followed by soldering the board on to the motherboard. The motherboard's factory settings and layout were not modified for the project.

2.5.1 Assembling the Motherboard:

Soldering of the components was followed by heating the entire board in the oven. This ensured that the components were properly fixed. Once the motherboard was assembled, the transducer circuit was added on.

3.0 Simulation results

All the sub-circuit were simulated and tested on OrCAD before implementing on the actual device. The board design, the component ratings, PCB layout were all performed as well to avoid ambiguity later on. The PCB layout was done with both testing and wiring in mind so as to use the space most efficiently.

3.1 The results for the simulation of the Ultrasonic Transmitter

3.1.1 Simulated result of Voltage across Output at R4:

Readings from R4 was used to calculate the differential voltage in the circuit.

3.1.2 Simulated results of Op-amp/low pass filter of the Receiver

As a result of the gain bandwidth, cut-off frequency was way lower than 70KHz. This was the cut-off value derived for Op-Amp.

3.2 Testing

3.2.1 Testing the Power Rails

In order to test the power rails, the croc clip was shorted with the ground pin and checked the voltage rating on C11 capacitor. The output obtained as a result is given above.

The scale at which the oscilloscope was set was not correct and this was the reason for the above output. Once sorted, the expected output was obtained.

3.2.2 Power Rails to Daughter Card

When the Ultrasonic PCB was connected and voltage measured the below given was the output obtained.

3.2.3 Microprocessor to Ultrasonic Board

The signal sent from the microprocessor and the one obtained on the daughter board were the same and the graph below confirms the same.

3.2.4 Ultrasonic Board to Microprocessor

3.2.4 Ultrasonic Board to Microprocessor

3.2.5 Transistor Testing

When every component on the board was tested to find out the reason for the incorrect output voltage, it was found that the transistors were not soldered properly. The polarity setting was wrong and this was the cause of the problem. The component had to be taken and re-set in the right way. That solved the problem of wrong output signal (3.3 V) and the wave below was obtained.

4.0 Performance Evaluation

Grimblebot was tested in two conditions. On carpeted floor and on smooth floor as well. The one on carpeted floor was done in G26. The other tests were conducted outside G26.

4.1 Method

In order to turn on Grimblebot, it should be manually supported in a vertical position for around 12 seconds. This is required for the different components of Grimblebot to exchange signals and regulate its steady posture. Once the potentiometer stabilizes the velocity and angle of the motor, Grimblebot will balance itself.

4.2 Testing the Grimblebot

4.2.1 Test One

Time (in hours): 0:14


During the first test, Grimblebot was unable to balance itself. It would fall forwards or backwards failing to swing back to equilibrium. The potentiometer seemed to be able to set the motor in only one direction and then stopped.

4.2.2 Test Two

Time (in hours): 3:00


During the second test, it was realized that the results in the first test were mainly due to the incorrect signals as input to the Ultrasonic PCB.. The signal received was not the square wave as required. Instead it seemed to be greatly affected by some external noise somehow.

4.2.3 Test Three

Time (in hours): 3:00


In this session, it was identified that the transistor had been soldered with wrong polarity in place. Later on, it was reset in the right way as per the design diagram. This greatly affected the performance and took a big stride forwards. Following plenty of trial and error tests, Grimblebot was able to achieve stability after calibration values obtained from results. The sensors were not at the right angle initially and this also caused problems during the testing process.

4.2.4 Test Four

Time(in hours): 3:00


In this session, the sensors and batteries were changed. After adjusting the motor, Grimblebot was able to stay steady for 68 seconds on carpeted floor. When it was set up in an unsupervised and uncarpeted floor, Grimblebot balanced itself for 97 seconds.

5.0 Points to take a note off:

Improper soldering led to components giving wrong or incorrect readings.

Presence of solder iron on the PCB at incorrect places led to noise and affected the performance of the entire circuit. Progress in the project was hindered as a result and had to be removed before continuing.

When one of the components was wrongly placed during the soldering process, removing the components led to the copper tracks cracking thereby cutting off the signal flow. Later, a wire was simply inserted into the crack and the signal flow was restored as a result.

5.2 Positioning:

Ideally the decoupling capacitor is to be placed near a particular component. The decoupling capacitor reduces the noise produced in the circuit. During testing, it was found that the positioning of the transistor and comparator were not proper and as a result had to be removed and resoldered. The circuit had to be designed so that the IC was placed so as to cut down on wiring as much as possible.

5.3 Batteries:

Lack of sufficient power also affected Grimblebot causing it to fail in maintaining the balance.

5.4 Using wrong IC:

Wrongly using an IC instead of a comparator also caused circuit to give no output at all. This problem was solved by later on replacing it with the correct comparator.

5.5 Tolerance:

Tolerances of the components vary and exact output values are difficult to calculate.

5.6 Sensors:

The sensors were calibrated by changing the angles after performing plenty of trial and error tests. The angle it was set later on was also dependant on the sensitivity of the sensors as well. Initially Grimblebot used to go off balance in spite of functioning properly for couple of cycles.

6.0 Conclusion

Even after setting up as per the specializations, it required lot of trial and error tests for Grimblebot to finally achieve equilibrium.

The whole circuit was initially simulated on OrCAD and this helped to design the circuit and identify the main issues that might occur during the development process. Once the PCB was done from scratch, and components attached, the system was tested. The output voltage from the microprocessor was 3.3 V and that from transistor was 7.2 V as required. This was enough to produce a 50KHz signal from the sensor. This signal was later amplified.

Once it was made sure that Grimblebot design and output values were as per specification, it was initialized and had to be held up for a duration of around 12 seconds. This gave the system time to exchange signals and initialize them. Once the potentiometers were calibrated, the motor speeds adjusted themselves until Grimblebot balanced itself.

7.0 Recommendations

7.1 Excessive wiring can be avoided by placing components which require more interconnections closer.

This could have been taken care of the design stage of the project itself. As a result of communications with other boards as well, there were wires running across the boards also. Even though an attempt was made to cut down on the number of wires, there was a definite limit to the outcome because of time constraints mainly.

7.2 Move the decoupling capacitor closer to the microprocessor:

When the decoupling device was kept at a distance from the component, it was noticeable that the signals were not efficiently filtered before reaching the microprocessor. Filtering seemed to be much better when it was kept closer to the device.

7.3 Larger dial for a potentiometer:

Initially the potentiometer used was not enough to provide sufficient detail for finer movements of Grimblebot at stages where it almost reached equilibrium. This was because of lack of information provided by potentiometer when it moved towards stability. Replacing the potentiometer with a larger dial, helped to provide more information to the motor.

7.4 Transducer circuit board with increased area:

Trying to make the circuit board compact resulted in arranging all the components in very limited area. But this had a positive side of putting lesser weight on Grimblebot. But it resulted in congestion on the board because of plenty of wiring. Increasing the area of circuit board could have led to neater arrangement of components and lesser wiring as well. A board layout of 9 * 11 instead of 9 * 7 is suggested.

7.5 Testing surfaces:

The computations performed by Grimblebot are mainly based on the time taken by the signal to get reflected back to the receiver. When Grimblebot was tested on uncarpeted surfaces, this response time was less and Grimblebot seemed to achieve equilibrium faster. Meanwhile, when placed on carpeted surface, the reflected signal got distorted mainly because of the nature of the surface of the carpet. This delayed the time taken by Grimblebot to stabilize itself