Real Time Angle Detection for Inverted Pendulum
Mostrar comentarios más antiguos
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 comentarios
Yundie Zhang
el 17 de Mayo de 2020
I suggest you try gaelkim7@gmail com
James Rhodes
el 17 de Mayo de 2020
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Image Processing Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
