Go Back  R/C Tech Forums > General Forums > Radio and Electronics
Servo control with Raspberry Pi >

Servo control with Raspberry Pi

Community
Wiki Posts
Search

Servo control with Raspberry Pi

Thread Tools
 
Search this Thread
 
Old 09-14-2015, 03:13 PM
  #1  
Tech Rookie
Thread Starter
 
Join Date: Aug 2015
Posts: 4
Default Servo control with Raspberry Pi

Hello!

I'm trying to control a servo with a Raspberry Pi using a library called piblaster.js which enables PWM on some GPIO pins, but for some reason it doesn't work. I can use piblaster to change the brightness of a LED, but when I connect the pin to the signal wire of the servo it always go to the same position, even though I change the value of the PWM.

Does anyone have any ideas of what I'm doing wrong?

Thanks!
Trettman is offline  
Old 09-15-2015, 07:09 AM
  #2  
Tech Rookie
Thread Starter
 
Join Date: Aug 2015
Posts: 4
Default

Maybe I should add a bit more info, I was tired when I posted so I probably left some things out.

I've attached a picture showing how I connected everything. The servo worked when I used a transmitter and a receiver, but when I used the Raspberry Pi it did not. I tried with another type of servo (a Futaba S3003) but it didn't work either. I've seen other people use piblaster to control servos but for some reason it doesn't work.

Here's some short javascript code showing how I used the GPIO pin:

var piblaster = require("pi-blaster.js");

piblaster.setPwm(17, <some value>);
Attached Thumbnails Servo control with Raspberry Pi-koppling.png  
Trettman is offline  
Old 09-16-2015, 09:33 AM
  #3  
Tech Regular
iTrader: (24)
 
wrongchannel's Avatar
 
Join Date: Mar 2011
Location: Springfield, IL
Posts: 389
Trader Rating: 24 (100%+)
Default

In your block diagram you show an ESC between your power source and servo power leads. I'm assuming by ESC you mean Electronic Speed Control. Only thing I can figure is you are using it for a voltage regulator. Try running the servo on a dedicated power source between 5-6 volts.

If that doesn't work try viewing the Output of a receiver on a Osciloscope. Then compare this output with what your getting from the Rasberry PI. The modulation is probably different.

Good luck.
wrongchannel is offline  
Old 09-16-2015, 12:54 PM
  #4  
Tech Lord
iTrader: (24)
 
wingracer's Avatar
 
Join Date: Nov 2007
Posts: 13,738
Trader Rating: 24 (100%+)
Default

Your diagram doesn't show a ground between pi and servo. That's not going to do anything. I'm no expert on this but a quick google image search brings up lots of pics and diagrams and every single one I looked at showed at least signal AND ground to the pi.
wingracer is offline  
Old 09-16-2015, 04:52 PM
  #5  
Tech Champion
 
Join Date: Oct 2007
Posts: 7,342
Default

I agree with wingracer. Certainly worth trying.
Dave H is offline  

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service -

Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.