pulseInOut.SetPulse(1, ...);

For a Pulse InOut Module, what should be the second parameter (or the third) so that the servo will move?

I’ve tried all combinations, but it doesn’t work.

P.S. Merry Christmas!

I’ve tested the servos using an extender module and they do work.

I don’t exactly know what to try more with the Pulse InOut module.

Sorry, I don’t have a pulse inout module or the latest sdk, but what does intellisense tell you the parameters are for?

@ Brett -


    // Summary:
    //     A module used to read and send remote control signals, with 8 PWM in and
    //     8 PWM out for Microsoft .NET Gadgeteer
    public class PulseInOut : DaisyLinkModule
    {
        // Summary:
        //     Constructor
        //
        // Parameters:
        //   socketNumber:
        //     The socket that this module is plugged in to.
        public PulseInOut(int socketNumber);

        // Summary:
        //     Reads the current PWM wave from Inputs 1-8
        //
        // Parameters:
        //   input_id:
        //     The input to read from. 1-8.
        //
        //   high_time:
        //     The amount of time the wave is high in microseconds.
        //
        //   low_time:
        //     The amount of time the wave is low in microseconds.
        public void ReadChannel(int input_id, out int high_time, out int low_time);
        //
        // Summary:
        //     Sets an output pin's PWM 1-8.
        //
        // Parameters:
        //   pwm_id:
        //     The PWM channel to set. 1-8.
        //
        //   highTime_microse:
        //     The ammount of time for the pin to be high, in microseconds.
        public void SetPulse(int pwm_id, ushort highTime_microse);
        //
        // Summary:
        //     Sets a PWM pulse on the passed in pin.
        //
        // Parameters:
        //   pwm_id:
        //     The pin to set.
        //
        //   period_microsec:
        //     Length of the perion in microseconds.
        //
        //   highTime_microse:
        //     The length of time for the wave to be high, in microseconds.
        public void SetPulse(int pwm_id, uint period_microsec, uint highTime_microse);
    }


I’ve found that someone else had similar problem; except that for me it doesn’t work no matter the power source.

http://www.tinyclr.com/forum/topic?id=9388&page=4#msg94101

Show us your codes.

The function SetFrequency was removed.
So,
Frequency = 1000000/ the second param (usec);
Normally, to get servo motor works, the second param will be 20000us, the third one will be from 1100 to 1900us.


                       for (ushort i = 1100; i < 1900; i += 8)
                          {
                              pulseInOut.SetPulse(1, 20000,i);                            
                          }


Please note that if you change frequency of any pin, the frequency of the rest of pins will be changed too.

ok, as Dat said, 20000 usec and 1500usec are the two key values. The other thing to remember is that a servo, given a single value (say 1500usec) will stay stationary, its when you vary the pulse width that the servo position moves. So set it to 1500 and it should approximately go to centred; back to say 1200 it will go the other way, and then go to say 1800 and it will go the other way. You will need to experiment with your actual servo to see what it’s limits are, sometimes they can be as wide as 800/2200.

@ Dat -
@ Brett -

Thanks for your info; Dat I’ve tried your code (which was very similar with mine’s) - it doesn’t work; I suspect it is something faulty in the hardware; unless I linked the modules wrong (see the attached image) (the servo is on PWM 5 and I didn’t forget to change pwm_id to 5 in the code).

prove the servo works by using it on a PWM pin direct from your mainboard. That also allows you to ascertain the centre and limit settings you need.

Then prove the PWM on the inout module isn’t working by using a 50% duty cycle and measuring the voltage of the pin with a multimeter and you should see 1.65v or close to; change to 10% duty cycle and you should get .33v

and we’d seriously need a better picture than that to see anything :slight_smile:

@ Brett -

As I said in a previous post I tested the servos with an extender module like here:

and they do work (I have 7 servos of 3 different types - it would’ve been near impossible to be all broken).

I don’t have a multimeter - I didn’t expect to need one (not with gadgeteer) and also not to solder (I used solderless pins) (at least not at the beginning)

I took another picture, but it is the best I can do with my 3MP camera of my old phone.

How are you powering the servo? The module uses mainboard’s power to power itself but not the servo.

Typically servos need 6v but I have used them with 5v if this is all you have.

@ Gus -

Specs for one of my servo type:

[em]• Operating voltage: 4.8V to 6V
• No load speed: 0.12 seconds / 60° (4.8V)
• Stall torque: 1.6 kg / cm (4.8V)
• Operating temperature: -30°C to +60°C
• Dead set: 7 microseconds
• Working current: less than 500mA[/em]

I’ve tried without/with an external power source (4xAA battery) - no luck.

We will be getting to finishing the tutorial for this module soon but for now, take a look at this image http://www.ghielectronics.com/images/catalog/392-1_large.jpg
See the 2 pads in the upper right corner? Top one labeled 5V and it is the 5V coming from mainboard. The pin right under it is the power pin for the servos. If you do not need a lot of power (depends on what servos you are using) then you can add a jumper between 5V and the pad under it. If you need more power than than the mainboard can provide, then you can add external power source on the pad under the 5V pad.

@ Gus - Thanks and wow; I would’ve never guessed that; I assumed that near the 5V is … the power for the servos and near the GND is… of course the GND for the servos. Actually, I asked in a previous post about those 2 pins in another thread (http://www.tinyclr.com/forum/topic?id=9937&page=1#msg98539).

So, if the first is the 5V coming from the mainboard (which I don’t want to use) and the second is the 5V for the external power, where is the GND for the external power?

you must have GNDs all connected. Pick a GND, tie them all together

@ Brett - Sorry, but I don’t understand; the mainboard is powered using USB Client DP; how do I GNDs all toghether?

If I link the GND of the external power to one of the 16 GNDs from the PulseInOut module, will it do the job?

Yes, all GNDs on any Gadgeteer mainboard and module are already tied together. So, take your pick.