0 Members and 2 Guests are viewing this topic.
Right. So my servo responds to .5ms (-90), 1.5ms(0), and 2.5ms(+90). When I just run a simple raw servo script, .5ms sends it toward -90, the raw 2.5 sends it toward +90. However, when embedded in the turnout control script, the .5ms and 2.5ms both send it toward +90.
I'm using software based PWM on the GPIO to drive the servo, but having trouble. When I send a raw .005 pulse it moves one way, and the .025 pulse moves the opposite. But when I send each pulse via the control program, both widths turn the servo the same direction. Will keep experimenting.
Yes I agree about some sw problem, but ... Which servo brand/model you use?How you're sure about milliseconds you refer?
Ultimately, it's just a guess based on trial/error sending various pulses to it. The 0.5-2.5ms range seemed to be the sweet spot. Its just a cheap thing that came in a RadioShack electronics starter kit bundle, which lists no other specs beside "mini servo". Looking at it closer, the range is actually about 250 degrees. Now I'm starting to wonder, if we split the 250 degree range and assign pulse width as follows:-125 (.5ms) 0(1.5ms)+125(2.5ms)Starting at 0, I send a few 2.5ms pulses and move the servo to +56, at that point, it's less distance on the 360 degree circle to reach -125 by continuing the servo in the same direction toward +125. Would that cause the servo then interpret both .5 and 2.5 as a move toward +125, even though the gear limits would prevent .5ms pulse from reaching -125 traveling in that direction? I'm going to try adding a 'reset' command to first send the servo back to 0 before then continuing on toward -125 and see if that makes a difference.
Figured it out! That was pretty close Peteski. I was changing the length of time the output was on instead of the length of the duty cycle of the pulse.
I bought an Arduino Uno yesterday and have been trying to play around with it. It has a much steeper learning curve than the Pi, but it looks like it will be more apt as stand alone automation driver, whereas the Pi will be more useful for interactive automation.
Interesting perspective… I've always considered the Pi to be significantly more complex than Arduino.-Dave
I received 40 micro LEDs from China today and am wiring up a test warehouse. I must say, for how much simply lighting up a building improves a model, adding a random flicker to even just a single light really makes things come alive! This is incredibly fun!