Properly using the PulseInOut Module

All I am trying to do is open it and close it 10 times. The servo is a HiTech HS-322HD. It closes just fine, in fact, that’s all it does.

Am I doing something wrong with the timings? It’s a 20ms refresh, with 0.9ms being -90, 1.5ms being 0 and 2.1ms being +90.

for (int m = 0; m < 10; m++)
            {

                    controller.SetPulse(1, 20000, 900);
                    Debug.Print("Duration is 0.9ms");
                    Thread.Sleep(500);
                    controller.SetPulse(1, 20000, 1500);
                    Debug.Print("Duration is 1.5ms");
                    Thread.Sleep(500);
                    controller.SetPulse(1, 20000, 2100);
                    Debug.Print("Duration is 2.1ms");
                
            }
            controller.SetPulse(1, 20000, 1500);

Not sure I understand the problem. Do you have a scope that you can use to check the output?

@ Detroit.Mustang - You might want to add a Sleep after the controller.SetPulse(1, 20000, 2100) statement, and try with a two second sleep. Might not be enough time for servo to get into position.

No scope. Not even one at my school I can use. The servo isn’t cycling -90, 0, +90. It’s just going full lock counter-clockwise and sticking there.

I read the manual on the hiTech site, and I am fairly certain I understood it properly.

I really want to stick with GHI products, as I much prefer to support local. This will work, one way or another! hah.

Thanks Gus.

I guess I am confused as to the function of the +5V and GND header on the module. Do they not power the servos? The schematic is a bit confusing. I can see the +5V running through the center.

Does 5V come in on the top of the module, where it reads “5V” while the GND comes in on the lower portion of the two-pin?

It looks like the bottom is connected through the centers of the 3-pin where the power for all hobby servos comes from, and the gnd runs along the outside of the module (outermost pins), while the PWM signals are the innermost pins.

Looks like I’ve gotten it figured out. Thanks guys.

The pin on the top of the module that looks like it’s for +5V isn’t. When I connect a ground to the outermost pins directly, and +5V to the lower (of the two-pin header), the servos all work.

This gives you the option to use 5v or external power for your servos.

yeah, so as Gus says this is a jumper. Put a jumper between those two pads and you power from the Gadgeteer 5v input power. Directly feed “other” 5v power into the lower of the two pads and you power them from an external source. Perfect when you have high stall currents and potential for stalling and you don’t want to kill your DP module.