heliostat project

hey, again. The heliostat is working very smooth now. Thanks again for all your help. If sb. is interested I can share the code and pictures of the setup.

I have another (little unreleated) question: Is it possible to use the ide to process still images that are not taken by the openmvcam for testing purposes and if that is possible, is there a size limit? I would like to detect blobs for example, and save the image again after processing with drawn rectangles and so on.

If you right click on the image the Ide will give you a dialog to save the image on your PC. That is all it does.

Also, please share code and pictures.

Thanks, but can I also use different still Images from a local source as Input instead of the camera’s own stream?

like instead of

img = sensor.snapshot()

do smth like

img = ./pictures/test.tif

?

Ibrahim, can you comment on this? I think there’s a way to load images into the frame buffer.

Yes but right now it’s a hack, and you’re limited to small images because they’re allocated on the heap.

img = image.Image("test.pgm")
sensor.set_windowing((0, 0, img.width(), img.height()))
img.copy_to_fb()
sensor.snapshot()

The last snapshot is needed to flush the FB.

The last snapshot flushes the FB to the Ide. You should do the image manipulation before calling that.

thanks a lot I’ll try it out :slight_smile:

hi, now with the sun back in town, I started working on my project again. I worked and tweaked the code quite a lot, and the perfomance (in terms of accuracy) is getting better, but it is still not perfect. The heliostat looses the sunpoint over a period of approx. 1h at the moment. my code is attached. (post1.txt)

I’m not sure if further tweaking the gain values will do the ultimate trick, because the distance of servo controlled heliostat and the openmvcam is not always the same. Maybe I’d need a second control loop that improves the accuracy of the first “guess”?
Something like in post2.txt ?

Any thoughts or ideas would be appreciated!

this is how the setups looks like



| \ |< |
|
|
|--------------------------------------------

heliostat mirror cam target(wall)



thanks!
post2.txt (1.28 KB)
post.txt (3.47 KB)

Hi, it looks like your not filtering the output of find blobs. You code seems to look at whatever the first blob is found. However, find blobs returns blobs in a unsorted manner. You should look for the maximum sized blob.

Um, anyway, can you classify what you mean by the camera looses the sun for 1h?

Hey, thanks!
Ah okey, that sounds like a good Idea. Can you tell me how to do that? Should I compare blobs for pixel size? The thing is, because I am using an VIS Block/IR-Pass filter, the image of the camera is black until a reflection of sunlight enters the frame, so there really should be only one blob, but maybe this would still help, because of lensflares or little dust particles or anything that might be interfering?

Well at the moment the machine stops when the search mechanism manages to adjust the mirror in a way that the reflection shows up in the frame. Then the system usually centers the reflection in the (seemlingly) center of the image frame. But over approximately one hour the reflection slowly wanders to the left and out of the frame. (the directions for the gain values (-/+) seems to be correct though) now, I think maybe the performance can be increased by perfecting the gain values further, but as the system will not always be set up in the same way (distance between cam and heliostat will be different, and the same movement will make different effects on the reflection every time?) I thought that maybe a second “finetuning” control might be necessary to assure that the reflection will stay in one place, that is the center of the frame. (and in my dream world: over the entire day!!) :slight_smile:

largest_blob = max(blob_list, key = lamda x: x.pixels())

The above returns the largest blob in pixels from the image from a list of blobs which find_blobs returns.

As for the gain control stuff. You should probably just constantly be tracking whatever object you see and trying to center of it. Maybe remove all the time outs in your code.

Thank you so much! The timeout things are there because I don’t want the system to start blindly searching if a cloud should obscure the reflection for a minute or someone walks through the image etc…but i will deactivate them for now

so I can just adress max_blob[1] for x and max_blob[2] for the position, right?

Yeah, note that we added methods to get blob values by name now. So you can just do .cx() and .cy() to get the centroid.

ah thanks ok, that’s nice.

I got to wait for the sun to show up now to try it again.

Btw (if anyone wants to use this thread)
little typo :wink:
largest_blob = max(blob_list, key = lamda x: x.pixels())
has to say lambda

I tried again with your suggestion but It seems to be the same problem. I’m not sure If I did it right though? :neutral_face:

edit:
Error message
“AttributeError: ‘tuple’ object has no attribute ‘pixels’”

it seems like there is no column “pixels” in blob_list?
maxblob.txt (991 Bytes)

Um, if your firmware is old this is the case. Have you updated your firmware?

yeah now I have now, thanks! the code works now, but is it possible that the sensor setup takes longer with the new firmware? I had to put the servo standard setup in the beginning of my code because It took too long before the servo crtl kicked in (and one of the servo is moving spontaneously when there is no signal sent)

unfortunately now I have to wait a few days before I can try it out again because there is no sunshine :confused:

Hi luik,

If you ever document this project or make a video, please let us know and we’ll publish on our blog.

hi there!

I’m really planning to do that once it really works! :slight_smile: thanks for all your help and the great work you guys are doing!