This week, the group spent a lot of time together outside of the time that was individually spent on the project. The goal for the week was to get the project assembles completely in order to start testing/troubleshooting with the components all together.
Seen in the image below is the connections that were made for the voltage regulator and the motor drivers. 12V from the battery supply is being connected to the input of the Buck Converter and 5V is coming out which is then connected directly to the motor driver.
![](https://static.wixstatic.com/media/cfd036_4c10b72b4494478b88ea0b3d1e5f3c2f~mv2.jpg/v1/fill/w_980,h_861,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/cfd036_4c10b72b4494478b88ea0b3d1e5f3c2f~mv2.jpg)
Now that the motor driver is in use, the Arduino code had to be changed to accommodate for the new libraries needed to create the connection to the PCA9685. The motor driver communicates to the arduino using I2C communication, this essentially means that two wires can be used to control multiple peripherals. These two wires are the SDA (data) and SCL (clock) which are connected to the Arduino Mega's SDA and SCL pins.
![](https://static.wixstatic.com/media/cfd036_aa2edd34151446c58c52fb170ca3f21a~mv2.jpg/v1/fill/w_980,h_1031,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/cfd036_aa2edd34151446c58c52fb170ca3f21a~mv2.jpg)
For a comparison on the changes that had to be made on the Arduino code, below we have piece of the old code which shows each finger being connected to a specific pin on the arduino. Now that the PCA9685 is in use, the fingers, wrist, and two elbow motors are assigned to specific channels on the motor driver, which comes with 16 channels.
![](https://static.wixstatic.com/media/cfd036_759ac986b62b4511917b068aa6edcf4c~mv2.png/v1/fill/w_548,h_362,al_c,q_85,enc_auto/cfd036_759ac986b62b4511917b068aa6edcf4c~mv2.png)
Below is piece of the new code that was put together using the different channels for the motors. Also note that the libraries being used are Wire and the Adafruit_PWMServoDriver libraries instead of the servo library. After finally being able to convert the previous working code to a new script that will work with the motor driver, we were able to get the fingers moving as they were before.
![](https://static.wixstatic.com/media/cfd036_23c17be9374b425ba7f7ae22ba267f04~mv2.png/v1/fill/w_670,h_257,al_c,q_85,enc_auto/cfd036_23c17be9374b425ba7f7ae22ba267f04~mv2.png)
Once the fingers were moving as expected, Bibi continued to work on getting the elbow and wrist to move. When trying to test all of it together, none of the motors were moving. The charge of the battery was checked and it barely lost any charge, the voltage coming out the DC-DC converter was measured at 5V, so that was not the issue. The code did not change so we did not think that was the problem. We decided to swap out the motor driver with the 2nd one from the pack of 2 that was bought, after switching out the motor driver, the motors were moving again as expected. We weren't able to figure out exactly why the motors weren't moving with the other motor driver, but after swapping it, the arm was moving, proving that the code was not the problem.
Along with changing/updating the code, we also started to put the arm on the base for complete testing. Below is an image of the opening of the bottom of the arm, the cover piece that is supposed to cover it did not have the right alignment of screw holes so it was able to be attached. The holes will either have to be drilled into another part of the piece or a redesign will need to be done to get the hole in the right places.
![](https://static.wixstatic.com/media/cfd036_f37e03d6a2cc4d96b180231ebbfeb18c~mv2.jpg/v1/fill/w_980,h_1134,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/cfd036_f37e03d6a2cc4d96b180231ebbfeb18c~mv2.jpg)
This is the piece that needs to be altered to be able to cover the arm opening.
![](https://static.wixstatic.com/media/cfd036_1ec1d7b2cc2b4cd08e687fe25bf67c3a~mv2.jpg/v1/fill/w_980,h_959,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/cfd036_1ec1d7b2cc2b4cd08e687fe25bf67c3a~mv2.jpg)
We were able to get movement in the fingers, wrist, and elbow. Below is a video of the finger and wrist movements.
コメント