Issue with PWM on Hydra?

Hi all, spent a few hours this weekend banging my head against a wall trying to make a servo work on a hydra. Finally broke down and pulled out the o’scope and saw that it was generating pulses at nearly random rates…

Tried this code on a spider, works as expected.
Updated firmware just to make sure it is up to date and still no luck.
TinyBooter Version: 4.1.3.1
Firmware Version: 4.1.3.1

using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;

using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
using GTI = Gadgeteer.Interfaces;

namespace ServoTest
{
    public partial class Program
    {

        uint HighTime = 100000;
        uint ServoRate = 20 * 1000 * 1000;

        GTI.PWMOutput Servo;

        void ProgramStarted()
        {
            button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
            button1.ButtonPressed += new Button.ButtonEventHandler(button1_ButtonPressed);
            Servo = extender.SetupPWMOutput(GT.Socket.Pin.Nine);
        }

        void button1_ButtonPressed(Button sender, Button.ButtonState state)
        {
            ServoRate += 1000000;
            Servo.SetPulse(ServoRate, HighTime);
            Debug.Print("Rate set to:" + ServoRate.ToString());
        }

        void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            ServoRate -= 1000000;
            Servo.SetPulse(ServoRate, HighTime);
            Debug.Print("Rate set to:" + ServoRate.ToString());
        }
    }
}

I also did a quick search on the forums… stopped after 8 pages with no luck.
Do I just have a bad Hydra?

We will test this before we release NETMF 4.2 in few days.

Hi I also have a problem with PWM output on my hydra board. I’m developing a new modul with pwm features for rc models. I tried to generate the standard servo pwm impulses (period=20ms, high time =1ms).

Everything works fine with ns or µs range, but in higher ms range the pwm is not correct. I’m not able to generte period times with 20ms, the impuls high time is correct at 1ms.

Firmware. 4.1.3

CH1 = new Interfaces.PWMOutput(socket, Socket.Pin.Seven, this);
public Interfaces.PWMOutput CH1;

uint period = 2010001000;
uint impulse = 110001000;
myRcBoard.CH1.SetPulse(period,impulse);

any idea?

best regards

mikel

Same answer as earlier.

And welcome to the community.

thx gus for your fast resopnse…

so I will wait for new firmware version…

mikel

Hi, any news on this ? I also, spent hours trying to figure out why my servo wasn’t behaving on the Hydra and then checked out the signal with a scope. I get correct periods in the 2ms range. But, when trying 20ms ( around what a servo needs) I don’t get anywhere close.

I beIieve have the latest firmware/SDK :
TinyBooter Version: 4.2.3.1
Firmware Version: 4.2.3.1
SDK Version v0.0.8 , October 24, 2012

Thanks!

The firmware changed a lot in the 6 months since post was made. Please start new thread and provide more details and code.