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 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
Robotics
  • Technologies
  • More
Robotics
Forum Labview and coordinates
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Robotics to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 8 replies
  • Answers 1 answer
  • Subscribers 59 subscribers
  • Views 1378 views
  • Users 0 members are here
  • robotics
  • robot
  • accelerometer
  • servo
  • gyroscope
  • labview
  • arduino
Related

Labview and coordinates

Former Member
Former Member over 9 years ago

Hello, I am trying to write a code in labview to move my robots servo motors. The input i have is an accelerometer and i have x, y, z coordinates. I am trying to figure how how to convert those in degrees so the servos can understand and to get stable linear movement from all the servos at the same time.

  • Sign in to reply
  • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago

    What is the input to the control environment from the sensor, what is the sensor, please provide link to data sheet, also a general schematic for the project and what the servos are you are using

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

    the sensor is the MPU-6050MPU-6050 module for arduino https://www.cdiweb.com/datasheets/invensense/MPU-6050_DataSheet_V3%204.pdf (data sheet), the servos are tower pro 946R. the arduino module has I2C interface and is connected to arduino. Everything works and I am getting coordinates in labview. I just need to translate those to degrees i guess so the robot whould move according to where the accelerometer is

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

    well, thats pretty straightforward I guess.

     

    //  apply  trigonometry  to get the  pitch  and  roll:   pitch  =  atan(xAxis/sqrt(pow(yAxis,2) +  pow(zAxis,2)));

    roll  =  atan(yAxis/sqrt(pow(xAxis,2) +  pow(zAxis,2)));

    //convert radians  into degrees

    pitch  =  pitch  * (180.0/PI);

    roll  =  roll  * (180.0/PI)  ;

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • sarunaszx
    0 sarunaszx over 9 years ago in reply to sarunaszx

    If you want a Labview sketch, I can make a subVI later with inputs of accelerometer x,y,z data and outputs of roll and pitch (if you tell me which Labview version you are using)

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

    aciu sarunai

    labview 2014

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

    I made a small code following the example I have given you earlier.
    https://www.dropbox.com/s/fue5amc51brprwt/AccAnglesDegrees.vi?dl=0

     

    Roll/Pitch directions might be different - you might need to change the sign of x,y or z. But I think you will manage it.

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

    thank you. I will try this and post my results later

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago

    so I am assuming you have already looked at this but here it is incase and for others

     

    I have never played with this motion control stuff but do understand what you want to do, Im just not familuar with the math

     

    https://en.wikipedia.org/wiki/Euler_angles

    http://web.mit.edu/course/2/2.05/www/Handout/HO2.PDF

    gyroscope - MPU6050 output yaw pitch and roll with Arduino - Stack Overflow

    • 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