Servo a0090

Does anybody have experience with the servo a0090?

I tried many source samples found on the forum.
sometimes the servo moves position.
but still can’t understand.

maybe I’ve to change the pulse frequency and not the highTime?

Hi Berrie can you supply some more info - ie what board you are using and the code you are using to move the servo

I have the Hydra board.

start with
uint hightime = 100000;

initialized the pwm:
servo = this.extender.SetupPWMOutput(GT.Socket.Pin.Seven);//must be pin 7,8,9
servo.Active = true;

and then:

void joystick_JoystickPressed(Joystick sender, Joystick.JoystickState state)
{
//servo.SetPulse(20 * 1000 * 1000, hightime);
servo.SetPulse(20 * 1000 * 1000, hightime);
Debug.Print("High Time= " + hightime.ToString());

            hightime += 5000;
    }

but tried also other samples found on the forum.
without result.

the A0090 is used in a pan tilt, so I expect that many people using it.

Hi Berrie, and welcome !

I think it’s probably a good idea if you check out the wiki on Servos, GHI Electronics – Where Hardware Meets Software

It does a great job of explaining what you need to change to make a servo change position. You could simply use the same construct within your joystick pressed function (set it at one point, sleep, set it at a different point, sleep, set it to centre).

@ Berrie - This works for me on a CerbBee on Socket 1


using System.Threading;
using Microsoft.SPOT.Hardware;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;

namespace GadgeteerApp1
{
    public partial class Program
    {
        private static Microsoft.SPOT.Hardware.PWM _servo;
        private readonly GT.Timer _servoTimer = new GT.Timer(5000);
        const uint MaxClockwise = 500;
        const uint MaxCounterClockwise = 2500;

        void ProgramStarted()
        {
            _servo = new Microsoft.SPOT.Hardware.PWM(GT.Socket.GetSocket(1, true, null, "").PWM8, 20000, 1500, PWM.ScaleFactor.Microseconds, false);
            _servo.Start();
            
            _servoTimer.Tick += new GT.Timer.TickEventHandler(TimerTick);
            _servoTimer.Start();
        }

        void TimerTick(GT.Timer timer)
        {
            _servo.Duration = Map(0, 0, 180, MaxClockwise, MaxCounterClockwise);
            Thread.Sleep(1000);
            _servo.Duration = Map(180, 0, 180, MaxClockwise, MaxCounterClockwise);
            Thread.Sleep(1000);
        }
        private static uint Map(uint x, uint inMin, uint inMax, uint outMin, uint outMax)
        {
            return (x - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
        }
    }
}

Also bear in mind servos tend to use a lot of juice so you might want to think about powering them with a separate 5v supply

@ Brett: I did read that website. and when looking to my code, it’s not too bad.
but there are many differences finding samples on this forum.

My code uses setPulse(…, …)
Justin his code set’s the duration.

have the same effect I think, but I will try his code.

@ Berrie - I used old school NETMF for the PMW

Microsoft.SPOT.Hardware.PWM 

where you set the duration

Gadgeteer

GT.Interfaces.PWMOutput 

you Set the frequency

I see.

you also have scale Microseconds.
setPulse() uses uSeconds. so there is also a different.

gives hope.

I will try you’re code.

It rotates.
when starting the program it goes fast to a position.
when making the duration longer. it rotation slow and makes a lot of noice.

the servo also becomes hot!!!

any idee?

It sounds like you are trying to rotate it outside if its mechanical bounds. You need to adjust your timings else you will kill it. If it is chattering or getting hot it won’t survive long!

Post up your code to see if any thing obvious sticks out.

Any joy on getting it working?

No joy.

one servo is damaged.
maybe I will buy an totally other servo. maybe that’s working better.

I think I’ve to find out which ranges the A0090 uses. there is no much documentation.
so I will buy one with documentation :o)

Stink!

Most servos will fall in the range of 90 - 180deg mechanical resolution.
So i would set your min resolution to say 600 and maximum to around 2400 then change them from there.
For experimenting i would get a set of these HXT900’s as they are cheap as chips.

http://www.ebay.co.uk/itm/GENUINE-Hextronik-HXT900-9g-1-6kg-12sec-Micro-Servo-PACK-OF-4-orangeRX-uk-/190711245677?pt=UK_ToysGames_RadioControlled_JN&hash=item2c6746ab6d&_uhb=1#ht_2011wt_952

If you want any other help let me know.