Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Kremlin on September 04, 2011, 12:18:33 AM

Title: Need a Massive Amount of Help with PWM for Continuous Rotation Servo
Post by: Kremlin on September 04, 2011, 12:18:33 AM
Hello Fellow Robot Enthusiasts,

I've been reading and reading (about a week spent trying to figure it out) and I still am fairly lost at trying to achieve my goals. I need to be able to modify several servos for continuous rotation. I also need to be able to create a tethered controller (10 cables max/26gauge maximum size) with variable speed controls (preferably w/thumb-stick controls) for Forward/Neutral/Reverse. I'm looking at using 4 servos for the wheel operation with the idea that the left two are controlled by one thumb-stick control and the right two are controlled by another. That way I can steer the vehicle as well. My problem is I need help in understanding what needs to go into a PWM system to make a circuit. I have a little background (just a little) in circuits but I have no idea of how to apply that knowledge into making a controller for the servos.

My problem is what things do I hook up to the servo and how do I determine what values I should use for the caps, resistors, and such. Keeping in mind that I can use 4 AA batteries (6V) to power the robot and there will be an crane arm and claw with around 3-4 servos also attached AND I can have a separate power source for the controller, but I cannot use it to power the vehicle.

Note:Tether must be removable from robot with a standard, strain-relieved connector. And the main power cannot go through the tethers. Robot must be under $170.



So I have a class project to build a robot that has the following specs/restrictions:
-build a no-track, small and light robot that is controlled remotely
-Max size 12”x6”x5”(LxWxH)   
-overcome obstacles no larger than a standard “2x4”
-Go between walls no closer than 6” apart
-Go up an incline of 30° to an upper level.
-Grab a 1lb rod lying down and transport it over a wall into a bin.



Thanks for reading, all help is appreciated.
Kremlin
Title: Re: Need a Massive Amount of Help with PWM for Continuous Rotation Servo
Post by: Soeren on September 04, 2011, 08:05:03 AM
Hi,

In effect, you're asking us to provide you with full plans and all.

Browse around this site to see how other people solved similar jobs and use Google where you need reinforcement.
When you have well defined specific questions, we'll be able to help, but you gotta do your own research and planning.
Title: Re: Need a Massive Amount of Help with PWM for Continuous Rotation Servo
Post by: Kremlin on September 05, 2011, 09:05:29 PM
What I'm really trying to figure out is how do I make a simple circuit to send a signal that is between 1ms and 2ms with a thumb-stick control with 0 position being 1.5 ms, 2ms being forward, and 1ms being reverse. And this will allow a variable control speed for anything in between 1ms to 2ms. Because I need to send a square wave to the servo and be able to manipulate the square wave via a potentiometer(I assume this is what a thumb-stick would use). And calculate the potentiometer needed for a change of resistance that give exactly a wave from 1ms to 2ms. I hope this helps in understanding the help I'm looking for.
Title: Re: Need a Massive Amount of Help with PWM for Continuous Rotation Servo
Post by: Soeren on September 05, 2011, 09:58:37 PM
Hi,

What I'm really trying to figure out is how do I make a simple circuit to send a signal that is between 1ms and 2ms with a thumb-stick control with 0 position being 1.5 ms, 2ms being forward, and 1ms being reverse.
The simplest is a small microcontroller of course - the potentiometer can hook directly to an A/D-C input and a digital output is all it takes to control a servo - a PIC10F220 could be glued to the pot itself and do all the work.
If long cables are used to transfer the signal to the servo, it might be a good idea to use a transistor to bring the impedance down, to keep interference from noise away.


[...] a potentiometer(I assume this is what a thumb-stick would use).
Most cheap joysticks use a potentiometer and I guess that's what you're talking about(?)


And calculate the potentiometer needed for a change of resistance that give exactly a wave from 1ms to 2ms. I hope this helps in understanding the help I'm looking for.
There's no such thing as "exactly" in the real world. Youy have to specify any measure with its allowed tolerances.
Like from 1.000ms +/- 5µs to 2.000ms +/- 5µs or whatever you need.

And even though the standard says 1000µs to 2000µs, some servos goes as low as 300µs and some as high as 2800µs

The closest tolerances can be reached with an x-tal controlled microcontroller.
Fairly good can be had with a microcontroller with internal oscillator
Usable, if you can get over the "exactly" part, can be done with a 555.

I'd go with option B, but I have no idea of your skill level.


Some things to consider:
Most joysticks only use a part of their potentiometer track, so min/max values should be measured.

A microcontroller program can be made with automatic calibration to the potentiometer min/max values, as well as to the servo min/max positions.

In a PDM signal for a servo, the period is not very critical, but the pulse duration is, as deviations of around 5µs and up will give jitter.