Heather’s Status Update for 11/14
I worked very hard to get a smooth demo going earlier this week. All I did was finalize all the work that I did the week prior.
Regarding servos, I was able to get the expected range of motion through python and integrate the servo into the physical prototype. I then encountered problems when trying to integrate the software for the servos to the motor controller. Currently, I am controlling the servos by adjusting the frequency of the pca. For the servos, the frequency is at 50 and for the stepper motors, the frequency is at 1600. The issue I encountered when trying to implement the two together, is that there needs to be some delay between the frequency being set and the servo command going through. As a result, I didn’t have the servo running in the demo because I didn’t want it to mess up the stepper motor, which is the main component movement. My solution to try to fix this, is to see if I can get the duty cycle at 1600 to match what it is at 50. So I would have to hold the signal at high for a few whole cycles and then have it be a fraction for another. The only thing really slowing me down here is the math, but I think this is completely implementable. I think the best way to implement this would be to create a new function or a wrapper that would take the desired angle and split it up as needed into multiple settings.
I also got video transmission working by using hdmi and hdmi to usb converter. Based on the video transmission working for one camera, we’re now taking the next step to get two cameras working for video transmission as we had planned previously.
Lastly, regarding integration, I coded the motorController.py file to actually control motors properly given input. In my demo a couple weeks before, the motor control was happening directly within the CV code (speakerDetected.py), which worked for testing the setup then, but was not what we wanted for the final product. Now given an angle in the horizontal direction, the base motor will move. Given an angle in the vertical direction and the distance of the speaker, the distance the elevator motor needs to move is calculated using basic trigonometry. Currently, I have speaker distance calculated with rough estimations of what the pixel width and height of my face is at 1, 3, and 6 feet. The elevator motor also stops when the camera reaches the top of the elevator. I was trying to get this working in an earlier status update and the fix I needed to be able to find the number of steps between top and bottom was more voltage to the motor (now using 12 volts) and enable both coils to be activated on a step to provide more torque. With this setup, the number of steps between the top and bottom are now consistent. Upon shutdown, the elevator motor returns the cameras all the way to the bottom. My plan is once I get the servos working, I will update the code so when the camera is at the top or bottom, the servo will kick in to adjust to the given vertical angle.
After jumping over the video transmission hurdle I think I have a good amount of time to focus on getting everything working smoothly. My goal this weekend is to get the servo working or the base motor integrated into the physical product. By the end of the week, I want to have both completed and get the video transmission with two cameras finalized. The only risk I see right now that I’m not sure what to do about, is there is a lot of shaking of the camera as the motors move. I think I can mitigate this, but I am not sure how to completely fix it.