Monday, November 22, 2010

MATLAB autocode generation from simulink models and integration in RTEMS

I have added a modest contribution to the RTEMS Wiki regarding autocode generation from Simulink models using Real-Time Workbench and consequent integration in RTEMS OS. This software can be then targeted for embedded soft-processor architectures such as the LEON-3. Here's the link to the page:

RTEMS: MATLABCodeGeneration

The overall objective is to be able to integrate simulink models in Real-Time Testbenches involving components such as dSPACE systems, Processor and/or Hardware in the Loop.

Friday, August 27, 2010

Using PLB PCIe bridge core with microblaze

Do you want to exchange data between your Xilinx board and your PC via PCI express interface?

So.. Having trouble configuring the Xilinx PCIe bridge core on your microblaze (or powerpc) embedded architecture? Assuming your Xilinx board is the endpoint: the board is not being detected on your windows pc? Does using 1 lane (x1) design in a 8 lane (x8) PCI express header board strange to you?

All these and more are answered here:

Configuring Xilinx PCIe Bridge core

For the PCI bridge core (not PCI express), to be used with a standard PCI header endpoint Xilinx board, the configuration is more tricky. However, the address translation principles are the same.

Best,
JM

Wednesday, May 12, 2010

For loop with SPARC assembly


For those who don't want to waste to many time searching on how to do a simple for loop in asm to be processed by, say, a LEON, here's your answer.

The next code does the following:
- Initialize registers
- Iteratively shift left one bit in a register
- add one LSbit to the shifted register
- loop while i less than 10



References:
SPARC Assembly Language Summary, Princeton University
SPARC Assembly/Control Structures, Wikibooks

Monday, March 22, 2010

Implementing a Linux RTAI Based Real-Time Motion Controller for Differential Mobile Robots

In my M.Sc. Thesis I implemented a real-time motion controller for differential mobile robots, generic enough to be implemented in any differential mobile robotic platform.

It was a very enthusiastic project. I had the chance to learn about several topics and implement an intelligent RTAI based control system running on a very small embedded linux distribution. The system is installed on a 128MB Compact Flash and flushed into the PC104 RAM at boot time. Then, a Spartan3 FPGA implemented the PWM generator signals that drive the motors based on the outputs given by the controller running on the PC104.

This system sends packets through TCP/IP to a visualizer module running on another PC for validation of the controller accuracy, given the target trajectory of the robot.

Among the publications i made regarding this subject, i want to share the most extensive one which will hopefully be of use to you. It is a book chapter recently published on the book CONTEMPORARY ROBOTICS - Challenges and Solutions entitled Generic Real-Time Motion Controller for Differential Mobile Robots. Here's the link to the full article:

Generic Real-Time Motion Controller for Differential Mobile Robots Chapter

In simple terms, the control system allows the robot to autonomously reach one or multiple target 2D (x,y) position point(s) based velocity vectors. The user simply has to set the desired positions for the robot to reach, or send velocity value/angle values for it to run with the desired velocity in a desired direction. It also implements an obstacle overcome algorithm to allow the robot to climb small deffects (ramps) on the flor that can block its way.

Best,
JM

Friday, January 15, 2010

Auto-Completion problem in Eclipse while programming in C/C++ solved

Eclipse supports auto-completion for both typedef structs and structs without type definition declarations, in contrary to the information that might be found on the web.

To have Auto-completion for structs using "->" or "." just do the following using the Eclipse IDE:

1) Window -> Preferences -> C/C++ -> Editor -> Content Assistant

2) Mark all except "Present proposals in alphabetic order" if not necessary.

3) All the headers you create with struct declarations must be known by the IDE. Therefore all the folders containing the headers must be added to the project:

3.1) Project -> Properties -> C/C++ General -> Paths and Symbols
3.2) In the "Includes" Separator, add all the folders containing the headers (except the root folder of the project). This is, if you have the following folder structure

/root
- /Headers
- reference.h
- /FunctionDeclarations
- main.c

the folder "Headers/" must be added with the "Add" option in the Paths and Symbols.


Simple as that.