element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
Arduino
  • Products
  • More
Arduino
Arduino Forum Control a rotary table
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 4 replies
  • Answers 1 answer
  • Subscribers 392 subscribers
  • Views 563 views
  • Users 0 members are here
Related

Control a rotary table

Former Member
Former Member over 10 years ago

My question is for help me in programming an Aduino to control a stepper motor using  a communication protocol (listed in the bottom)

As my skills for programming is very low, i can't write a program to Arduino to control the rotary table.

I can see the program is sending code to com3 but i don't know how to program the Arduino so it can communicate with this code.

Someone who can help me with this?

 

Contents

1General Rotary Communication Protocol

2 Commands

2.1V

2.2SmMxxx

2.3ImMxxx

2.4DmCWLO

2.5DmCWHi

2.6EmHALT

3Rotary Sample Command Sequence

 

General Rotary Communication Protocol

All commands sent to the rotary table are in simple character format including the motor numbers. Only the

parts marked as xxx passed to the table as byte data. For example if you want table 1 rotate 4 steps instead of

passing "I1M004" you pass "I1M" + (char)0 + (char)0 + (char)4

In general all commands get a reply in the form of: ^XXXXXX

 

Commands


V

Request the status of the rotary table. Usual reply would be ^R1R2R3R4 indicating rotary 1 ready, rotary 2

ready, etc. ^B1xxxR2R3R4 means rotary 1 is busy where xxx are 3 bytes indicates how many steps the

rotary still has to perform.

 

SmMxxx

Sets the speed of the motor m to xxx, where xxx is a 3 bytes of data indicating the speed. Example code:

port.Write("S1M" + (char)0 + (char)6 + (char)255); // set motor 1 to speed 1791. The standard speed range

of our rotary table is: 0x000001 to 0x0012FF (1 to 4863). Controller will respond with ^mxx mirroring the

motor number and 2 last bytes of speed setting.

 

ImMxxx

Turns motor m xxx number of steps. Controller will acknowledge with ^Bmxxx

 

DmCWLO

Set motor number m to rotate clockwise (So each consecutive command to rotate the motor m will rotate it

clockwise).

 

DmCWHi

Sets rotary m to rotate counterclockwise.

 

EmHALT

Rotary m stop.

 

Rotary Sample Command Sequence

Motor numbers are passed as characters but the number of steps and speed are passed as 3 bytes of binary for

simplicity.

 

send: V reply: ^R1R2R3R4

 

send: S1M1791 reply: ^191

 

sned: D1CWLO reply: ^

 

send: I1M100 reply: ^B1100

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    0 Former Member over 10 years ago

    Hi Tron Akkie,

     

    I can help you in coding. But I need the clear picture of what you want to do. What all hardware/components are you using? List it down and what do you want to do with stepper motor.

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

    Hi Tron Akkie,

     

    I can help you in coding. But I need the clear picture of what you want to do. What all hardware/components are you using? List it down and what do you want to do with stepper motor.

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

    Hi Ravi Soni,

     

    Thanks for your answer.

    The hardware i am using;

    USB2FTDI (FTDI friend) to connect from te PC to the Arduino via serial port.

    Arduino Trinket Pro 5V (ATmega328)

    Easydriver 4.4

    Steppermotor 4 wires. Powered through the Easydriver

     

    The windows program i am using is sending the rotary commands witch i listed in the first post.

    Example it is sending a 'V'. The Arduino has to read that and responds with the code according to the protocol example ^R1R2R3R4 back to the PC.

    All the setting like speed en steps are controled by the PC program.

     

    The PC program is used for 3D scanning. I put a object on the rotary table and the program begins making a scan and then sends the code to the Arduino so the steppermotor is rotating for example 10degrees.

    Then the programs makes a new scan and the rotary table is rotate for another 10 degrees until it has a full 360 scan.

     

    For example https://www.youtube.com/watch?v=Hj1eZsFg6pI

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

    have a look at DAVID-LASERSCANNER web site or  fab scan

     

    the attachment is what I use it the best free one I have found I will load the file I did for the enclosure when I find it. its best to do in a enclosure as you wont a very small amount of light and having a dark back ground makes for very clean scans

    Attachments:
    sketch_3D_scanner_Programa.rar
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to cncdan

    Thanks Daniel,

     

    That looks good. I think i can built further on this.

    • 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