loading
 
Maze Solver
Sai Yamanoor from United States  [2 posts]
12 year
Hi,

I was inspired by the maze solver to build one of my own. But I would like to do it using two tools so that I could gain experience in both namely RoboRealm and OpenCV. I have finished constructing the maze but I dont know how to do the image processing part. I started with opencv as I have more experience in it than roborealm. I am able to track the ball as well as the trajectory shown in the maze. But I do not know how to use the track information to move the ball. Whatever I try to do, my ball just rolls back and forth. I am trying to control the ball at the same place. I want to implement it in robo realm as well. I have no clue how to proceed. I am looking forward to hear your thoughts

 
Anonymous 12 year
Sai,

It sounds like you may not have a rapid enough feedback loop between the vision and servo controls. When this happens you create an oscillation that could be what is causing your ball to wobble back and forth. What fps are you getting for the vision part?

I'd check that your current setup is able to even achieve this task. Can you connect the servos to a joystick and see if you can even manually move the ball in the right way? Your servo steps would need to be sufficient not to overcompensate on movement otherwise this setup will most likely fail.

As another test, stick the ball off to one side of the line with a bit of sticky tape and ensure that the final device state is leaning in the right direction. Repeat that for a couple more locations just to be sure when stationary the system is performing correctly. If not fix that before trying a moving ball.

STeven.
Sai Yamanoor from United States  [2 posts] 12 year
Hello Steve,

Thanks for the quick reply. In order to ensure that my feedback loop is fast enough, I wrote a multithreaded code myself. My webcam frame rate is 30 fps. My main concern is my ball spins away even for a small tilt in angle. So the problem of ball moving back and forth happened when I wrote a single sequence code.

Now, my code is multithreaded. My motor controls are responsive enough. I am not sure how to transform ball coordinates into stepper motor commands i.e How do I correlate ball coordinates to stepper motor angle of turn calculation and implement a PID loop?

I am also clueless about writing an algorithm to make it follow a line

Sai
Anonymous 12 year
Sai,

As mentioned before ... start small. Pick just one thing and focus on that without concern for anything else right now. What I would do is to again try to control the ball well enough to keep it on the line ... worry about moving it along the line later.

The PID loop is not a typical one using encoders, etc. What you need is a visual PID loop where when you move the servo by a little the visual feedback need to be quick enough to tell the servo to move back or to another position. So start with one servo on a single axis and confine the ball to roll just in that axis. Then try to use a single servo to 'balance' the ball on the spot which would be considered to be part of the line. Using one servo should be easier than 2 but is related to using 2.

Can you get the ball to roll to a particular spot using just one servo with the other axis being controled (i.e. think of the ball rolling along a grove where the grove prevents it from rolling in the X direction but can move freely in the Y).

The trick to robotics is to start simple and learn as you go.

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index