RE: ServoCape and Testing the Servo Headers

cool. we can read along when you hit a question.

just a tip on diagnostics with PWM. Ignore servos for a while, because unless you have a servo connected you’re not going to know if your code works, so just use the DMM to get working code, then move to servos. So get the DMM ready, and prove you can measure 5v power on a header somewhere, then connect it to the PWM signal on a socket. In your code, you can set up a loop that runs constantly and toggles between 0%, 50% and 100% duty cycle on any PWM frequency you want, and changes step every say 4 seconds. That way you should see on your DMM a point when there’s 0 volts, some point when it is showing a voltage of 2.5v (roughly 50% pulse width, averaged out), and a period that it should show 5v, then it should go back to 0v as the looping continues.

Hi Seth,

I am working with the same PWM device on a Jetson Nano and I used the following video to get it working. As you are likely running Linux on your BeagleBone then this video might just be a good starting point for you. It is almost 1 hour long but he takes you through the whole process on how to install the drivers on your machine and then shows you code to control the servo’s. This is part of a series of videos on using the Jetson Nano for facial recognition but this one is aimed at setting up the servos. You can ignore the Jetson Nano wiring part as your cape comes pre-wired. Skip to the code bit. :slight_smile:

Good luck.

Hello @Brett,

Okay. I will read over the datasheet more and get back w/ you. I know you are not going to do the work for me. Thank you for replying.

Hello @Dave_McLaughlin,

Thank you again. I know you do not need to help but I am glad you did. I will review the datasheet more and the lesson from this fellow on the video.

Seth

@Dave_McLaughlin,

Hello…I thought for some reason the adafruit_servokit would work on the BBB. It does not. I am sure there are many reasons why, now, it does not work but I watched over the video.

That fellow usually makes good videos. I remember his BBB videos back in the day. I got a GPS working a long time ago w/ one of his videos.

Seth

Is the I2C bus available in user space?

What error do you get when using the library?

Hello,

I am not completely sold that my bus is available. I used config-pin on the i2c-2 bus and it told me in reply on the console that it was already configured as i2c. Then, I tried w/ sudo i2cdetect -y -r 2 and nothing was returned on the detection. So, it is difficult to say right now.

The error was Value Error: No i2c device at address: 40.

Seth

P.S. There was a bunch of errors but that was the end result of the error(s). I will try to run the command again tomorrow to get you a better idea of what I am dealing w/ on my end, i.e. what exactly these errors are saying.

Double check you have the I2C connections connected the correct way around.

I found loads of hits on Google for using the BBB with the PCA9685 under Linux.

@Dave_McLaughlin,

Hello…I looked through some older ideas already but they are just that, they are older ideas. I know the premise is still the same and it is the same chip (PCA9685).

I will keep up w/ what I have so far and add to it in time.

@Brett,

Hello…I will attempt to learn more in time w/ the datasheet. If and when I have some exact hits on questions, I will attempt to relay one or two at a time to you in case you are still available for questioning.

Seth

P.S. Thank you, guys. I appreciate the time and effort.

Seth, I am no expert on linux nor on capes, but why do you say they are just older ideas? Surely they can help articulate what you need to do to get a working system - and they may not be “exact recipes” telling you what version of what you need to install, but they should give you the information you need to get the fundamentals working (or ask questions about what a newer alternative or newer version may need). Perhaps that’s again just a misunderstanding of what you mean, but to discount those things would seem premature?

Yes Sir,

You are right. See, the premature part would be me jumping in on this Cape w/out any prior knowledge on the PCA9685. I am definitely not an expert on the PCA9685 so far but this might change b/c of this Cape.

See, I really enjoy the Capes you all produced and mfg. in the USA. I have been able attend Maker Faires w/ one of the Capes produced by GHI, i.e. the MotorCape. W/ the help of a person on Freenode #beagle, I was able to better work my Cape and BBBW to promote some other findings I was learning about at that point.

Anyway, it seems like I am starting over w/out thinking of how long it actually took me to understand the workings of the Cape, the MotorCape, how to program it, and how to debug the errors I received.

Seth

P.S. I have had this Cape for only a short period but I feel as though I am learning slowly more than just how to promote the findings of the PCA9685 from the datasheet. I feel as though I am learning how to interpret the datasheet to think in a computational way. This is outside of trying to make things work. So, even though it may seem like I am complaining at times or lazy, I am taking in a lot right now w/ all my projects and Capes. I found recently a BELA Cape too. This does not have anything to do w/ GHI but it is also a neat Cape for the BBB and like boards. @Brett, thank you for replying. It is nice to know some people still reply. Oh and about the last idea…some people have put in over three entire libraries or more to make things work “out-of-the-box” w/ the PCA9685 and the BBB. It will just take time on my end.

Hello,

Hey guys. I came across this fellow that knows more than me in the PCA9685 dept.

https://lorforlinux.github.io/GSoC2020_BeagleBoard.org/2020/06/20/testing-servo-cape-on-BBBW/

This fellow is working with GSOC 2020 with BeagleBoard.org.

Oh and my ServoCape from Mouser.com was a dud. My INPUT pins on the ServoCape were not populated.

Seth

P.S. So, if you guys or anyone else need support for their ServoCape, try that link.

Hello,

Here is the new link to the GSOC fellow and the ServoCape: https://lorforlinux.github.io/GSoC2020_BeagleBoard.org/2020/06/20/testing-servo-cape-on-BBBWL/.

Seth