Show Posts
Pages: 1 [2] 3
16  Forum 2005-2010 (read only) / Scandinavia / Re: Hjælp til Motor styring on: March 29, 2010, 11:46:53 am
Generelt har jeg planer om at jeg vil lægge alle mine notater ud på nettet..

De kommer til at ligge her: http://imgsize.dk/blog/arduino/ - Så kan i jo se om der er noget i kan bruge smiley-wink
17  Forum 2005-2010 (read only) / Scandinavia / Re: Hjælp til Motor styring on: March 28, 2010, 01:46:19 pm
Tak for alle jeres tilbage meldninger, de har faktisk hjulpet mig rigtig meget til at forstå hvordan tingene hænger sammen..

Jeg har læst rigtig meget om, hvordan en H-bridge virker og hvordan det hænger sammen...

så købte jeg motor driver ved electrozone, og fik det også til at virke.. (virkelig en sejer) hehe

Jeg har lave et lille notat, så jeg selv kan huske hvordan det hænger sammen, måske nogen kan bruge den til noget.. her er ihvertfald et link.
http://imgsize.dk/blog/wp-content/uploads/2010/03/L298N.pdf
18  Forum 2005-2010 (read only) / Scandinavia / Hjælp til Motor styring on: March 22, 2010, 12:04:44 pm
Hej

I weekenden var jeg ved at skille en gammel fjernstyret flyver ad for at få motoren.

Planen var at jeg ville til at prøve at forstå PWM og ville så prøve at bruge en motor til det.

Men men, da jeg får min motor sat til min arudino, sker der absolut intet.
Motoren køre normalt fint med 5v men her er der ingen reaktion.

Sådan har jeg sat det sammen


Her er koden:
Code:
const int motorPin = 9;

void setup () {
  pinMode(motorPin, OUTPUT);
}

void loop() {
  analogWrite(motorPin, 255);
  delay(10);
}

Hvad kan jeg have gjort galt, eller hvad kan det være jeg ikke tænker på??

Man kan måske slet ikke sætte en motor direkte i min auduino?

På forhånd tak.
Mads
19  Forum 2005-2010 (read only) / Scandinavia / Re: Nybegynder har brug for hjælp... on: March 17, 2010, 01:18:27 pm
Yes.. Det var lige den der skulle bruge og kombineres smiley

Tak for hjælpen. Det hjalp lige at få et skub i den rigtig retning.
20  Forum 2005-2010 (read only) / Scandinavia / Nybegynder har brug for hjælp... on: March 16, 2010, 06:06:11 am
Jeg fik i går min Arduino, og er lige så stille gået igang med at lege med den..

Men er løbet ind i et lille problem..

Jeg har en diode der blinker, med frekvensen fra et potmeter..
Det i sig selv virker helt som det skal. Jeg har så sat en en knap på, som jeg vil kunne tænde og slukke på..
Det virker fint nok med at tænde, men jeg skal ramme det rigtige tidspunkt i loop'et for at slukke den..

Her er min kode:
Code:
/*
Styr blink af diode med potmeter
*/

int sensorPin = 0;      //Senser på potmeter
int ledPin = 13;        // Led pin igen
int buttonPin = 2;      // Knap
int sensorValue = 0;    // Variabel med sensor reading
int buttonState = 0;    //Knap stadie
int buttonCode = 0;  // Sidste knap stadie

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT);
  Serial.begin(9600);
}

void loop () {
  //Læs værdi fra potmeter og put det i variablen sensotValue
  sensorValue = analogRead(sensorPin);
  buttonState = digitalRead(buttonPin);
  
  if (buttonState == LOW) {
    if (buttonCode == 0) {
      buttonCode = 1;          //Starter blink
      Serial.println("on");
    }
    else {
      buttonCode = 0;          //Stopper blink
      Serial.println("off");
    }
  }


  if (buttonCode == 1) {  
    //Tænd diode
    digitalWrite(ledPin, HIGH);
    //Sluk dioden i den periode som potmeteret angiver
    delay(sensorValue);
    digitalWrite(ledPin, LOW);
    //Vent igen med periode fra potmeter med at tænde igen
    delay(sensorValue);
  }
}

Tænder og slukker jeg på en ordenlig måde? eller kan det skrives bedre??

På forhånd tak
Mads
21  Forum 2005-2010 (read only) / Interfacing / Re: Driving Stepper motor with L298N on: April 19, 2010, 08:05:34 am
Now I just want to be sure.

Is this the right sequense for at stepper motor, witch my LEDs should blik?

x =on
- = off

Wire
1 2 3 4
x - x - (step 1)
- x x - (step 2)
- x - x (step 3)
x - - x (step 4)

and one more.. What kind of diodes do you suggest?? Would the N4001 be okay??

Thanks.
22  Forum 2005-2010 (read only) / Interfacing / Re: Driving Stepper motor with L298N on: April 15, 2010, 02:02:53 pm
You know what.. I think i love the LEDs to smiley-wink

Now I have the LEDs blinking in the right order, and noted it all.. Just in case i forget..
So the next step is to hook it up to my motor.. But I don't think I will do it tonight though, just want to sit and watch the LEDs blinking smiley-wink

I'm confident that it all will work out now..

Thanks

23  Forum 2005-2010 (read only) / Interfacing / Re: Driving Stepper motor with L298N on: April 15, 2010, 12:47:11 pm
Quote
Okay, so with the changes (i.e. GND to Arduino ground) can you drive some LEDs?
Well, you might be right, this is the easiest way to go, cause as you can see i'm not experienced smiley-wink

But thanks for all your help
24  Forum 2005-2010 (read only) / Interfacing / Re: Driving Stepper motor with L298N on: April 15, 2010, 12:37:42 pm
I'm referring to the GND on the 24v power supply.

I think I know what you mean by, tire the GND to the GND on the arduino. But i'm not sure how to do that. I thought it was connected to the VLS, however (if i read the block diagram correctly) I can see that it not.

Is it safe to just put the GND from the 24v and the Arduino in the same row on my breadbard?
25  Forum 2005-2010 (read only) / Interfacing / Re: Driving Stepper motor with L298N on: April 15, 2010, 12:13:17 pm
here is the board i bought: http://www.sparkfun.com/commerce/product_info.php?products_id=9540

but yes, the VLS is V Logic Supply..
26  Forum 2005-2010 (read only) / Interfacing / Re: Driving Stepper motor with L298N on: April 15, 2010, 12:06:13 pm
Well, I think the VS, GND and VLS is correctly connected, but i can see what you mean regarding the sense pins.

But I once had the L298N directly to the Arduino GND on the sense pin, so it had worked before. on a regular motor.

But what im not sure of, can L298N be used on at Stepper motor?
The motor I have is a 24v stepper motor i got from an old Canon printer.
http://www.mitsumi.co.jp/latest/Catalog/compo/motor/m35sp9_e.html
27  Forum 2005-2010 (read only) / Interfacing / Driving Stepper motor with L298N on: April 15, 2010, 11:23:01 am
Now, first of all, i don't know if this even i posible..

But i have this stepper motor, that im trying to run with an L298N driver.

I have connected it this way on the L298N:

OUT1 -> Stepper wire 1
VS     -> 24v +
ENA   -> 5v (arduino)
GND  -> 24v -
CSA  -> Arduino GND
OUT2 -> Stepper wire 2
IN1    -> Digital pin 2
IN2   -> Digital pin 3
VLS   -> 5v (arduino)
ENB   -> 5v (arduino)
OUT3 -> Stepper wire 3
CSB  -> Arduino GND
IN3   -> Digital pin 4
IN4   -> Digital pin 5
OUT4 -> Stepper wire 4

And here is the code:
Code:
#include <Stepper.h>

// change this to the number of steps on your motor
#define STEPS 200

// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 2, 3, 4, 5);

void setup()
{
 stepper.setSpeed(300);
}

void loop()
{
stepper.step(50);
delay(500);
stepper.step(-50);
delay(500);
stepper.step(200);
delay(500);
stepper.step(-200);
delay(500);
}

Now I just can't see what i'm doing wrong.
Maybe some of you can..

Thanks in advance.
28  Forum 2005-2010 (read only) / Interfacing / Re: Help needed for using switch with IR codes on: April 06, 2010, 04:46:15 pm
hehe, wow it was the only combination i haven't tried. - thought i did.. anyway, it is working now..

it worked with the 0x and without quotations...

Thanks a lot for the easy fix..
29  Forum 2005-2010 (read only) / Interfacing / Help needed for using switch with IR codes on: April 06, 2010, 03:41:21 pm
Hi

Im trying to make 10 steps for a servo motor, with the remote for my tv.

So first i found witch code my remote sends on the diffrent buttons. Heres what i got..
Code:
1: 6604CFE0
2: 6604CFD0
3: 6604CFF0
4: 6604CFC8
5: 6604CFE8
6: 6604CFD8
7: 6604CFF8
8: 6604CFC4
9: 6604CFE4
0: 6604CFC0

Next i want to make a switch using the codes I just got..
Heres what i wrote in the loop()
Code:
 if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    switch(results.value) {
      case '6604CFE0':                       //Step 1
        val = map(1, 0, 9, 0, 179);
        myservo.write(val);
        delay(15);
        break;
      case '6604CFE4':                       //Step 9
        val = map(9, 0, 9, 0, 179);
        myservo.write(val);
        delay(15);
        break;  
    }
    irrecv.resume();
  }

Im using the IR Library form Ken Shirriff's blog http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html

However, when i push a button on my remote, it shows in the serial monitor, but my servo does nothing.

What am I missing??

Thanks in advance.
30  Forum 2005-2010 (read only) / Exhibition / Re: Lawnmower robot on: December 14, 2010, 06:22:19 am
Just go to http://imageshack.us/ and upload your pic, and copy the forum code..
That's the way I do it smiley-wink
Pages: 1 [2] 3