Hi
I bought a pan/tilt kit from nodna.de, with 2 micro servos...
I hooked them up to my Fez Panda II's PWM and 5V power, then made a simple program to move them from all the way left to right.
But when i run it, it moves really fast to one side, then it struggles to move the other way, nearly dont move...?
Same problem with both of them... sounds like they dont have the power to turn... ?
Could there be somthing im doing wrong? or are they just simply defect?
UPDATE:
Here is the code im using:
https://www.dropbox.com/sh/ia9v9qno5z1gudz/e1SCJvrwkh
And here is a video of it running:
http://www.youtube.com/watch?v=c8U4tGGy6nQ
Tried taking apart the servo, and removing all gearing. so only the motor was rotating...
And exact samme result, fast one way, slow the other... so it aint the weight...
If both servos are acting
If both servos are acting the same, I would lean towards you doing something wrong. Do you have a third servo (that you are sure does work) to test with your setup? Most servos use PPM not PWM, but as Max said, more info and some code would be a great help in getting help
What a servos PPM pulse train should look like:
http://www.youtube.com/watch?v=YMwp3g4q2M4
Another quick option along the lines of what JerZ suggests.
If you have a spare 555 timer, there are a number of schematics to allow said timer and a few extra parts to drive a servo in both directions. It would let you test your servos.
Broken link.
The link to the code is broken.
New findings…
Just tried taking apart the gearing. so only the motor was running. And same result. Really fast rotation when moving one direction, and really slow the other way…
Double
Double
This one should work. tested
This one should work. tested both from my phone and laptop:
First of you should not run
First of you should not run the servos form the 5V supply from your board. At least not if your taking all your power from the USB. Better to have an external power source for the servos.
The other thing that you should look at is the servo pulse that you are generating.
servo.SetPulse(20000000, (uint)((angle - MinAngle) * (MaxUs - MinUs) / (MaxAngle - MinAngle) + MinUs) * 1000);
Put a breakpoint in your code and see what you are actually sending the servo.
Sorry for my slow answer,
Sorry for my slow answer, been very busy, so havent had time to work on the project.
I First tried 4xAA batteries in serial for 6.5v, and then only signal from the panda…
With that setup, nothing happen at all… (only the second the power is plugged in the servo zeros itself)…
Then i tried with USB + 9V battery connected to the panda. and servo’s drawing power from 5V pin…
And i still get the problem with it having problem with slow one way…
I checked what the SetPulse outputted on 2 different ocassions:
When trying to move to 90 degrees = SetPulse(20000000, 2000000)
When trying to move to -90 degrees = SetPulse(20000000, 1000000)
Have you tried the example
Have you tried the example from the Beginners Guide?
I think your numbers are wrong.
using System;
using System.Threading;
using Microsoft.SPOT;
using GHIElectronics.NETMF.Hardware;
using GHIElectronics.NETMF.FEZ;
class Program
{
public static void Main()
{
PWM servo = new PWM((PWM.Pin)FEZ_Pin.PWM.Di5);
while (true)
{
// 0 degrees. 20ms period and 1.25ms high pulse
servo.SetPulse(20 * 1000 * 1000, 1250 * 1000);
Thread.Sleep(1000);//wait for a second
// 90 degrees. 20ms period and 1.50ms high pulse
servo.SetPulse(20 * 1000 * 1000, 1500 * 1000);
Thread.Sleep(1000);//wait for a second
// 180 degrees. 20ms period and 1.75ms high pulse
servo.SetPulse(20 * 1000 * 1000, 1750 * 1000);
Thread.Sleep(1000);//wait for a second
}
Thread.Sleep(-1);
}
}
Just tried that one. Same
Just tried that one.
Same result, more or less… moves fast to first position (not 0 degress).
Then crawls for the other 2 (less than 90 and 180). and repeats.
But i think you might be right about, that it has to do with the timings being wrong maybe…
Just have no idea on how to find the right ones
Have you asked on the GHI
Have you asked on the GHI forum, they are way better on FEZ issues than LMR
https://www.ghielectronics.com/forum