Take the 2-minute tour ×
LEGO® Answers is a question and answer site for LEGO® and building block enthusiasts. It's 100% free, no registration required.

I have a Arduino motor shield connected to XL, L and M motors and can control the speed with PWM (Pulse Width Modulation). I made my own connector by cutting a Lego PF connector in half and wiring up the two inner connectors to "pins" that are easy to connect to a breadboard.

When I connect those two pins to the PF Servo Motor that comes with the Crawler, well, nothing happens no matter what pulse I send (Arduino handles the pulses . . I just set a "direction" pin and a value between 0 and 255 . . . and PWM or not the net effect is that with a voltmeter you see voltages between about -9 Volts and 9 volts, same as when you measure from the IR receiver).

Anyway, what am I missing? What is different about PWM on a servo motor?

share|improve this question
1  
That doesn't quite seem as a real question so far... (but I'm fairly confident you can reformulate once you have the answer) –  Joubarc Feb 20 '13 at 20:34
    
Sorry man I was in a rush! Panic! I'll fix it after my presentation tonight. And, I do have the answer so I'll post that too. Sometimes in asking the question and having to think about it you come up with the answer on your own. –  tooshel Feb 20 '13 at 23:26
1  
Well it's ok to ask and answer your own question but you'll certainly want to rewrite the question so that it looks like one. –  Joubarc Feb 21 '13 at 7:57
    
@Joubarc Okay, it's fixed. You can further change it if you want (you're a moderator!) but if you have other suggestions I'll fix it further. And I should add some pictures . . . describing these things is difficult and a picture would make it way easier. I just hope this kind of question is relevant here . . . I was going to post in the electronics SE too but figured it out before I got to that. –  tooshel Feb 21 '13 at 17:51
    
Editing questions to make them better isn't limited to moderators, quite the contrary - everyone is welcome to contribute in that way, too. That said, the question & answer looks fine to me now. –  Joubarc Feb 21 '13 at 18:54
show 1 more comment

2 Answers 2

Turns out the problem is that Servo motors need at least THREE wires. Two for the PWM and one for full power. I made a new connector (and I can attach a picture if anyone is interested . . . just don't have one handy right now) that had all four of the wires from the Lego brick connected to breadboarding pins and then I wired the two new wires to +9 and ground. That did the trick! As soon as it powered up I could hear the servo motor moving to center. Then, I sent pulses with the Arduino and I once again had control of the steering!

share|improve this answer
add comment

According to Philo's detailed analysis of the servomotor, it takes its commands from the C lines but needs to be powered as well:

Being a Power Functions range member, it is fully integrated with this system, and receives its commended position through C1/C2 lines, and its power from supply lines. On a normal motor, C1/C2 duty cycle directly control motor speed, here they set the angular position of the shaft.

This makes sense since there's electronics involved and these need to be powered by a regular, reliable power supply which is exactly the purpose of the +9V and Ground wires. The same holds for the IR receiver (although that one ignores the C1/C2 lines completely).

For more information on the PF wiring, you should also check Philo's presentation of the Power Functions system.

share|improve this answer
    
I did a bit more reading and most servo motors are a three wire affair and that's what got me thinking I was missing a wire. I didn't add my pin wires to all 4 wires on the pf connector because for all the other motors they are not used and they just get in the way. Luckily I had parts to make a new connector . . . although RIP to one of my Lego LEDs :(. And these links are wonderful reads I hadn't seen before so thanks! –  tooshel Feb 21 '13 at 22:27
    
Just a thought, you may want to sacrifice extension cables instead of leds. –  Joubarc Feb 22 '13 at 9:42
1  
Oh, I've sacrificed plenty of extension cables . . . but I ran out! And not even the Lego Store carries them. –  tooshel Feb 22 '13 at 19:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.