Show Posts
Pages: [1] 2
1  Forum 2005-2010 (read only) / Troubleshooting / Re: Wrong going into while-loop on: May 07, 2010, 01:50:36 pm
Arghh.. I tried so many things and it's that - too dumb! smiley
Thank you!

[edit]Shouldn't the 'Verify'-action report that as bug?[/edit]
2  Forum 2005-2010 (read only) / Troubleshooting / Wrong going into while-loop on: May 07, 2010, 01:25:13 pm
Hi all
I'm working on my first Arduino-project. It's realy funny, but unfortunately I recently got a problem.
My goal to make a crosshair out of lightsensors. A laser beam aims in the middle of it. When the laserlight exits the middle of the crosshair (-> hit a lightsensor) it should give a signal, that an engine (actually represented by a light) can move the light back to the right place.
I did a screenshot while I was playing around with it in the workroom.
http://fabitosh.bplaced.net/arduino/screenshots/whileloop.png

After that I updated my commentaries in the code at home, I hope it's a bit better explained due to them. (on the screenshot are still the old ones, sorry!)
Here are the important parts of the code for now:
Code:
#define LEDa   13 // the pin for the LEDa

int photocellPin1 = 1;
int photocell1; // lightintensity from photocell 1
int photocell1old; // old value of the lightintensity

// int dif1; // change of the lightintensity


void setup() {
  pinMode(LEDa, OUTPUT);
  // Sensors are automatically INPUT
  Serial.begin(9600);
}

void loop() {
  photocell1 = analogRead(photocellPin1); // read the value from the sensor and save in variable photocell1 - The higher the value of photocell1, the more light shines on the photocell

  
  Serial.print("P1 ="); Serial.print(photocell1); Serial.print(" | Dif1 = "); Serial.println(dif1); // current photocell input

  
  while(photocell1 > 500); // activate reactor (light, engine) as long as the light is shining on the photocell
  {
    Serial.println("In der while-Schleife!");
    digitalWrite(LEDa, HIGH);
    photocell1 = analogRead(photocellPin1);
//    dif1 = photocell1 - photocell1old;
  }
  digitalWrite(LEDa, LOW); // stop reactor (light, engine)

  delay(1000);
  Serial.println();
  
}

The thing that confuses me is that the program goes in the while-loop, even if 'photocell1' is smaller that the required 500. When it gets bigger than 500 the program just stops and doesen't do anything more.
What's the fault here?
3  Forum 2005-2010 (read only) / Deutsch / Gute Hardwarehändler on: July 14, 2010, 12:48:52 pm
Hallo
Welche Händler bieten eine gute Auswahl von Quadrant-Photodioden und Schrittmotoren an? Die Produkte sollten natürlich möglichst preiswert und vor allem zuverlässig liefern.
Optimal wäre ein Shop um den Bodensee welcher kompetente Beratung bieten würde.
Wäre froh um eure Tips!  smiley

Edit: Ich Depp hab den angepinnten Thread übersehen, werde mir natürlich den zuerst anschauen - Sorry!
4  Forum 2005-2010 (read only) / Interfacing / Re: Project: Stabilisation of a laserlight on: October 11, 2010, 09:44:59 am
Ah, could solve my Arduino problem now. Seems as if I connected my 2-axis joystick wrong. It's wiring caused the problem.
Fortunately the board is still fine.

Thanks for the tip with the 4051 multiplexer. That's exactly the thing I am looking for.
Today I went to the 'Conrad' (electronics seller) and bought new servos where you can set the angle and not the velocity via Arduinoprogram. Unfortunatelly the salesman had no clue of the 4051 multiplexer, so I need to order them from the internet.

focialist: Sounds like a promising way. Thanks for sharing. Might try it out after finishing it with the current one. smiley
But I hope you understand that I won't give up the way I already worked on for many hours. I'm currently just looking for a working possibility, not for the perfect one.  smiley-wink
5  Forum 2005-2010 (read only) / Interfacing / Re: Project: Stabilisation of a laserlight on: October 08, 2010, 07:07:26 am
Hey guys
I finished the written part and can completely focus on the model now. The written part is in German. But for the ones which are interested I uploaded it here:
http://fabitosh.bplaced.net/arduino/Der%20kontrollierte%20Weg%20des%20Lichts.pdf

Now to the more serious part. After having the Arduino Duemilanove connected with the computer for about an hour and experimenting a bit I couldn't upload the new program anymore. The serial port isn't found anymore.


The voltage regulator (http://wiki.elphel.com/images/7/70/ArduinoDiecimilaComponents.jpg) was extremely warm. I unplugged the USB-cable and waited around an hour. It still didn't work, but the voltage regulator is getting warm again. May it be that the Arduino has too much power because of the photovoltaic cells and overheated?
I also realized that the engines often did some short moves without the order to do so.

And an other question. What would be the easiest way to get more analog in pins?
6  Forum 2005-2010 (read only) / Interfacing / Re: Project: Stabilisation of a laserlight on: August 26, 2010, 11:55:00 am
Quote
You seem to have these connected as if they were photo-sensitive resistors.  Aren't they photo-voltaic cells?  They should generate some small voltage upon exposure to light.  What happens if you just connect the - side directly to ground and the + side directly to an Arduino analog input pin?
:-[
You're my hero! smiley That was exactly my fault. Thank you very much, I will remember to think about the wiring better before I start to set up everything.
Will update the topic when I got a new error or when the project reached its finish (It will hopefully be the 2nd).
7  Forum 2005-2010 (read only) / Interfacing / Re: Project: Stabilisation of a laserlight on: August 25, 2010, 03:58:44 pm
I used a 5th 33k[ch937]-resistor now, but it's still the same. The input values jump around and I can't read a difference when the laser is beaming on a solar cell.
I did a wiring diagramme, maybe this shows the error:
http://fabitosh.bplaced.net/arduino/schaltplaene/
Choose either the .eps or the .pdf-file.

I'd be really glad if you could help me, I got no clue.
8  Forum 2005-2010 (read only) / Interfacing / Re: Project: Stabilisation of a laserlight on: August 24, 2010, 08:38:41 am
Quote
Nice looking experiment.  Good show!
Thanks! smiley

Quote
You talk about photo-transistors, but the devices in your photo look like photo-voltaic cells?
True, sorry they are kind of solar cells. The datasheet to it you can find on this link:
https://www.distrelec.com/ishop/Datasheets/olIXYS_Solarzellen_XOB17_EN.pdf

On my screenshot you can just see the values which I did without beaming on the solar cells. But the result is almost the same when I beam on them too. (Laserlight wavelength: 650 to 680 nM (10^(-9)M))
The strange thing is that I tried out three of them and could clearly read from the values when the beam was on them.

Quote
Couldn't you implement a "micro-stepping" scheme, either by using a driver chip that implements it, or by building a custom driver that can output a varying voltage to the coils (instead of the regular on/off scheme), to allow you to position the rotor between coils...?
Sounds promising and complex. smiley-wink I will try to finish the project first with the Servos I got (http://www.adafruit.com/index.php?main_page=product_info&cPath=34&products_id=154) and see if it would already work when I move the laser slowly. If that works I will maybe try to improve other things. But first I need to come to reach a finish (deadline next Monday).

Quote
Yes, but that would quadruple the complexity of the project and Fabitosh seems to have his hands full already.
Very true. But I'm still having fun smiley My written part will be on German, but I will link it here too when I've finished for the ones who are intersted and having a bit German reading skills.

I will try to connect an other 5th resistor (40k[ch937]) and just try to find the error. But if you already know it I'd be glad if you telled me smiley-wink
Thanks for your effort!
9  Forum 2005-2010 (read only) / Interfacing / Re: Project: Stabilisation of a laserlight on: August 23, 2010, 11:38:56 am
Okay again thanks for your help.
I finished the constructing part yesterday and got my hardware ready. A small impression:




I just wanted to test all the phototransistors. I connected them the same way as I found it on the website (-> see Screenshot). The outcome and the programming code is also shown on it. http://fabitosh.bplaced.net/arduino/screenshots/phototransistor_inputs.jpg
Even tough the light intensity was stable the inputs jumped around extremely from ~400 to ~550. What could be the reason for that? I used 33k[ch937] resistors.
An other strange thing is that I get values from Pin 5, even if I absolutely didn't connect anything to this Pin (need to organize one more 33k[ch937]-resistor). Because it sounds so strange I felt like I had to make a photo of it as proof.  smiley-wink
http://fabitosh.bplaced.net/arduino/beamstabilisation/Pin5empty.jpg
How can that be?

10  Forum 2005-2010 (read only) / Interfacing / Re: Project: Stabilisation of a laserlight on: July 22, 2010, 01:04:08 pm
Quote
The only question is why?
In our school we could choose a topic we like and make a big work about it. I liked to create a small CSP-Tower (http://upload.wikimedia.org/wikipedia/commons/5/50/PS10_solar_power_tower_2.jpg). But for the creation of an heliostat would have meant much work and many hours for a friend who could have done those heliostats.
We decided to track a laser beam instead of the sun and we did those changes. I hope to get some expirience out of this project that I can realize later other maybe more complex things.


Isn't my project just a galvanometer (just without the lenses)? If I bought that I almost had no work. So I could call my aim 'Make your own galvanometer'.

Quote
Unless you have an uneven track, not clear why you need a vertical-axis mirror, unless that is part of the experiment?
It was mainly an option to develop the system if I achieved the first aim.

Unfortunatelly (bad time) I go to holiday on Saturday. I'd like to order the needed components tomorrow so that I can start shortly after my vacation.

11  Forum 2005-2010 (read only) / Interfacing / Re: Project: Stabilisation of a laserlight on: July 22, 2010, 08:14:42 am
Picutes say more than words. I did a liddle sketch.
http://fabitosh.bplaced.net/arduino/beamstabilisation/Gesamtskizze_web.jpg
That's what I'm thinking of actually. I already tried a prototype of the trail: http://fabitosh.bplaced.net/arduino/beamstabilisation/legotrail.jpg
I hope it's more clear now smiley
Quote
To get a finer, smoother adjustment than a direct mount to a stepper,  you could mount a cam to the stepper (or a servo),  and use that to tilt a pivoting laser mount.  Or use the stepper to drive a screw (or even a micrometer, for really fine control).
This sounds great! Can you show me a project where it was used or an explanation how it's done? It's hard to imagine that just from those words (as beginner as I am).

Quote
hobby servo can make ~426 discrete movements with in its ~190 deg rotation range
If I calculated right this would give a step angle of 0.446 degrees.
The 'best' stepping motor I found should also be able to make steps 0.45 degrees. (http://www.ec-motion.com/index.php?id=12&L=1) So the servo wouldn't be a serious advantage (especially because it's normally more expensive). I'm confused  :-?

Your main idea sounds very interesting. I'm not sure if I understood the other comments right, but if it is possible to make the motors more precise and still having the angle of 180 degrees I'd prefer that way (less mirrors and places to make mistakes). Otherwise I could try this out.

Okay, summarised:
  • How do I 'make' the motor finer than the step of 0.45 degree? Is this possible?
  • Which lightsensor should I use? (not too expensive and avaible in Europe if possible)

Thanks again for your effort! smiley

12  Forum 2005-2010 (read only) / Interfacing / Re: Project: Stabilisation of a laserlight on: July 21, 2010, 04:12:14 pm
Sorry I didn't know you need the information where I'm coming from. I updated that now. The two examples you gave would have also been a nice way to achieve my aim, thanks for sharing.
But the way using stepping (/servo) - motors seems to be a cheaper way for me in Switzerland and also attracts me a liddle more.  

Thanks for your explanations Mike, it's a bit more clear. Due to my lack of expirience with this domain I'm still not completely sure if I understood right. Do you have an example from it's usage? But it seems as if it would be enough to order the Stepping Motor and the Adafruit Motor/Stepper/Servo Shield. Maybe I'd get it easially with the components in my hands.

I will google for the keywords you gave me. Thanks guys you're really helping me getting ahead with my plannings and avoiding mistakes smiley
13  Forum 2005-2010 (read only) / Interfacing / Re: Project: Stabilisation of a laserlight on: July 21, 2010, 07:56:51 am
Thanks for your clear words. The combination of a coarse stepping motor and a small quadrant photodiode doesen't fit together, because the motor wouldn't always be able to direct the beam exactly on the mirror.
I didn't understand how the servo motor was connected to the stepping motor in your example, sorry. I thought of using a servomotor instead of the stepping motor which would have the possibility to direct the laserbeam always on the quadrant photodiode. Could that be accurate enough?
The other idea I had was the usage of a selfmade panel of photosensors (those were as close together as possible) instead of the quadrant photodiode. Then the stabilisation would not have to be perfect (the beam wouldn't always hit the 'main photosensor') but it wouldn't let it spread as much as it would normally.

Is one of those possibilities better?
14  Forum 2005-2010 (read only) / Interfacing / Re: Project: Stabilisation of a laserlight on: July 21, 2010, 04:07:22 am
Was my English too bad?
I'd be happy if you could confirm that the combination of the stepper motor and the Arduino shield fit together and every tip to the usage of the quadrant photodiode.
15  Forum 2005-2010 (read only) / Interfacing / Project: Stabilisation of a laserlight on: July 20, 2010, 06:46:44 am
Hello

My first real Arduino project is to stabilise a laser beam by controlling a stepper motor on which a mirror is attached (1 dimension to start with). The laserlight changes the position where it beams from respectively the direction and the stepper motor should change the mirror in a position so that the reflected beam goes to the same position.
The reflectet laser beam points on a quadrant photodiode which realizes the movement of the beam respectively the movement of the laser and gives that information to the Arduino which calculates the needed movement of the stepper motor.
On the second stage I could add a second mirror for the second dimension.

For that I found a stepper motor with an angle cut of 0.45 degrees ( http://www.ec-motion.com/index.php?id=12&L=1 ).
Is it possible to run it with this shield ( http://207.58.139.247/index.php?main_page=product_info&cPath=17_21&products_id=81 )?
And where should I order this stepper motor? Unfortunatelly I didn't find a marchant. Is it the best solution to phone EC Motion?

My second problem is that I have no clue on what specifications I should check by the quadrant photodiode. How can I adapt it to the Arduino and use the signal?

I'd be glad if you helped me smiley Already thanks for reading it. I hope my English was more or less understandable.
Pages: [1] 2