element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Single-Board Computers
  • Products
  • Dev Tools
  • Single-Board Computers
  • More
  • Cancel
Single-Board Computers
Forum control of 360 degree servos
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Single-Board Computers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 12 replies
  • Subscribers 57 subscribers
  • Views 2342 views
  • Users 0 members are here
  • beaglebone_black
  • single-board-computers
Related

control of 360 degree servos

Former Member
Former Member over 12 years ago

Hi

 

i wonder how i would control a 360 degree servos from a python script?

 

there are lot of guides on 180 degree servos

 

most of them from adafruit... have nothing against them but i like to not be dependent on external libs

 

 

i'm going to use this in a fully automatic tracker.... the tracker will be used to track high altitude baloons (30+ km)

 

 

/bo

  • Sign in to reply
  • Cancel
  • shabaz
    0 shabaz over 12 years ago

    Hi Bo,

     

    A  servo capable of 360 degrees would be different from those "modified RC servos" that give continuous rotation. Are you planning on using this for a gymbal type mechanism to track?

    If so, perhaps PWM is not the best way to do this, especially if you're going to the mechanical effort at producing a gymbal.

    A better choice would be to use geared-down stepper motors for much higher resolution.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to shabaz

    nope... it will be a simple up/down with one servo and left/right with another.... one limit will be that it can not go from 360/0 to 1... it will be told to go the other way round to not mess up wires

     

    up/down will be limited to 90 degree up and no down...

     

    and i will better stay on servos... cheaper... just need the big hobby servos... then a few bearings to take load off servos

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 12 years ago in reply to Former Member

    Have you got a URL/datasheet to a 360 degree servo that you're planning to use? Modifying a 180 degree servo for continuous rotation is not the same thing as a servo capable of a controlled 360 degrees.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago

    yes i have....

     

    but the Q is not about the servos... its on how to control it.... ie python code

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to shabaz

    http://www.hobbyking.com/hobbyking/store/__18742__Vigor_VSD_11AYMB_MG_HV_Extra_Large_360_Degree_Winch_Servo_0_75sec_50kg_150g.html

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 12 years ago in reply to Former Member

    Bo Herrmannsen wrote:

     

    yes i have....

     

    but the Q is not about the servos... its on how to control it.... ie python code

     

    I understand. But you didn't supply enough information to give an answer. Hence the request for that URL.

     

    You can use the same Python code as you would for a 180 degree servo. According to that URL, the pulse width needs to be between 800 and 2200usec for a rotation of 2160 degrees. So, the center position would be at 1500usec pulse width, and if you changed the pulse width by up to +- 116.6 usec then the servo would rotate by +-180 degrees, giving you a controlled rotation of 360 degrees.

    The existing Python code most likely uses values of 1000us to 2000uec to control the servo, with the center being 1.5msec, which matches the calculations for your desired servo (1500usec).

    So, you can continue to use the existing code, but don't instruct the servo to adjust more than +-116.6usec, whereas a normal 180 degree servo would be controlled by up to +-500usec to get the span from 1000usec to 2000usec.

     

    So, the existing Python code/library will work. Just don't expect good granularity.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to shabaz

    ok, what do you mean by excisting code? i have yet to find even that...

     

    i dont want to rely on a librart

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 12 years ago in reply to Former Member

    Without a library, you will need to spend some time  to write your own library for the processor that you've chosen.

    Once you have decided on a processor, you'll need to research what PWM facilities exist for that processor (often there is an integrated peripheral inside the chip) and look up the register config (all this will be in the processor reference guide) and write your own driver/library that will control the PWM based on the custom interface that you may write.

     

    That's just a quick summary of the process; some experience may be needed in writing driver code. You may get lucky and find the config needed to set up the PWM peripheral on the Internet, for your particular processor. Or, you may be able to see the source code of an existing PWM library for your processor and re-write, if you don't want to rely on any existing library.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to shabaz

    processor = Beagle Bone Black

     

    and i dont have the skills to code from scratch

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 12 years ago in reply to Former Member

    Writing a Linux driver for PWM will need some experience. Another way is to use the PRU inside the chip, but that will take some studying too. The latter is not difficult, but expect to spend at least a day or more reading up on it and experiementing before you'll be able to write something useful, and it won't be in Python, but C and assembler. For now, it may be best to rely on the adafruit example code for the BeagleBone Black until you're confident to write a driver.

     

    EDIT: this web page looks very good, it has a Linux PWM driver and a link to the source code, and how to compile the kernel if the built driver is outdated. So, although you'd still be using a driver,  you can see the source code.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube