First time with servos not going well

Discussion related to "under the hood" OpenMV topics.
ScottM
Posts: 85
Joined: Thu May 30, 2019 2:12 pm
Location: Ottawa, Canada

First time with servos not going well

Postby ScottM » Tue Jul 16, 2019 3:33 pm

I am trying to get two servos to work with the pan/tilt shield, but so far it isn't working. I am brand new to Micropython, so it might be a learning issue. Here is what I did.

I connected a 5.2Vdc power supply to the servo bat pins and confirmed that it carries through to the Vin and GND pins.
I connected two HS-5485HB digital standard servos.
I connected the shield to the OpenMV camera and made sure to test it first by running the helloworld example. The camera works fine
From the examples, I opened pca9685.py and under Tools/Save open script to OpenMV cam. It asks if I want to strip comments and convert spaces to tabs, so I say Yes
I then open servo.py and do the same thing
I then select Tools, Reset OpenMV Cam
I then open main.py and hit the green arrow to run it.

I get an error "OSError:[Error 110] ETIMEDOUT

Nothing happens. I was expecting the servos to move. What do I do to get this working?

Scott
Attachments
20190716_152907.jpg
20190716_152815.jpg
20190716_152839.jpg
ScottM
Posts: 85
Joined: Thu May 30, 2019 2:12 pm
Location: Ottawa, Canada

Re: First time with servos not going well

Postby ScottM » Tue Jul 16, 2019 3:46 pm

I tried again with one of those tiny pan/tilt kits, but I get the same error.
Attachments
20190716_154510.jpg
User avatar
kwagyeman
Posts: 3805
Joined: Sun May 24, 2015 2:10 pm

Re: First time with servos not going well

Postby kwagyeman » Tue Jul 16, 2019 11:28 pm

Hi Scott, the drive you are trying to use is for controlling the 8-channel servo shield. You have the Pan/Tilt shield. For this shield no driver chip is necessary. The servos are directly controlled by the OpenMV Cam. Please see the Board Control -> Servo example for how to drive servos directly from the H7 main chip using it's PWM output.
Nyamekye,
ScottM
Posts: 85
Joined: Thu May 30, 2019 2:12 pm
Location: Ottawa, Canada

Re: First time with servos not going well

Postby ScottM » Wed Jul 17, 2019 8:58 am

Thanks Nyamekye,

That sample works perfectly and is a lot simpler. Perhaps you can update the comments in the other sample to make it clearer to users which code works for the servo shield vs the pan/tilt shield. On to my next learning challenge. This is fun.

Scott
User avatar
kwagyeman
Posts: 3805
Joined: Sun May 24, 2015 2:10 pm

Re: First time with servos not going well

Postby kwagyeman » Wed Jul 17, 2019 1:47 pm

I can probably comment on this on the product page.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests