Unfortunately i haven't made much progress with the pepper bot this week.
I've started thinking about how I'm going to tackle the robot arm. I've managed to organise a 3D printer to borrow (which i will be grabbing during the coming week) but its quite a small printer, the print bed is 150mm x 150mm. With the size restriction in mind i had a look through the robot arm designs on thingiverse. I found this one one which looks quite good but ill have to modify the design to fit different motors as i want to use servos rather than the stepper motors used in the design.
I started looking at writing control software for the arm. The first step for this was running a servo off the pi. I had a servo sitting around in set of supplies i borrowed off of a friend, its a TowerPro SG90 . A very small servo but a good chance to get my hands dirty. I didn't have the original datasheet for it so i dug one out off the internet, though it turns out the one i dug out was incorrect. The one i found listed a 20ms cycle and pulse widths of 1ms for 0 degrees and 2ms for 180 degrees. After playing with the motor i found that the pulse width range was actually 0.5ms - 2.5ms.
I decided at this point that i should actually get a bit more familiar with python syntax so i wrote a small class for controlling the servo. The code can be found here. Controling the servo using this class consisted of the following code (this is using BCM pin 17)
import motor
m = motor.create(17)
m.start()
m.moveTo(60)
This moves the servo to 60 degrees past the centre point, negative angles are used for the opposite direction.
With the servo control out of the way i started planning moving the robot arm. I want to control it via (x,y,z) coordinates so i did some furious scribbling on paper and came up with the following
The following diagram is a side view of the arm with L1 and L2 as the lengths of arm segments.
This next diagram is an overhead view of the arm with D being the distance the arm is extended from the centre point.
And the math:
I wrote a quick script which does this calculation for a desired x,y,z coordinate (as usual its on my github).
Hopefully my progress in the coming weeks is a little more exciting.
Top Comments