Due to the challenges we encountered during the first phase of our project, our team was very limited in time and resources during the second phase of our project. However, we were able to complete a template for the circuitry required for controlling a drill motor via the Makerboard. We did not have a drill motor and battery to present this circuitry with. We instead used a small DC motor and 9V battery to represent the drill motor and drill battery, respectively.
The primary difference between the Phase 1 and Phase 2 circuitry is the need of an external power source to control the drill motor. In Phase 1 of the project, we simply used power from the Makerboard in order to power the L298n as well as the DC motor. In Phase 2 of the project we used power from the 9V battery in order to power the L298n as well as the DC motor.
Replacing this 9V battery and DC motor with the drill battery and drill motor would allow us to effectively control the drill motor in the same manner.
Another difference between Phase 1 and Phase 2 circuitry was the usage of the ENA pin on the L298n to programmatically control the motor's speed via PWM on Makerboard pin 15.
Template circuitry to control a drill motor via the Makerboard and L298n Motor Controller.
Designed and 3d printed back plates for the Makerboard (x2), 9V battery, L298n motor controller and DC motor. Designed and 3d printed face plate for the Makerboard (x2).
Designed 3d printed cylinders to represent mats and blocks for these cylinders to rest on for integration with our Phase 1 Model. Was not able to integrate these pieces into our Phase 1 Model.
Wrote a demo Arduino program that accelerates the DC motor in the forwards direction, decelerates it to a stop, accelerates it in the backwards direction then decelerates it to a stop.
The main challenge faced during this portion of the project was setting up the circuitry for the Makerboard. The documentation I referenced for the L298n motor controller all utilized an Arduino. Cross referencing between this documentation and lecture slides in order to find which pins on the Makerboard were suitable for this purpose proposed some degree of difficulty.
Several of my 3D prints failed due to an attempt to use a green filament which was weaker than generic PLA. This caused a cylinder as well as one Makerboard back plate to collapse during printing.
One possible challenge that I was not able to completely address is the 2 amp limit on each output channel of the L298n motor controller. My research indicated that drill motors typically draw around 5 amps. Supplying only 2 amps could result in reduced motor lifespan or under performance. We were not able to test for this due to our restrictions on time and lack of a drill to test with. However, connecting the 2 output channels of the L298n in parallel will allow the motor controller to output up to 4 amps. This should be sufficient to power the intended drill motor. However, further testing is certainly needed.
The complete phase 2 circuitry and setup with 3d printed back-plating as of the presentation day.
Testing the circuitry and code.
Testing whether the DC motor programmatically rotates in both directions and changes speeds.
3d printing the Makerboard back plate.
L298n Wiring.
Labeled L298n wiring. AD denotes the proper pin to connect to on an Arduino Uno. MB denotes the proper pin to connect to on the Makerboard.
Failed cylinder print. The weaker green filament collapsed during the print.
Successful cylinder print. The stronger white filament was able to print the cylinder with the inclusion of supports.
Storage blocks for 3d cylinders, representing wrestling mats.
#define LOW 0
#define HIGH 1
void setup() {
pinMode(4, OUTPUT);
pinMode(13, OUTPUT);
pinMode(15, OUTPUT);
}
void loop() {
// Setup drill motor in the forward direction.
digitalWrite(4, HIGH);
digitalWrite(13, LOW);
// Accelerate
for(int i = 100; i < 200; i++){
analogWrite(15, i);
delay(50);
}
// Decelerate
for(int i = 200; i >= 0; i--){
analogWrite(15, i);
delay(50);
}
// Setup drill motor to stop.
digitalWrite(4, LOW);
digitalWrite(13, LOW);
// Wait 1 Seconds
delay(1000);
// Setup drill motor in the reverse direction.
digitalWrite(4, LOW);
digitalWrite(13, HIGH);
// Accelerate
for(int i = 100; i < 200; i++){
analogWrite(15, i);
delay(50);
}
// Decelerate
for(int i = 200; i >= 0; i--){
analogWrite(15, i);
delay(50);
}
// Wait 8 seconds
delay(2000);
}