WHERE IS ALL THE STUFF

There is a dropbox on the computers with all the project files. You can also find all the TEA files (Brainstem folder) used in all the projects in this lab. If you need to find something else, the best way to it is to turn on the old computers: they have a lot of files used in the past. If you need to change something inside the TEA files, please talk with Domitilla first. If your changes are not correctly, you can burn the components (brainstem and h-bridge).

The code for the camera system is already inside all the computers. Remember that you have to select "user" to enter correctly in computer 0. You will find the folder "camera_programs" on the desktop and then all the code used in different project.

The code for the cars is already there as well. The folder is ~/Desktop/brainstem/aProject/Disturbance_carx where x is the number of the car. Since the code is working well, if you need to make some changes please think about them carefully, specially if you are going to change the coefficients of the control system.

If you need to replace some hardware parts, they are in the cupboard near the windows. You can find there new brainstem modules, new H-bridge, cables, etc. There are a lot of electrical components and new batteries too. A new car has also been bought to have new plastic parts for the cars. To avoid breakage:

1. Follow the instructions to turn on the cars (ALWAYS).

2. While you are running the experiments, look at the computers that runs the CPS for the camera system so you can stop the run if the tracking has been lost. If you don't do it, the car will hit the wall.

LAB WIKI CHANGES

I cannot edit the lab wiki page (https://wikis.mit.edu/confluence/display/DelVecchioLab/Lab+Documentation) directly so I am using this section to add changes.

1. TEA FILES. You don't have to compile the library RoboCar_Lib.tea and you don't have to load it in 4 2.

2. NEW CAR MOTOR SETTINGS (car 4, 5, 6). I put the videos for this in the dropbox.

3. LINKS. You cannot access to all the links in that page, so you probably find a way to do this.

INFORMATIONS ABOUT THE PROJECT

The paths in this project are stored in fig8AL.txt, fig8CL.txt and fig0.txt. There are two different versions of these files. The first one is used by the cars and contains only 10-20 points. This has to be placed in the folder ~/Desktop/brainstem/aDebug/aUnix/i686 of the car (they are already there, but if you need to do changes remember this) and it is used by the car to decide the steer value needed to follow the path. The second one is used by the CPS (camera program) and it is used to project the x-y measurement into a 1D position. This files has to be placed in the CPS folder (for example ~/Desktop/camera_programs/LeoCPS_3 of all the computers) and it contains a lot of points, about 1000, so that the projection is good and precise.

In the current code, the cars start moving along the paths. At each normal time-step, if the future positions of the cars are safe, then the cars are moving normally at the constant speed we have set. Note that this does not effectively keep the car's speed constant throughout the run because we are controlling the linear speed that is low during the turns. If the future positions are not safe, the supervisor finds an acceleration for the current positions and use it. At the moment, everything is made by a trajectory tracking controller that guarantees that the position of the car will be inside the to bounds used to schedule a solution.

TO RUN THE CODE

Currently the supervisor works on three cars, Car 1, Car 2 and Car 3. Car 1 carries Car 6's symbol, whose white background makes it easier for the positioning system to track, the other two are using the right symbols. To run the code, first start the CPS on the three camera computers. For this project, use LeoCPS_3 on the camera computers.

You can access the car using Putty on the laptop (all the cars are already configured, you just need to select the right one and digit the username and the password). If you have a mac, you can access to the wireless connection eecs4315 (you can find the password on the lab wiki), and from the terminal type ssh root@192.168.1.10x. Insert the password and you are ready to go. Since you need to control all the cars at the same time, my suggestion is to download csshX that allows you to control all of them at the same time, but this is up to you.

Then on the cars, go to ~/Desktop/brainstem/aProject/Disturbance_carx (x is the number of the car) and type "make clean" followed by "make new" to compile the code into the directory i686. There is a symbolic link to i686 in the home directory; go there (~/Desktop/brainstem/aDebug/aUnix/i686) and type ./ca <path filename> to run the code. The file is fig8AL.txt for Car 1, fig8CL.txt for Car 2 and fig0.txt for Car 3. The cars need to start on their respective paths (they can start anywhere on the path, but they need to be in the right direction and it is better to start in the straight line because the steering control will start after few seconds, so the risk is to see the car go straight). After you lunch the program, press S on the keyboard to enable the supervisor control.

PLEASE NOTE THAT you can make Car 1 run in the fig0.txt, that is not a problem, but you have to change the CPS code before! To do this, just open the project in the folder, select main.cpp and the change the array that contains the paths. REMEMBER that since Car 1 uses Car6's symbols, you have to change also the path for Car 6. You don't need to do this for the other cars.

C CODE

The C code is made by different functions. All the files should be well commented, but you can refer to Kevin's page to have an idea of what everything does.

TEA FILES

In my project I am using a new TEA file which sets directly the PWM (the name of the file is pwm_control.tea). So the main difference is that you won't find in my C code the variable 'throttle' and in my TEA files the dynamic maps. If you need to use them, you can find all the TEA file in the dropbox folder.

To compile your code, put in the laptop folder ~/Desktop/acroname/aUser. The open aConsole (folder ~/Desktop/acroname/aBinary) ad use the command

steep nameoftheprogram.tea

If your code is correct, then steep will generate a .cup file in the aUser folder. To load the file, connect the Car's brainstem to the laptop, open aConsole (you should see the green light of brainstem flashing) and use the command

load nameoftheprogram.cup 4 x

where is the place where you want to upload the file. You should not change Reset_Button.tea and timer.tea, so place your TEA file in the slot 4 11. See the lab wiki for more informations.

CPS CODE

Again, this is made by different function. I used for a while Kevin CPS but then I modified something in the projection to have it correctly. Also care that in Kevin CPS folder you will find the old .txt file with just 10 point, but to have a better projection you need a larger number of points.

STEP OF THE LAB PROJECT

Part 1 - Model Identification

Giving a constant value of PWM (input of the system) to brainstem I measured the speed of the car (output of the system). The identified transfer function has a gain (about 2.5) and a pole (0.375). Consider that:

1. These values can change between to experiments, but you can consider the variations as a disturbance on the system.

2. The experiment has to be done when the car is running ON THE FLOOR, so you are considering the real behavior. Don't do it leaving the wheels running free.

Part 2 - Design of the trajectory tracking control

Starting from the identified transfer function and knowing the desired behavior of the car, I designed a controller so that the car can follow the desired trajectory and the disturbances on the car are attenuated. You can find the coefficients of the controller inside the C code, you can try to change them BUT please do some good simulation first.

Part 3 - C code and results

I tested the controller and the solution of the scheduling problem with three cars. The results are consistent but the performances are not so high. This can be due to a lot of things:

1. The system identified is really simple and is not even close to a model of a real car.

2. We have measurement errors, projection errors and the floor is not perfect.

3. The PWM (input) is limited, so you cannot have a more strong controller with higher performances.

WHAT IS NEXT

To have a real experiment, the algorithm should use the trajectory tracking control only when the supervisor is acting. During the safe time, the state of the car should be estimated online from a model and the measurement made. This is not trivial because the CPS can't measure the speed, that is just an estimation from the projected position; moreover the model used to predict the state of the car should be quite precise.

  • No labels