Skip to content

akaufman3/freenove-4wd-car

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

freenove-4wd-car

Experimenting implementing PID controller, Kalman Filter and Localization on a robotic hardware car kit.

Hardware Kits:

alt text

Project Objectives:

  1. Put together the Car kit.

    • Follow the tutorial provided with the hardware kit to put the Car together. alt text alt text
  2. Load libraries and run pre-built programs to experiment with sensors and actuators.

    • Practicing having the car move backwards and forwards
    • code
    • IMAGE ALT TEXT HERE
  3. Challenge 1: Sense the environment in some way (light, temperature, sound, water level in your plant, etc.) and respond somehow

    • Working through some of the pre-built progams I experimented with having the car be able to detect and object at a certain distance:
    • IMAGE ALT TEXT HERE
  4. Challenge 2: Affect the environment in some way of your choice (move an object, make a robot drive or fly in a controlled way, turn an appliance on/off, etc…) Note: The environment must be affected by a type of actuator that can be controlled by software.

    • Adapted boiler plate code to allow the car to detect objects at varying distances and adjust direction or rotate 180deg to attempt to move around the object
    • code
    • IMAGE ALT TEXT HERE
  5. Challenge 3 - AI – PID Controller

    • Implement a PID controller to keep the car at a certain target distance from an object, e.g., your hand. The car should speed up or slow down depending on the distance from the object.
    • I managed to get at least the forward movement working for PID implementation. It was pretty hard but a nice challenge. Getting the alpha error to correlate with a speed and tuning that so the car stopped nicely, accelerated smoothly is tricky. I would have liked to spend more time getting it to drive in reverse. I had to take the 5/4 stop/start out because my code wouldnt loop. At first I just tested for obstacle being too close to the car (car stopped) and far (car could drive forward).
    • Then I tried to do an out of range stop. So for this video you can see the car drives forward when the obstacle is within a certain threshold but stops if the obstacle is close or really far out of range.
      • alt text
      • IMAGE ALT TEXT HERE
  6. I also experimented with line tracking. There were some interesting lessons around the interferance of the color of flooring and the distinction between the black tape line and the floor. This can be seen in the below video:

  • IMAGE ALT TEXT HERE

Eventually I was successful in getting the car to track a loop albeit with some jittering reamining. This can be seen below:

There were additionally some interesting lessons around the following:

  • Not enough power defined in the code to move the car forward
  • Favoring driving left
  • Frequency of loop() being very high since I didn't have a delay which caused the car to move and sense at very high frequency, and if the sensor readings are changing the car will move very fast between turning and going straight which was causing the jerky movement
  • Impact of low batteries on oscillation
  • Working towards the objective of keeping the car moving with the black tape as close to the center as possible
  • Thinness of black tape line on readability of sensors
  • Medium sized lines also helped improve the mapping (half width of electrical tape)
  • Object distance detection and reversing the car as necessary

About

Experimenting implementing PID controller, Kalman Filter and Localization on a robotic hardwar car kit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors