2013-03-14 Casemates explorer (+2)
Now the rover is able to autonomously drive on a central line that is parallel to the walls. On the video, you se, how the simple algorithm allows even to find out of a corner and a door. The robot uses two ultrasonic distance sensors.
In this challenge, we build a simple vehicle with free running wheels that is equipped with the HiTechnic accelerometer, a LEGO legacy motor -used as a tachometer, as explained in the book “Eureka, Problem Solving with LEGO Robotics“, page 41ff- and a legacy rotation sensor. The idea is to have the vehicle drive down on an inclined plane, apply a Kalman Filter, and extract the best estimations of the current speed, and displacement. The data is logged into a file.
1. Running a Kalman Filter (KF) on the NXT is explained in the book “Eureka…”, chapter 12. In fact, this is much easier as one might think, because simple equations are hidden behind the general complex appearance of the Kalman filter. Since the LabVIEW NXT module does not include double indexed arrays, a scalar KF is applied in sequence with a non-canonical forcing element of the displacement state estimation. The prediction equation of the displacement x becomes:
x(predict) = x(old estimate) + u(x), where u is the forcing element, and:
u(x)=Δt*s(old estimate)+½*Δt*Δt*a, where s is the speed, a the acceleration, and Δt, the time elapsed.
The prediction equation for the speed similarly is:
s(predict) = s(old estimate) + u(s), with:
We also simplifiy the equations by admitting H=1 in the measurement equation that generally is written as:
z=H*y+v, where z is the measurement, y the state = (x,s), v is the measurement noise, and H is the measurement matrix (or in this case a measurement scalar)
The team found an interesting solution to the “line-following” problem:
- Read the light-sensor values (down-pointed sensor with LED on to produce reflected light on the ground)
- Separate the values into three sectors:
- 0..30 : on black line! → Robot should drive straight with a slight drift to the right. (The drift makes sure that the robot won’t cross the black line.)
- 31..34 : grey color! = on the edge → Don’t change any motor setting. (Makes sure the robot only changes its behavior, if the color is inambiguously perceived as black or white.)
- 35..100 : white color! = off-line → Vigorously turn to the left, and try to hit the line.
2012-12-05 Casemates Explorer (+1)
The robot is almost ready for being operated in the casemates, and we tested the motors with a LabVIEW program, as you can see here :
1. Because of the drive straight problem, B-team now is challenged to build a LEGO version of the South-pointing chariot (Lanchester type), which is a kind of mechanical compass, as can be seen on:
- http://www.convict.lu/Jeunes/Dir_Ma_rev.htm (The very first LEGO application of the south-pointing chariot -follow the link to “Direction master”, as explained in the book “Eureka! Problem Solving with LEGO Robotics“)
- http://odts.de/southptr/ (Excellent compilation)
- http://www.youtube.com/watch?v=s27xyrTOcGg (Super presentation; follow the link to get the building instructions)
2. The team also should build Tribot, in order to have a better robot for further challenges:
The question arose, how the course correction method of the previous post works. In order to answer this question, we logged the result of the rotation sensor comparison into a data-file. As the program detects a small difference in the rotation sensor values, a decision is taken to reduce the power of motor C. This compensates for the insignificant course deviation. The power adaptations are cycled rapidly. However, internally, new motor settings are only passed to the motors every ms, as the firmware motor refresh rate is 1kHz (cf. d_output.c in AT91SAM7S256 folder of NXT Firmware Source code -see link below). So, even if the loop is cycled more rapidly than 1kHz, motor power will only change at a maximum rate of 1kHz.
Here is the data-logging program code:
2012-11-21 Beginners’ challenges (1)
A new team of students wants to start playing with LEGO robotics. They view a few videos on youtube about what sort of activities, challenges and projects have been done all over the globe… and are fascinated. Then they get the dual drive LEGO robot from the Casemate’s team, in order to make some introductory activities with it. The first consists in running LabVIEW, connect the NXT to the host computer, view light sensor data in a chart on the screen. Then, they have to solve the simple challenges below. Note that they have no experience with LabVIEW at all, so they need some short advice (this takes 10-15 minutes):
- How do we move an icon to the diagram window?
- How do we select the correct icon (select the item in the box)?
- How do we connect icons with threads, in order to generate a sequence of actions?
- How do we create a constant and connect it to the correct terminal?
- How do we clean a diagram? How do we remove broken wires?
- What’s a loop? How do we stop a loop?
- What’s a comparison of numbers?
- How do we use case boxes?
Challenge 1: Drive the distance (200cm)
Today we continued building the robot base. As you can see, the HiTechnic controller, the NXT and the battery pack are mounted on top of the frame. Also we added an omniwheel that should drive an additional rotation sensor. This will retuzrn additional information about the distance travelled. There is no slippery, since this wheel isn’t tracking.
A second activity today was the trial to get orientation data from the rotation sensors of the driving wheels. We therefore used the LEGO robot on the left moving over the black line pad. The program consists of two parallel loops. The first controls the robot to follow the black line. The second logs the orientation data into a file. The orientation is calculated according to the formula:
where N_x are the rotation sensor values in degrees, d the wheel diameter, D the distance between the wheels.
2012-11-09 The robot frame!
The robot base – a tank type – is large enough to transport two bottles of French wine ! (We will talk about these bottles in a further post.) Philippe worked hard on this frame.
Fränz started installing LabVIEW and now tries to write a program that controls an NXT-driven LEGO robot that should transform its rotation sensor values into robot orientation and distance travelled, and from these polar coordinates into Cartesian coordinates. In a second step, Fränz will add the electronic compass data and merge them with the orientation data with a Kalman filter. (It therefore will also use the rotation speed). Finally, he will add an additional odometer, and eventually an accelerometer, in order to get inertial information.
2012-10-26 The “Casemates” project is resumed
- We tried a long time to get additional pieces to the original Tetrix set. This was almost impossible, since we could not import those pieces to the EU. So, we went via Switzerland… Anyway, we got them!
- The robot will be equipped with tank-treads, in order to be able to move in a dusty, stony and uneven environment.
- We want to equip the robot with two sonar sensors, in order to maintain it on the central line of the casemate. Then, we’ll add a 3D-accelerometer for inertial navigation. Finally we’ll use a compass, and a rotation sensor for odometry.
- The main goal will be to traverse a casemate of about 100m length and draw a map of the course taken.
- Here Philippe and Roman working on the drives: