I'm at a lost as to how to do this.
I want to use two servomotors to motorize the Imperial Shuttle. One will move the wings and cannons, and the other will extend the landing gear and ramp. I also want to use a microcontroller so I can push a single button to both raise the wings and lower the landing gear and ramp, as well as control all the lights and such.
Thing is, I have no idea how to accomplish this. I understand a bit about programming, but I'm not sure how to get the PIC to signal the servos.
Can someone offer some good advice on how to do this? The rest I can handle, but this is going to drive me crazy. I already have the mechanics worked out, I just need help on the electronics end of it.
Programming a microcontroller to conrol servos?
Moderators: Sparky, Moderators
- MillenniumFalsehood
- Posts: 17033
- Joined: Tue Nov 16, 2004 5:23 pm
- Location: Wichita, KS, USA
- Contact:
Programming a microcontroller to conrol servos?
If a redhead works at a bakery, does that make him a gingerbread man?
Ponies defeat a Star Trek villain? Give them a Star Wars award ceremony!
Ponies defeat a Star Trek villain? Give them a Star Wars award ceremony!
-
- Posts: 61
- Joined: Sat Jul 13, 2002 8:11 pm
- Location: Central Washington, The State
You might try this guy. Bernie is great with PLC controllers and a sci fi nut to boot. http://www.theplcguy.com/
- Pat Amaral
- Posts: 3730
- Joined: Fri Jul 12, 2002 2:44 pm
- Location: Ok, I'm here. You can start now
Hi MillenniumFalsehood,
A regular R/C servo, not a digital servo, has three wires coming out of it power, ground and the control line. The arrangement of the wires varies from manufacturer to manufacturer.
The control line carries a series of pulses from the receiver or microcontroller to the servo. The rotation of the shaft is proportional to the duration of the pulse sent to the control line of the servo. This varies a bit among manufacturers.
The refresh rate is around 40Hz or 50 Hz and isn't very critical. Most servos center with a pulse duration of around 0.0015 seconds. The limits of rotation are usually at 0.001 seconds and 0.002 seconds. However on some servos the limits are at 0.00075 seconds and 0.00225 seconds.
I hope I didn't screw up the units.
Mike
A regular R/C servo, not a digital servo, has three wires coming out of it power, ground and the control line. The arrangement of the wires varies from manufacturer to manufacturer.
The control line carries a series of pulses from the receiver or microcontroller to the servo. The rotation of the shaft is proportional to the duration of the pulse sent to the control line of the servo. This varies a bit among manufacturers.
The refresh rate is around 40Hz or 50 Hz and isn't very critical. Most servos center with a pulse duration of around 0.0015 seconds. The limits of rotation are usually at 0.001 seconds and 0.002 seconds. However on some servos the limits are at 0.00075 seconds and 0.00225 seconds.
I hope I didn't screw up the units.
Mike
If you've not yet bought a PIC, compiler or programmer than check out this book: http://www.amazon.com/PIC-Microcontroll ... s=picbasic by John Iovine. This uses PicBasic Pro and a programmer from meLabs (who make PBP). It's a little expensive to get started, btw, but well-worth it (I only use PICs to do my lighting now). Amazon also lists PBP3 compiler and programmers.
It's what I used to get started on programming PICs. It has a chapter on servo motors and DC motors with sample code and schematic diagrams.
It's what I used to get started on programming PICs. It has a chapter on servo motors and DC motors with sample code and schematic diagrams.
Another very interesting project is the Arduino ( http://arduino.cc/en/ ). Especially for people without experience in programming PIC/Atmel, this could be very interesting. Controlling servos, motors, LEDs (with PWM you can easy simulate the Photon-Torpedo-Effect for Star Trek-Models or engine-flickering for every other Spaceship ) and much more.