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
Path to Programmable
  • Challenges & Projects
  • Design Challenges
  • Path to Programmable
  • More
  • Cancel
Path to Programmable
Blog Path to Programmable - Blog 11 - Video Project Gimbal
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rsc
  • Date Created: 13 Jan 2019 1:31 AM Date Created
  • Views 808 views
  • Likes 10 likes
  • Comments 3 comments
  • path to programmable
  • minized
Related
Recommended

Path to Programmable - Blog 11 - Video Project Gimbal

rsc
rsc
13 Jan 2019

To control my camera module, I'm going to use a X-Y gimbal made from RC servos.

I will run the servos from the MiniZed.

To do this, I have modified the code from the IP training to run two RC servos instead (and addition to) the PL leds.

The new Vivado Block Design is as follows:

image

I added another instance of the IP PWM_w_Int, and connected it to PL_LED_G

image

The new address of the second PWM channel (Green LED) is 0x40002000:

image

The green and red PL LED pins are also available on the Arduino headers as A3 and A4 so I didn't have to add any new port definitions:

image

The Implementation schematic is shown below.

image

I stumbled upon the IO Bank definitions after getting many bitstream generation errors and set up the Green LED PWM2 on E13:

image

It turns out that theHW lab example code PWM period is set to 20ms, which is what RC servos use, so that didn't need to be changed.

The test code for setting a PWM pulse from 1ms (50,000 clock cycles) to 2ms (100,000 clock cycles) was changed to the following:

brightnessRed = (period * 5000)+50000;

brightnessGreed = (period * 5000)+50000;

#define PWM_BASE_ADDRESS               0x43C00000

#define PWM_BASE_ADDRESS2              0x40002000

Xil_Out32(PWM_BASE_ADDRESS, brightnessRed);

Xil_Out32(PWM_BASE_ADDRESS2, brightnessGreen);

A period value of 0 is now approx. -45deg servo travel (1000us pulse), and a period value of 10 is approx. +45deg servo travel (2000us pulse).

Here's my servo test setup:

image

Here's a scope trace of the PWM signal:

image

I may have to boost the PWM signal from 3.2V to 5VDC for the servos to operate consistently.

Currently the video streamer and the servo drivers are on two separate MiniZed boards, although I am trying to get everything to work together on one board.

**update 19 Jan

I added a level shifter to the AO3 and AO4 outputs and ran a short test program that runs the servos in sine wave patterns:

    for (i = 1; i < 3610; i++){

     Xil_Out32(PWM_BASE_ADDRESS,75000+(25000*sin(i*3.14/1800)));

     Xil_Out32(PWM_BASE_ADDRESS2,75000+(25000*sin(i*3.14/900)));

         for (i2 = 1; i2 < 40000; i2++){

         }

    }

   

Here's a video of the gimbal operating.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply

Top Comments

  • rsc
    rsc over 6 years ago in reply to genebren +1
    Hi Gene, I have a 9-axis IMU the MPU9250 with I2C interface I've been using with the RPi I will try and implement in this project eventually. Scott
  • aspork42
    aspork42 over 6 years ago +1
    Nice job! Do you know why the issues with E13 versus using E12? You could also use the accelerometer right on board the MiniZed if you're able to read it. I wasn't able to find any example code for I2C…
  • aspork42
    aspork42 over 6 years ago

    Nice job! Do you know why the issues with E13 versus using E12?

    You could also use the accelerometer right on board the MiniZed if you're able to read it. I wasn't able to find any example code for I2C that worked; which is the bus that the sensor is on.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rsc
    rsc over 6 years ago in reply to genebren

    Hi Gene,

    I have a 9-axis IMU the MPU9250 with I2C interface I've been using with the RPi I will try and implement in this project eventually.

    Scott

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 6 years ago

    Nice project.  It will be interesting to see how this all works out for you.  Are you going to be detecting the pitch and roll to drive the gimbal from sensors, or getting this information from some other equipment?

     

    Keep up the good work!

    Gene

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • 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