Hello all. I've been tasked with developing a line following car project for our school using an RC car chassis that has a steering servo to turn the two linked front wheels and a drive motor in the rear to propel the car. I have a MEGA, a L298N motor controller, and a 8 sensor line following module at the front.
I'm super new to programming and the kids that are on the 'team' have next to zero background. I know I need to use a PID loop for efficiency and accuracy. All of the examples of a line following PID routine I've been able to find seem to rely on independent servo's to steer instead of a single servo in the front like a traditional car.
Any help on getting this project off the ground would be so helpful.
I would leave PID for later. With an eight sensor module, you should be able to come up with something simple: if either of the middle sensors are lit, go straight. if any of the left sensors are lit, steer left and the same for the right side.
That should work for a simple course. Next you could turn more sharply for the outer sensors. After that you can decide whether PID would improve matters.
Given your lack of experience and that of your students, I further suggest that you start with even simpler stuff. Devise a series of challenges to do minimal stuff with the robot. Frankly, it's what I would do anyway to prove to myself that my code controls the robot.
- Run the motor so the robot moves
- Center the steering and drive the robot straight
- Drive the robot forward for ten seconds
- Drive the robot forward for ten seconds without using delay
- Steer right and left
- Drive in a circle
- Drive in a figure eight
- etc.
So there are lots of things to achieve before even worrying about the sensors, which will hopefully provide some small victories along with acquiring coding skills.
danbourdeau:
I'm super new to programming and the kids that are on the 'team' have next to zero background.
Your project type is super old, find much input searching the forum for Line Follower.
What kind of school is this that doesn't teach programming first and then gives projects like this?
I'm super new to programming and the kids that are on the 'team' have next to zero background.
With totally unrealistic expectations!
This is a recipe for a disaster, so I suggest to either hire someone (or find a volunteer) who does understand programming, and has some experience with robotics, or dramatically lower your expectations.