After all of the modifications and fixes of the self driving RC car, Mr. Bahn introduced me into a much more efficient way of coding and programming for the car. It all came down into creating different “if” statements, because my statements were over lapped and the sensors were shooting data back to create two commands at once for the car, and it would cause the car to get stuck in between two commands. The solution to this problem of the car glitching out came down to starting fresh and drawing a chart out with 6 different regions that the sensors can see. With this sketch below it developed a much better understanding of what commands will be needed to have the car avoid obstacles to its possible best doing. The Sensors are related to each other in the if statements now as well, for example if the right sensor is reading the distance is closer than the left, the car will turn left. A delay in the void loop was needed to slow the reaction of the commands down a split second so the car could back up to the left or right rather than getting stuck in between two if statements. There has also been a new sensor mount out on the front of the car now, this will hopefully create a more consistent reading of the distance away from obstacles. The sensors readings are now pulled from an average of 5 readings now to prevent odd crazy numbers being thrown to the car to act upon, this is a program called smoothing under File>Examples>Analog>Smoothing. The motor driver is also powered from a heavier, but more reliable battery giving the motor driver 7.2 V to work with. I’m expecting the car to be avoiding obstacles very consistently by the end of the week.
The Arduino programmed self-driving car is finally capable of driving around in a figure 8! The car can only preform a figure 8 and is capable of avoiding collisions into anything in its path. I also programmed it to reverse and turn when something has stopped it, to overcome the obstacle and to continue the figure 8 command.
In the previous week of robotics my main goal was to add a new and improved motor driver that could handle more voltage. The H-Bridge couldn’t handle the rapid switching so this swap was very necessary for my project. The motor driver that installed now is a ” TB6612″ in case anyone was trying to find a solution to controlling motor speed, direction, and any other sequences of demands that you could create. Continue reading Improving The Motorized RC car with a Motor Driver→
Over the past week of robotics I created some additional hardware to the RC car. This would include a circuit to have the Motion sensor operating to turn the motor off when it comes within 30cm of any structure. This required a code having a regular void loop having an “if” statement. The next steps for the vehicle will be to apply the steering which will require creating more coding this week.
In this fantastic week of robotics I was introduced to the HC-SR04, which is a Range Finder that is going to be mounted on my RC car eventually. The HC-SR04 will be making decisions for my RC car whether to turn or stop to avoid collisions. I was impressed with the large distance the Range Finder was capable of reading up to. I finished the RC car figure 8 code, but i need to make some hardware adjustments with the H-Bridge. After review the RC cars H-Bridges relays were not the correct part for turning the switch on and off rapidly. I am looking forward to adding the HC-SR04 and adjusting the Relays in the H-Bridge next week to get the RC up and running to my commands.
In the previous week of Dover Robotics my goal was to create a code on the Arduino Program to control the direction of rotation of a electric motor. The purpose of this creation was to develop a understanding of how an H-Bridge circuit works. I plan on taking this circuit and coding to a higher step this week and applying it to a RC car. My goal this week is to complete as much of the hardware aspect of the car and to complete the coding on Arduino to get it to run how I want, and possibly begin developing a steering mechanism system.
This week of DAHS Robotics my objective was to create a traffic light with similar hardware of the spaceship interface I previously built. There were many conflicts that arose when attempting to program the traffic light to run its cycle and transition to the crosswalk cycle, and then return to the main cycle. The solution to this conflict was to start fresh and create a series of “if statements” (Command on the Arduino Program), that would cause a counting effect which then allowed the different lights to come on during the count; equations of certain values controlled when the lights came on and off. If the count detected the button being pressed then it would atomically cause the red light to come on, then the cycle would restart; this is how the crosswalk was created. It’s been a progressive week of robotics once again, I have learned new coding skills and strategies to apply to future robotic projects, including a “for loop” that adds numbers, a serial code that allowed the Arduino board to communicate with the computer, and even creating my own functions.
In this first week of robotics I was introduced to creating codes to have the Arduino control and have my circuits function a certain way. I constructed a Spaceship Interface out of the “ Arduino Projects Book ” which gave me a review of my previous electronics course, and which also enabled me to type up my first code to the Arduino. The most interesting project out of this week was converting my Spaceship Interface Circuit into a traffic light just from changing the code to the Adruino. I am just picking up the basics and fundamentals of programming, but am challenging myself to now add a crosswalk into my traffic light. Creating this crosswalk into my circuit will require a button to trigger the crosswalk to run its cycle. I will be brainstorming and learning new strategies this week to create a effective code to have the crosswalk correct In my circuit.