Real Time Angle Detection for Inverted Pendulum
Afficher commentaires plus anciens
I am currently trying to develop an inverted pendulum stablisation system using matlab and simulink utilising visual feedback. I have been trying to use 'Image Acquisition Toolbox' with imfindcircles to identify angles, this is what i currently have in place:
- Getting a snapshot of the current video
- Using imfindcircles to locate the main circles on the lever/arm of the pendulum
- Drawing line between those two points
- Drawing a vertical line which can be a static reference to compare the angle between lever arm and vertical line.
- computing angle of the two lines using an equation
- (will have to implement a for loop in which 1-5 is completed to ensure its real-time analysis)
I am struggling to determine the following:
- Will this be viable for a time senstive control system?
- Will image acquisition tool be able to compute these processes near real-time?
- is there anyway in which this can be improved (imfindcirlces can be unreliable at times causing the program to crash)?
Below is a snapshot of the code with its results: (above line 40 is simply lots of comments and using "vid = videoinput('winvideo', 1, 'MJPG_1920x1080');
src = getselectedsource(vid);" to import the files).

The current angle displayed is within 1 degree of error which I believe is acceptable (an if statement has been used for the angle formula for occasions the lever is to the left).
Any help or suggestions would be appreciated. Thankyou!
2 commentaires
Yundie Zhang
le 17 Mai 2020
I suggest you try gaelkim7@gmail com
James Rhodes
le 17 Mai 2020
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Image Processing Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
