Sunday 23 January 2011

Software architecture

Just to comment that I have created a project in SourceForge and the source code is available in a SVN project. The address of the project is:

And the address of the SVN repository is:

To accede to the repository I’m using TortoiseSVN that is a tool to manage SVN repositories. You can visit the web above and download the software:

The software architecture of the main board is something like this.

Each box in the picture represents a software component that is named with a three letters acronym. The software is divided in three layers, application (APP), services (SRV) and drivers (DRV). There are also two layers in drivers. The layer bellow is the low level driver that manages the microcontroller peripherals and the layer above is a manager. We have also a services layer that gives services to the application like angle or arm positions calculations. I mean that make this kind of calculations.

We have also a diagnostic layer, which is not implemented yet and will be used to manage directly peripherals without the application and test the hardware. And also will be able to configure parameters.

Managing all the system we have an operating system that in fact is a scheduler. It uses a 1ms tick to count time. It have a list of task that can we configured how long have to launched and with which delay. I have added in the operating system the WinAVR libraries.

Let’s going to review the software components. For the time being the services that I have are:
ACL: This is the arm calculations module and from the ADC measurements of the potentiometers from the arm, calculates the arm angles and the hand position.

BVM: This module is the battery voltage manager. It has a task to be executed every 100 ms that takes the ADC measurement from the battery voltage, calculates the battery voltage and turns on the red led if the voltage is to low.

HPM: This is the hand pulses manager. It has a cyclic task to be executed every 1 ms and counts pulses from the hand encoder to know the position. I have planned to store the hand position in EEPROM but I haven’t implemented yet.

USS: This is the ultrasound manager that drives the I2C to read the distance measured by the sensors. It has a task to be executed every 50 ms and functions that returns the distances to the objects.

In the drivers layer we have:
ADM: This component manages the ADC converters. It has a task to be executed every 10 ms and for the time being measures the elbow position, shoulder position and battery voltage. This is done every 30 ms.

IOM: This is to configure and manage the input-output pins. It has functions that manage the leds and motors and drives each function to the adequate pin.

DCM: This component manages the DC motors. It has a cyclic task called every 10 ms and one instance for each motor. Each motor has its own configuration constants to configure the end of each movement. In the future these parameters would be in EEPROM and they will be calibrated. Also I’ll try to detect objects collisions but this will be in next versions.

ICM: This module is the I2C manager. It has the functions to start and read the ultrasound sensors measurement.

LCD: This is the display driver. It has the functions to initialize and to write in the display.

PAP: This module manages the stepper motors. It has a task to be executed every 1 ms

TCK: It has the functionality to manage the tick measurement. Initializes a timer and has a counter.

And the low level drivers:
ADC: Here we have the functions to manage the analogue-digital converters peripherals.

DIO: In this module we have the functions to configure and manage the digital input-output pins.

I2C: We have the functions to manage the I2C peripheral.

GPT: In this component there are the functions to configure and mange the general purpose timers.

Well, I have finished describing the available components. The next steps will be to develop more drivers like PWM or communications. The communications are important because I want to make software in a PC based on Linux to manage the robot. I have a board with an embedded Linux were I’ll try to put a software developed in the PC. The idea is to make all the drivers implemented in the ATMega64 board and the application in the embedded Linux board.

No comments:

Post a Comment