evildmp / BrachioGraph

BrachioGraph is an ultra-cheap (total cost of materials: €14) plotter that can be built with minimal skills.
https://www.brachiograph.art
MIT License
680 stars 114 forks source link

Using adafruit_servokit #70

Closed spalfs closed 4 years ago

spalfs commented 4 years ago

Hi,

I forked the project here to try out different hardware than what is within the documentation.

The main difference is that I am using the SG-5010's instead with the adafruit 16 channel bonnet.

So I removed all the pws logic and went directly from generating the angles to calling the library to drive them.

First problem was it was generating angles as low as -120 for servo 0, and the library will throw an exception if you give it anything outside of 0 - 180, so I added an offset to every call to that first servo. (which I believe messes up the rest calculation?)

After some fiddling with offsets and physical starting positions, I still wasn't able to get it to draw a straight line using .draw_xy() / .box()

So if anyone could give me a heads up of what would be a good idea for starting orientation angles physically and in the code that would be sweet.

I would be happy to post the results of these hardware changes.

Thanks, Tom

spalfs commented 4 years ago

I had found some source code for a way for pigpio to interface with the PCA9685 yesterday, and was able to just do the normal pulse_width calls with some minor editing, this looks like a much better solution. the branch can be found here if anyone wants to use a similar hardware setup.