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
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSOC 4 Ball and Beam Control System, identification toolbox.
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cypress Kits to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 33 replies
  • Answers 2 answers
  • Subscribers 28 subscribers
  • Views 4249 views
  • Users 0 members are here
  • psoc4
  • ballandbeam
  • identification
  • controlsystem
  • uart
  • pid
Related

PSOC 4 Ball and Beam Control System, identification toolbox.

juanes.pazj
juanes.pazj over 10 years ago

Short Review:

I have been working on this model for a while now, I was having some trouble with the sensor data but all of that is good now,

Here is how the system works every command is fed through the UART interface as well as data read from sensors or input data.

I managed to control angle only (motor position) although I am not very happy with it is somewhat unstable...

The trouble I am facing is controlling the ball position, the simpler control system I could come up was a cascade PID, the problem is I cant get both plants right for simulation Voltage-Angle and Angle-Position, I wanted to get them with identification toolbox in matlab (I have a transfer function for the angle-position plant it is :.

Since the motor was originally scrap from a printer I cant really get its parameters on a datasheet I know it is a Jhonson Motor, 36mm diameter 56mm length, 3mm shaft there are this numbers printed on it I can't seem to find any relation to a motor model. 65791, c5324-60024, 392361

image

image

 

I am not sure if the following procedure should have been the way to go for identification.

I made a Matlab Script that would read a word of data sent by the psoc through UART, in this format "a#p#t#x#f" so I get current angle, motor power (voltage%), current position, and time.

working with the time vector I managed to extract an average sampling time of 0.005s,

I had to create a PRBS signal to command the motor so I did it internally with two alternate power settings that are outputed on a random time (The plot doesnt make it a square wave but all the points are on +18 or -18.)

image

image

After this I went into Ident toolbox

after removing Means, trends and filtering and separating the data for evaluation and validation, I got a 97% fit with a box Jenkins (1 1 3 3 0) which should make a reliable model for simulation but If I used the PID parameters on the PSOC It would diverge every time I cant seem to find a solution.

 

I appreciate your help,

some questions..

the embedded system (PSOC) is very fast (the actual sampling time is 0.004s approximately, should I slow it down for the control system to work?? it Doesn't seem right.

All the theory says the PRBS signal should be 1,-1 signal How do I know if the PRBS signal's amplitude and width is good enough for identification??

 

I would like to try other control methods (non-linear) (State space) but I cant seem to get the models from identification.

 

I am not sure if the files are of any use without the model.. If you want to see them let me know.

Attachments:
RBBv2.cywrk.zip
  • Sign in to reply
  • Cancel

Top Replies

  • DAB
    DAB over 10 years ago +1
    Hi Juan, You are probably experiencing data lag time. When you try to correct something dynamic by using a measured position, you have to account for the movement of the object while you are calculating…
  • michaelkellett
    michaelkellett over 10 years ago in reply to juanes.pazj +1 suggested
    Do you have Simulink - if so you can model you controller and the system and the delays in the PSOC - this might be the quickest way to develop an algorithm/controller that works. MK
  • DAB
    DAB over 10 years ago +1
    Juan, I just remembered that the PSOC has an analog comparator as part of its programmable hardware. You can use that to provide near instantaneous correction for the balance circuitry. DAB
Parents
  • johnbeetem
    0 johnbeetem over 10 years ago

    How accurate are those IR sensors for measuring position?  I've seen this experiment done by the late, great Bob Pease using model railroad track as a sensor.  Basically, you use the track as a variable resistor, with the steel ball providing the "slider" connection between the two rails.  The resistance between the rails at one end of the track varies linearly with the position of the ball.

     

    http://electronicdesign.com/embedded/whats-all-ball-beam-balancing-stuff-anyhow

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • johnbeetem
    0 johnbeetem over 10 years ago

    How accurate are those IR sensors for measuring position?  I've seen this experiment done by the late, great Bob Pease using model railroad track as a sensor.  Basically, you use the track as a variable resistor, with the steel ball providing the "slider" connection between the two rails.  The resistance between the rails at one end of the track varies linearly with the position of the ball.

     

    http://electronicdesign.com/embedded/whats-all-ball-beam-balancing-stuff-anyhow

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • juanes.pazj
    0 juanes.pazj over 10 years ago in reply to johnbeetem

    I believe the IR sensors are more stable than the linear resistor because the contact between the ball and the rail is not uniform when rotating, I have filtered the sensors so I think they are good.

    • 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