Problem rotating dowel using two servos for DIY Solar Tracker

hi all,

First post here so apologies if it's a bit all over the place.

Recently I have been working on a project creating a dual-axis solar tracker. I am currently testing the basic rotation mechanisms before testing the solar tracking aspect.

It rotates with a servo (Servo 1) mounted in a turntable for left-right rotation, which works fine. This connects to a crossbar with two upright supports on either end (25mm thick), which have a 30mm diameter oak dowel running between them (~380mm inside length) with two servos mounted one on each end for 'up-down' rotation. One servo is the same as above and the other is here.

I am having difficulty getting them both to rotate the dowel in the same direction at the same time. As they are mounted on opposite ends, they face the opposite direction. Otherwise, they try to work against each other and don't rotate.

The dowel is mounted with a ball bearing on each end, and there is a 10W solar panel connected by two clips to the dowel. I am using a 9v battery to power the servos, with the same for the Arduino Uno R3 board.

My current code is listed below:

#include <Servo.h>

Servo servox;
Servo servox1;

int pos = 0;

void setup() {

  servox.attach(10);
  servox1.attach(9);

}

void loop() {

  for (pos = 0; pos <=150; pos +=1){

    servox.write(pos);             
    servox1.write(pos - 150);

    delay(15);
  }

  for (pos = 150; pos >=0; pos -=1);

  servox.write(pos);
  servox1.write(pos - 150);

  delay (15);

}

I am more than happy to provide any more information you may need and to clarify anything further.

Thanks a lot :slight_smile:

I have a dowel mounted between two upright supports with a bearing on each end. A servo is mounted to each end and I would like to have them both rotate the dowle at the same time but I'm unsure how to do it.

I need two servos because there will be a mounting on the dowel and one servo isn't powerful enough to rotate without slipping.

I am using an Arduino Uno R3. I have 9v batteries for power.

If any more information is needed, I can provide it.

Any help is really appreciated. Thanks.

I am using a 9v battery to power the servos

You mean like a PP3?

Ditch it, and substitute four AAs.

yeah, I am currently using a PP3. I am very new to electronics, so I apologize for my lack of knowledge here. How would I go about connecting them up together at home?

Do you think it is a power issue then? Or should I provide more information?

Thanks for your reply :slight_smile:

Neither of your servos are intended to work on 9V. So why 9V batteries? And exactly what 9V batteries are you using? If you mean little rectangular PP3 then they cannot provide enough power for servos, particularly large powerful ones.

And write(pos-150) makes no sense, servo.write() takes values from 0 to 180. You're trying to give it negative values like -150. Something like write(150-pos) might make more sense. Even then it is very unlikely that two servos of different make and type will actually make accurately coordinated movements. Hobby servos are simply not that precise. You really need a better mechanical design but you might have a slightly better chance of it working with two similar servos.

Steve

You should not have two independent devices that are mechanicaly linked

Run two motors from only one sensor

Thanks, Steve,

I originally had both of the servos as the same type (servo). But tried replacing one with a stronger servo linked above and operating by itself, however, although it would turn the panel I mounted to the dowel from horizontal to vertical, it would slip (stall?) on the way down, so I assumed this implied it doesn't have enough torque?

However, I am unsure of how to diagnose such issues.

The model is already constructed, could you suggest any adjustments to make? I'm pretty stumped on this one.

You should not have two independent devices that are mechanicaly linked

Run two motors from only one sensor

Hi, can you explain this a little more to me, please? Both servos are running from the same Arduino board, sharing the power supply

*the supply coming from what is currently a PP3 9V battery

Thanks

Get a proper power supply for the servos. As mentioned above, the PP3 batteries will not supply enough current for the servos. Less current means less torque. Maybe, if the servos get the current that they need they will have enough torque. PP3 batteries will run down quickly, too.

Thanks, what type of thing should I be looking for? I have 4 AAs but I am unsure how/if I should connect them together?

I will also be powering one other servo on the model, but this can be independently powered if need be.

I have 4 AAs but I am unsure how/if I should connect them together?

In series, to give ~ 6V.

A battery holder is an easy way to do it. Amazon knows them by that name although of course there are a gazzilion vendors that carry them.

For that large servo NiMH rechargeable AAs would work better than alkaline AAs. They can generally provide higher currrents.

Steve

Thanks all for the solution. It works now :smiley: