Circle detection in a certain position

OpenMV related project discussion.
Iainkw
Posts: 2
Joined: Tue Jan 30, 2018 11:13 am

Circle detection in a certain position

Postby Iainkw » Tue Jan 30, 2018 3:36 pm

Hi everyone,

Let me begin by saying I have no electronic/programming background at all, and this is my first time near anything programmable. I'm a mechanical engineering student working on a group project at the moment.

What I am trying to do is get the camera to detect the hole of a rugby ball in a predefined position, once the hole is in the position the camera would send a signal to an Arduino Uno board, which will trigger some actuators to move. If anyone could point me in the right direction to achieve this it would be most appreciated.
User avatar
kwagyeman
Posts: 1746
Joined: Sun May 24, 2015 2:10 pm

Re: Circle detection in a certain position

Postby kwagyeman » Tue Jan 30, 2018 3:47 pm

Hi, you don't need the Arduino in the the loop. The OpenMV Cam can directly control motors itself.

As for detecting the hole. We have a find_circles() example script which automatically searches the image for all circles and returns a list of them to you. Then you just need to filter out circles which are not in the right place and turn an I/O pin high or low to drive the motor.

Anyway, to start with please setup a test rig with the OpenMV Cam looking at what you want it to look at. Then, please provide me with some details on what you want to drive.
Nyamekye,
Iainkw
Posts: 2
Joined: Tue Jan 30, 2018 11:13 am

Re: Circle detection in a certain position

Postby Iainkw » Tue Jan 30, 2018 4:36 pm

Thanks for getting back to me so quickly.

The reason for the Arduino I was told is because the actuators are 24V pneumatic and relays will be involved.


So this is the general set up (imagine that the picture frame, white tac and emery board are an aluminium frame)
Set Up.jpg
Image 1
Set Up.jpg (353.92 KiB) Viewed 3810 times
This is what I am trying to detect,the hole in the centre.
Ball Valve.jpg
Ball Valve.jpg (201.51 KiB) Viewed 3810 times
What follows is the basic operation:

The camera, attached to one actuator, is in position above the holder for the ball. This holder is an XY table which will be adjusted to ensure the hole is in the correct position.
Elevation view 1.jpg
Elevation view 1.jpg (250.87 KiB) Viewed 3810 times
Once the hole is in the correct position, the actuator with the camera retracts, and the 2nd actuator now extends, inserting a needle into the hole.
Operation.jpg
Operation.jpg (275.57 KiB) Viewed 3810 times

After a certain amount of time has passed, the 2nd actuator retracts, and the camera returns to the home position.
User avatar
kwagyeman
Posts: 1746
Joined: Sun May 24, 2015 2:10 pm

Re: Circle detection in a certain position

Postby kwagyeman » Tue Jan 30, 2018 4:51 pm

Okay, great. So, see the pin control example script in the File->Examples->Board control directly and that's how you can make an IO pin high or low. As for timing, see the pyb module documentation for how to delay for some number of seconds or milliseconds.

To control the actuator you need a relay or some type of amplifier. The OpenMV Cam can drive a wire to 3.3v or 0v. You need to use a transistor to control a relay to control the solenoid.

E.g. https://i.stack.imgur.com/sMX7r.png.

Raw would be 5v, and then you have the 24vdc isolated along with the solenoid on the other side of the relay so it can't break anything. You'd have the OpenMV Cam drive into the resistors going to the transistor.

Note, you can buy circuits that have this all in one.

https://www.sparkfun.com/products/13815

...

Do not connect 24vdc anywhere near the camera except on the other side of the relay. The OpenMV Cam is 5v tolerant... But will explode with 24vdc applied to any of it's pins.
Nyamekye,
User avatar
kwagyeman
Posts: 1746
Joined: Sun May 24, 2015 2:10 pm

Re: Circle detection in a certain position

Postby kwagyeman » Tue Jan 30, 2018 4:52 pm

Please work to get to the point where you can get the OpenMV Cam turning the relay and the solenoid off and on in a loop. Once you've gotten to a point where you have good control over what you need we can move to the vision part.
Nyamekye,

Return to “Project Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest