- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Fellow Community Members,
Recently I got a chance to lay my hands on a simple servo motor (of type TS-53), which had to be interfaced with PSoC 3. Thought of sharing it on the forum.
This interface required the PSoC to give a PWM signal with the high pulse varying between 1ms and 2ms. 1 ms corresponding to 0 degrees and 2ms corresponding to max rotation possible (close to 150 degrees in my case).
The dead time between the two pulses was 40ms.
The on-board potentiometer available on CY8CKIT-001 was used to vary the position of the shaft.
The project is attached along with this post. It may come handy if someone is working on similar servos.
Solved! Go to Solution.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is a pretty nice and short project!
I took the opportunity to change some things, have a look into it.
And if anybody has an idea for improvements post your suggestions or show up your code!
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looking for an actual datasheet with control specs was fruitless, but I found the following -
http://www.princeton.edu/~mae412/TEXT/NTRAK2002/292-302.pdf
and this
http://www.electro-tech-online.com/custompdfs/2011/10/PWM.pdf
0 - 2 mS all, 20 or 40 mS dead time.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I din't yet look into your supplied datasheets but GRAUPNER's servos are suggested to run with
1 (not 0!!) to 2 ms and a suggested repitition rate of 20ms. Some servos assume at 50ms a loss of connection ad go into a hold or a programmed position.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Typo on my part, concur its 1 - 2 mS.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Bob, for restructuring and making the code readable.
I had initially assumed that the "dead time" had to be held constant at 40ms, hence used to update the period too.
Apparently the dead time has to be optimal. If the control signal is fed too quickly, the servo will buzz and jitter. I found it happen when the dead time was set to less than 10ms. On the other hand, if the repeat signal is too slow (more than 70ms), the servo will shut off between signals and its position will not remain constant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for sharing the resource Dana!
That's a very useful piece of info.
Regards,
Gautam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am a student and new to PSoC. My current project requires me to write a code in C++ to drive a servo motor using PWM (PSoC5).
I am not only new to PSoC but also new to C++.
Any help would be appriciated.
Thanks alot and hope to hear back from some of you.
Nabil Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Writing code in C++ for PSoCs is a bit complicated, using simple C is much more easier. Download from the Cypress website Creator 3.0 and start with ADC-example, look for PWM-example and put them both together with a self-written closed-loop and you are done!
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Reference material attached that may be of help.
When you select a component in Creator, if you right click it, pick find example project,
you can add that to your workspace or open in a new window. Then cut and paste
code into your design. So a PWM is a natural fit for servo controller, the example
use of a PWM will help you.
Regards, Dana.