Home Up

TIE348 Robot

 

The Embedded System Robot

 

Picture: Maria El Said           

Tisu-1

 

 

General

The Embedded System Robot is made for embedded system lab work course. With the robot it is possible for students to try real-time operating system programming, VHDL programming and to study embedded system architectures (how to implement processor, memory and interfaces together).

 

Hardware Description and Functions

 

 

 

 

 

 

Different Parts

The body is made from plastic and all the other parts are mounted to this plastic body. There are three tyres in the robot one in front and two rear tyres. Front tyre in capable to move freely in all the possible directions. Two rear tyres are connecter to DC motors via gearboxes.

DC motor speed is as high as 3 360 rpm and torque is only 4 mNm without the gearbox and therefore it is impossible to connect them directly to the tyres. In the robot DC motors are connected to the tyres via gearboxes and the gearbox ratios are 21:1. This gearbox ratio reduces the speed to 160 rpm and increases the torque to 75 mNm. This speed and the tyre diameter (72 mm) gives us the robots maximum speed, which is 36 m/min (72 mm * pi * 160 rpm). This speed is theoretical and it is impossible to achieve because those values previously used in the calculation did not include any load or friction. Another reason why it is impossible to achieve that maximum speed is that the robot has to be controlled during the drive (maintain the course by increasing and decreasing tyre speeds) and there must be some adjustment range over normal driving speed. That is the reason why normal driving speed is only 80% of maximum speed and not full 100%.

Between the DC motors and rear tyres there are also optical code wheels. With these code wheels and the optical encoders it is possible to read the motions (direction and speed) of the shafts and use that information to control DC motors and that way robots moving. This is the way how the processor can adjust desired speed to robot and keep it stable.

The power source, which the robot is using, is 12V rechargeable battery and its capacity is 4Ah. The battery is placed as middle and down as possible to guarantee a good balance for the robot. If the robot is used at maximum speed and all its other functions are used at the same time the operating time is then about 3 hours, because robot takes then approximately 1,34A current from the battery.

Electrical construction of the robot is divided to two different boards. Extension card is placed to the front of the robot and behind the robot there is an Altera NIOS-processor evaluation kit.

Altera NIOS-processor evaluation kit is responsible for all the functionality of the robot. Evaluation kit is placed in vertical position and on the back of the robot because this way it is easier to use all its buttons and see all its displays and indicator lamps. Evaluation kit is not connected to any other part of robot directly. It is only connected to the extension card and it uses that card’s funtionality for driving display, motors, ultrasonic, and so on. There is also some memory in the evaluation card and it can be used for storing programs and some driving values.

Extension card is mounted in the front and this card is responsible for adapting Altera NIOS-card to all other electrical circuits as mentioned earlier. The electrical circuits in extension card are: motor drivers, led matrice display, Bluetooth module, ultrasonic transmitter and ultrasonic receiver.

 

Moving

As earlier mentioned the robot is standing on three tyres. In the front there is one tyre that is capable to move freely in all the possible directions and there is no DC motor connected to that tyre. Both rear tyres are connected to DC motors and optical encoders independently. By controlling and driving these rear tyres it is possible to drive robot straight forward or back or to turn it to right or to left. 

 

 

 

 

 

 

 

 

 

 

Sensors

There are two kinds of sensors in the robot. Optical encoders in the rear tyre shafts and ultrasonic transmitter and receiver placed in the front of the robot.

 

Optical encoders are in fact consisting two different parts: optical encoder and a code wheel, which is rotating inside the encoder. Optical encoder includes led transmitter and multiple receivers. With these it is capable for sensing the rotation speed and direction of the code wheel. For that purpose it needs one space pattern in the code wheel and an index hole. Space pattern is causing the light beams to be interrupted as the code wheel is rotating and at the same time inside the optical encoder its IC is able to produce information about rotation speed and direction (how fast light beams are to be interrupted and what is the interruption sequence). That information is readable from outputs CB A and CH B (how fast pulses are coming out from outputs and is CH A pulse before CH B or visa versa). Index hole is causing one pulse in index output (CH I) per one revolution. The resolution information that can be achieved with the optical encoders is 500 pulses in one revolution.

 

 

 

 

 

 

 

 

In the front of the robot there is an ultrasonic transmitter, which is sending 40 kHz sound in 1 ms patterns guided by NIOS-processor (picture below, third signal). The receiver is listening the same frequency and its purpose is to detect when the pattern is reflecting back from some solid obstacle and tell that exactly moment to NIOS-processor (picture below, first signal is received sound and second signal is detected digital signal). NIOS-processor knows when it sendid that sound pattern and when did receiver detect it and that time lag is used for distance calculation (in the air the sound is moving 344 m/s and in this case sound has to travel the distance twice).

 

 

 

 

*        First signal = received ultrasonic signal

*        Second signal = detected binary signal

*        Third signal = transmitted pulse pattern

 

 

What is the robot capable of?

Construction, electrical parts and sensors are not very complex ones, but with the right kind of program it is possible to generate quite versatile behaviourals for the robot. It is possible for example program robot to move around the room following the walls with its ultrasound transducer. At the same time robot can store wall information to its memory.

 

 

 

 

Secondly robot can move to the one corner of the room and then start to scan the obstacles from the room. This is possible by driving multiple straight lines across the room and using the ultrasonic transducer at the same time.

 

 

 

 

Now the final task can be for example patrolling in the room to random directions and observe new obstacles.

 

 

 

 

Body and Assembly

  

Robot body picture coming soon…

A robots body is composed of 10 different acryl pieces. All pieces are mounted together by gluing except the bearing housings of rear tyres. They are mounted with screws because DC motors, optical encoders and tyres have to be replaceable.

     Different plastic parts (pictures are coming soon)...

 

Assembly pictures coming soon...

 

Circuit Boards

Robot consist two different circuit boards (Altera NIOS development board and extension board). Altera NIOS development board includes a reconfigurable logic; there is all the robots intelligence. Extension board is placed in robot that Altera development board can communicate with outside world using robots motors, display and sensors.

 

Altera NIOS development board and extension board functions:

Altera NIOS development board

bullet

 Includes program code for NIOS processor.

bullet

 Includes VHDL modules for driving different functions (display, ultrasonic, …).

bullet

 Is responsible of all operations and decisions that robot is making.

bullet

 Is attached to the extension card and via that it can communicate with the outside world.

 Extension card

bullet

Includes electronic circuits needed for driving display, sensors, Bluetooth module and DC motors.

bullet

Convert different voltage levels.

bullet

Is the interface to the outside world.

 

 

 

 

Electronic Circuits in Extension Card

There are several electrical circuits in extension card. Those circuits are switching regulator (12V => 5V), Bluetooth module, led matrix display, DC motor drivers, optical encoders, ultrasound transmitter and receiver.

 

Switching Regulator

Switching regulator converts voltage from battery’s 12V level to 5V level for led display, ultrasound and Bluetooth module. Switching regulator is step down (bulk) type and it is capable of driving 3A current. Switching regulator is simple as possible (only 5 parts) and it uses one inductor for voltage conversion. Basic idea in this kind of switching regulator is that it uses high frequency (52 kHz in this case) for storing energy to the external inductor (little pulses). Pulses are so short that voltage over C2 capacitor does not rise over desired 5V.

 

 

 

 

Schematic

 

Led Matrix Driver

Robots display consist two dot matrix elements placed next to each other. One element has five led lights in one column and seven in one row. Because there are two of these elements, robots display is 10 x 7 matrix. Whole display is driven one element at in time. In fact even the whole element is not driven at once and only one column of one element (five led lights) is driven at the same time. This kind of display driving technique is called multiplexing. When this is done fast enough human eye can’t see multiplexing and it seems that whole display is on at the same time. By using multiplexing it is possible to spend much less components and electricity for driving display and it also uses less space from electricity card.

 

 

5 x 7 x 2 Led matrix display

 

 

Schematic

 

DC Motor Controllers

Altera NIOS processor is controlling DC motors using PWM signals (Pulse Wide Modulation). PWM signal is a signal where the integration over one period carries the information (percentual duty cycle). PWM signals are handled in robot with H-bridge circuits. H-bridge circuit is based on four driving elements (arranged like letter H) and only two elements are on at the same time. By chancing the driven elements it is possible to drive DC motor in both directions. With H-bridge circuit it is possible also to use brake option and that way cause robot to hold its position.

 

 

 

PWM signals

 

 

 

DC motor control with H-bridge

to one direction

 

 

 

DC motor control with H-bridge

to other direction

 

 

Schematic

 

The Optical Encoder

This circuit is very simple. Only resistors are needed because optical encoder output types are open collectors. Therefore there has to be pull-up resistor in every output to guarantee TTL compatibility. Signals from optical encoder are transferred and indicated to Altera NIOS processor.

Schematic

 

The Bluetooth Module

Supply voltage for Bluetooth module is 3,3V. Because switching regulator output is 5V there has to be voltage conversion to 3,3V before Bluetooth module. This is done with one normal linear regulator and two capacitors. Altera NIOS processor controls the Bluetooth module via UART interface. So only two lines are needed between NIOS processor and Bluetooth module (TX and RX). Only problem is that in Bluetooth module output and input voltages are 0V (Low level) and 3V (High level) and Altera NIOS output and input levels are 0V (Low level) and 5V (High level). So there has to be conversion circuits also in both TX and RX. 3V level is done also with normal linear regulator (like supply voltage conversion) and it is connected to Bluetooth RX pin via one resistor. TX can supply 3V level, so there has to be conversion to 5V level. This conversion also is causing negation to the signal and that’s why there has to be NOT-operation first inside Altera NIOS processor before UART RX.

How RX works: 

bullet

When Altera is transmitting data to this pin at 5V (bit 1) level, current cannot go through diode and Bluetooth RX pin level remains in 3V.

bullet

When NIOS processor wants to transmit 0V (bit zero) it simply sanks current via diode from Bluetooth RX pin and causes that way logic level to drop zero Bluetooth.


How TX Works:

bullet

When Bluetooth is transmitting data (3V, bit 1) voltage conversion is done with transistor. 3V voltage in transistors base pin causes current to flow from collector to emitter. When this happens it causes transistor collector voltage (Vc) to drop in and this is connected to NIOS RX pin. So what happens here is that 3V level from Bluetooth pin TX is converted to 0V level.

bullet

When Bluetooth wants to transmit 0V (bit zero) it closes the transistor (because base pin voltage is 0V) and that causes the collector voltage to rise to 5V. So what happens here is that 0V level from Bluetooth pin TX is converted to 5V level.

Schematic

 

The Ultrasound Transmitter

This circuit is also very simple. It consist only the ultrasound transmitter. Pulse pattern output (5V level) from Altera NIOS processor is directly connected to the ultrasound transmitter. Pulse pattern frequency is 40 kHz and one pattern length is 1 ms.

Schematic

 

The Ultrasound Receiver

Ultrasound receiver is receiving very low signal from the air. So first thing what has to be done is weak signal amplifying. This is done with transistor amplifier circuit. Capacitor C8 is in circuit because it stops DC component from the signal (we are only interested 40 kHz sound). Next thing is also amplifying (ratio is 13 because 130 kohm/10 kohm = 13) and now with operational amplifier. Diode D2 is connected to the operational amplifier output and it is allowing current flow only to one direction (so current cannot go back to operation amplifier output). Resistor R26 and capacitor C10 are for integration purpose (capacitor if holding current a little time and resistor is conducting current to ground at the same time). Last operational amplifier is signal detector (operational amplifier is used as comparator). When voltage rise to 3V level over integrator then detector chances output to 5V level (0V => 5V). This comparator output is connected to Altera NIOS prosessor and that way it is possible to get information how near the wall is for example.

Schematic

 

Connectors

There are six different connectors in the extension card. One connector is power connector and this connector is connected to battery (2 pins). Two connectors are for DC motors (2 pins/connector) and two connectors are also for optical encoders (6 pins/connector). The biggest connector is for connecting extension card and Altera NIOS development card together. This connector has 40 pins and ribbon cable is used between these two cards.

Schematic

 

Circuit Board 

Extension card circuit board has two layers, top and bottom. All components are mounted to top layer. 

Circuit Board (top layer) 

Circuit Board (bottom layer) 

Circuit Board (components) 

 

Software description

The robot software consists of two different parts: hardware code and software code. Hardware is thousands of programmable logic ports and software is code that the hardware run.

Hardware is programmed with VHDL (Very High Speed Integrated Circuit Hardware Description Language). The VHDL-code contains a different block for each different physical part of the robot. For example ultrasonic transmitter and ultrasonic receiver has a different block of hardware code. Even the NIOS-processor that runs the software code has an own VHDL-block. Finally the compiler generates a configuration file which can be downloaded into the robot. This file causes the programmable logic device to do it's configuration. Now the hardware is ready to run!

Software part of the robot is programmed with Asm/C/C++ and the code can be separated into a many different parts. The main parts of robot's code are realtime operation system and user level code.

Main part of the realtime operation system is programmed with assembler and user interface is programmed with C. This kernel is responsible for switching between different tasks and giving CPU time to all processes. The kernel is also pre-emptive, i.e. it will give time to all processes regardless if some of the processes don't do CPU idle calls.

Basically there is a connection with software and hardware code: almost each hardware block has a counterpart on the software side. For example there is an ultrasonic controller block on software side thath controls the ultrasonic hardware blocks.

 

 

 

Last modified: marraskuu 05, 2003