I am using the line following program supplied with the drivers, but it just isn't following the line!! I've tried tweaking everything!! The only modification I've made is motor and sensor configuration. Here is the code:

/** \file MSLL-test3.c * \brief Mindsensors LineLeader Sensor demo program * * MSLL-test3.c is a demo program for the Mindsensors LineLeader Sensor. * * Changelog: * - 0.1: Initial release * - 0.2: Reworked to use new driver API * - 0.3: More comments<br> * Use clip() instead of manual clipping * - 0.4: Updated to use new array types that don't use structs\n * Removed common.h from includes * * Credits: * - Big thanks to Mindsensors for providing me with the hardware necessary to write and test this. * * License: You may use this code as you wish, provided you give credit where its due. * * THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 2.00 AND HIGHER. * Xander Soldaat (mightor_at_gmail.com) * 14 February 2011 * version 0.4 */

// This function draws the current values of the sensor and other data on the screen// in a visually pleasing waytask drawSensors() { while (keep_running == 1) { // This clears the entire area occupied by the small rectangles nxtEraseRect(6,62, 91, 43); for (int i = 0; i < 8; i++) { // Draw the rectangles for the signal strength first nxtDrawRect(6+(i*11),62, 14+(i*11), 50); nxtFillRect(6+(i*11),51+signalstr[i]/10, 14+(i*11), 50); // Draw a black rectangle if the sensor has detected the line, // a hollow one when nothing has been detected. if ((sensor >> i) & 1) { nxtFillRect(6+(i*11),48, 14+(i*11), 43); } else { nxtDrawRect(6+(i*11),48, 14+(i*11), 43); } } wait1Msec(100); }}

// When enter is pressed in the doMainMenu() we come here.// Here we handle the actual actions for each menu item.void doMenuItem(int activeOption) { PlaySound(soundBlip); while(bSoundActive) EndTimeSlice();

File comment: The LineLeader should be oriented with the plug facing the robot. The wheels should be the ones from the 8051 Motorcycle. The other sensors will be implemented later.Maze Solver.zip [22.74 KiB]
Downloaded 612 times

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

You did calibrate both black and white, right? You can do that with one of the other MSLL-test programs. I've never managed to make my line follower move any faster than about 60% or so but maybe I didn't try hard enough. There's nothing inherently wrong with the program as such, it really is a very simple program. To get those incredible speeds you're after, you're going to have to spend even more time getting the parameters just right. It's a very delicate balance between:

speed of the robot

tightness of the corners

wheel size

surface slipperiness

dust/dirt on your wheels

battery level

If any of these change even slightly when you're pushing the envelope, you'll find your robot flying out of the corner. If you've ever watched those micro-mouse videos of those tiny little robots flying through a maze, you'll see them furiously cleaning the wheels between runs and cleaning the track meticulously. This is not by accident.Perhaps there is something you can do to modify the algorithm a little.

I just want it to follow a straight line. Can anyone give me a idea of what values to start with?

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

It works decently with: P=16 I=0 and D=2. I also added something to the program. When it assigns the motor power, it multiplies the steering value by two, so that the effect is essentially the same as with 50% speed.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Could anyone tell me which part of the code is used to follow the line? I'm not really that experienced with RobotC yet, and can't really tell what I actually need to save.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum