In the Practice of Engineering class, students were asked to construct a propeller-driven autonomous car as a group with five members. A cross-group collaboration was also required in the second half of the course.
With a 3D-printed propeller (blade) controlled by a BLDC motor, this car could travel at a constant speed between 10cm/s to 80cm/s with the help of our own PID control program based on Arduino Mega. The car could cruise autonomously along the tack designated by a black tape, which was facilitated by seven IR sensors at the front of the car.
In this project, I was mainly in charge of the design and testing of the propeller, the motor control, PID control, steering, line-following algorithm, and the ultrasonic sensor. I was also responsible for the coding of the integrated system.
As required by the rule, the propeller had to be designed and manufactured by ourselves. To start off, I referenced the Airfoil Tools website to decide the appropriate shape and sizes for our blade. The process begins with calculating the angle of attack of our blade and the cruising speed of the car, which could infer the Reynolds number that we had to deal with. I then went to the website to look for a suitable airfoil design, downloaded the DAT file from the website, and use the data to build the 3D model of the propeller.
1. The Propeller
Using the data available on the airfoil website, I decided to opt for NACA 22112 airfoil for the adaptability to touch propeller surface and the delay of stalling under low rotational speed. From the Reynolds number calculated with the assumptions for the chord length and motor operation speed, the relationship between the angle of attack and CL/Cd (lift coefficient and drag coefficient, respectively) can be plotted out. The plot provided a clear guideline for us to design the optimal angle of attack.
With the help of this airfoil analysis software, we were able to determine the best angle of attack knowing the motor rotational speed for our car.
A short story
At first, I was not responsible for the propeller design, instead, I simply agreed to do the wind tunnel testing with one of our blades in the middle of the semester.
However, something tragic happened the day before the testing: someone broke our only propeller at that time while handling it! I could not delay the wind tunnel reservation, and therefore I had to design my own propeller and 3D print it in just one night.
Definitely one of the longest nights (or shortest for how much time I wished I had) in my life.
To calculate the thrust we could get from our propeller driven by the motor, a test in the wind tunnel provided much-needed information. Single-handedly panned out the experiments, I set the background wind speed of the wind tunnel and put our half-finished car in. Several motor speed was tested so that we could examine how fast the propeller has to turn in order to generate enough forward thrust to accelerate.
wind tunnel testing
In the wind tunnel, I connected two batteries in series to reach a voltage of 8.4V, and the motor rotational speed could be controlled by varying the duty cycle of the PWM signal. However, the slapdashed propeller could not handle anything above 44% duty cycle, and that is the upper limit of my testing.
The first step was to determine the background windspeed in the wind tunnel. Using a velocity meter, I measured five points with the same height as the center of the fan. Next, I recorded the distance between the center of the motor axis to the floor of the wind tunnel. Next, by carefully arranging the smoke tube, I was able to visually determine where the streamline that passed the top of the fan came from. I then measured the distance between the center of the fan and the marked smoke tube. At the downstream of the fan, I traced the faint smoke line to get the radius of the downstream disk. The same procedures were repeated several times, and each time I varied the duty cycle slightly to achieve different rotational speeds for the blade.
According to the Actuator Disk Theory, I was able to calculate the thrust provided by the fan, and the data could be used to examine the blade design and the projected acceleration for our car.
To simplify the structure, we decided to use a simple gear and servo motor with the design of a single front wheel. The gears were designed initially to have a ratio of 1:1, but after some testing, it was clear that a gear ratio of 1:1.5 was needed in order to provide nuance to the steering control with our servo motor.
The car had to follow a black line designated by black tapes, and it should run autonomously and no human intervention was allowed. This meant that I had to combine the perception of the car with some turning algorithms.
There is a very specific distance range where the sensors could function properly. The code for the line following was fairly simple: when a sensor detected the black line, the car has to turn a small angle in order to get back on the line. The outside sensors' signals would trigger the car to turn more drastically.
How to know the speed of the car?
I designed a rotary grating that has 20 teeth, and with a photo-interrupter sensor, the speed of the car could be indirectly calculated by knowing the diameter of the wheels. Initially, I used the interrupt function of an Arduino Mega board, but it quickly transpired that the sensor could not pick up the correct number of teeth.
A short story
This problem haunted us to the morning of the midterm testing when we still could not figure out what went wrong. As the testing approached, we were growing hopeless and ready to accept an utter failure.
But I refused to give up and continue tweaking the code here and there, trying to identify the problem, until a miracle happened: I discovered that because we used two interrupts at once, they would interfere with each other and cause the counting to be messed up. Scrambling to revise the code, I could only pray that the change could work as we were running out of time.
Luckily, the car did perform and we managed to finish the race with a decent score.
PID speed control