Arduino Forum

Topics => Robotics => Topic started by: cutebuddy6 on Feb 03, 2012, 12:12 pm

Title: Steering Movement Problem
Post by: cutebuddy6 on Feb 03, 2012, 12:12 pm
I am using a scrap ride on jeep i have connected my arduino board to L293 which is an H bridge IC  but my steering is not moving i am using two 6V 10Amp Batteries in series it not moving kindly guide me
Title: Re: Steering Movement Problem
Post by: johnwasser on Feb 03, 2012, 04:36 pm
Connect a meter to the H-bride inputs to see if you are driving them properly.  If not, fix your code.
Title: Re: Steering Movement Problem
Post by: keeper63 on Feb 03, 2012, 11:28 pm

Connect a meter to the H-bride inputs to see if you are driving them properly.  If not, fix your code.


"Scrap ride on jeep"? L293?

It sounds like the OP is (somehow) expecting to be able to control a....

You know - before I shoot my mouth off much - maybe the OP can give us some details:

1. What kind of "scrap ride on jeep" is this thing?
2. What are the specs of the motors involved?
3. Maybe some pics, some schematics, maybe some code - something?

I mean - for all I know the OP is trying to drive a large 5 amp gear motor using his L293; that ain't gonna work well...
Title: Re: Steering Movement Problem
Post by: zoomkat on Feb 04, 2012, 12:04 am
How does a L293 make a stearing wheel turn?  :~
Title: Re: Steering Movement Problem
Post by: keeper63 on Feb 04, 2012, 06:25 am

How does a L293 make a stearing wheel turn?  :~


I have a feeling that the OP is trying to control some largish gearmotor of dubious specs using an L293 to actuate the steering on a Barbie Powerwheels (or similar) Jeep; given that the OP is using 12 volts, its likely not the smaller 6 volt Jeep, but the larger "full size" one...

If this is the case, then the motor used is likely needing waaaay more than the 1 amp the L293 can provide (if the L293 hasn't had its magic smoke liberated)...
Title: Re: Steering Movement Problem
Post by: zoomkat on Feb 04, 2012, 11:38 pm
The below discussion might sum up some of the issues.

http://arduino.cc/forum/index.php/topic,87167.0.html
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 05, 2012, 09:12 pm
thanks but i am done with this i have got a mechanical Issue
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 07, 2012, 09:11 pm
can any body tell me why my board is getting reset while i move the steering
Title: Re: Steering Movement Problem
Post by: johnwasser on Feb 08, 2012, 01:00 am

can any body tell me why my board is getting reset while i move the steering


1) Programming error
2) Insufficient RAM
3) Electrical problem such as voltage drop.
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 08, 2012, 07:38 am
293291)Programming Error
-->the code is working fine
2)Insufficent RAM
-->What will RAM do when i am Moving the code
3) Electrical problem such as voltage drop.
-->this might be the issue because with the Ride on Jeep Motor you cant use L293 because the motor requires More Power than it.
we developed a relay logic for it to give the direct power to the steering Motor but its getting reset
Title: Re: Steering Movement Problem
Post by: AWOL on Feb 08, 2012, 08:52 am
Quote
->What will RAM do when i am Moving the code

What does this mean?
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 08, 2012, 03:20 pm
Is Ram concerned with the following issue?

---> i think its the issue of Voltage drop
because -->the when it on Moving Left it require a Lot of power to move it i think that the motor and the relay is Producing Back emf i have place diode for it and don't know the other concerned issue
Title: Re: Steering Movement Problem
Post by: johnwasser on Feb 08, 2012, 06:17 pm

1)Programming Error
-->the code is working fine


Excellent!  Glad you found and fixed the problem.
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 08, 2012, 07:36 pm
well but my Arduino is getting Reset after each turn
Title: Re: Steering Movement Problem
Post by: AWOL on Feb 08, 2012, 07:56 pm
Oh.
Is that A Bad Thing?
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 08, 2012, 08:02 pm
yes but Now my IC is not working its not Loading the Program
Title: Re: Steering Movement Problem
Post by: johnwasser on Feb 09, 2012, 01:43 am

yes but Now my IC is not working its not Loading the Program


that Is unfortunate.  Time To replace That Ic.
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 09, 2012, 06:12 am
i want to now what i have done wrong with my arduino that my IC is not working
Title: Re: Steering Movement Problem
Post by: AWOL on Feb 09, 2012, 08:45 am
Please, everyone, hands on the ouija board.
Title: Re: Steering Movement Problem
Post by: johnwasser on Feb 09, 2012, 03:36 pm

i want to now what i have done wrong with my arduino that my IC is not working


Me too!
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 09, 2012, 09:29 pm
thats a good Question John
But i have done some work to see my IC is working but my IC is doing good on My friends Board
Why its Not working on my Board

Title: Re: Steering Movement Problem
Post by: johnwasser on Feb 09, 2012, 10:14 pm

thats a good Question John
But i have done some work to see my IC is working but my IC is doing good on My friends Board
Why its Not working on my Board

That question brings us back to Reply #8:

1) Programming error
2) Insufficient RAM
3) Electrical problem such as voltage drop.
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 10, 2012, 09:50 am
i think that Programming is not the Issue the Voltage Drop is the Issue because i have made my own arduino On PCB
what should i check Transistors,Resistor or capacitor
Title: Re: Steering Movement Problem
Post by: AWOL on Feb 10, 2012, 10:00 am
I'd try to unstick your shift-key too.
Title: Re: Steering Movement Problem
Post by: keeper63 on Feb 10, 2012, 03:33 pm

the when it on Moving Left it require a Lot of power to move it i think that the motor and the relay is Producing Back emf i have place diode for it and don't know the other concerned issue


Please - post some pics of your setup, your board, your schematic, your code...!

Are you saying it takes more power to move it to the left than to the right? If it is the same motor, that could be a mechanical issue?

Do you have decoupling caps on your Arduino board?

Are the relays identical to each other? How are they wired (once again - pics and a schematic could help us immensely)...?

If the motor is producing a lot of back EMF (or EMF in general - do you have caps across the terminals, and to the case of the motor?) - have you measured the noise using an oscilloscope (mainly between the line from the Arduino and the Arduino's ground) - to see if any back EMF is being injected in some manner that could cause a reset?

Does the system work correctly when "toggled" by hand - that is, when applying 5 volts/ground simulated HIGH/LOW to the transistors that control the relays (just like the Arduino would)? Have you tried using an optocoupler (well, probably two in your case - one for each relay) to completely isolate (both signal and ground) the Arduino from the motor controller?
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 10, 2012, 04:10 pm
ok

I want to know why my board is getting reset i have attached the circuitry with it
Title: Re: Steering Movement Problem
Post by: AWOL on Feb 10, 2012, 04:16 pm
How are those relays supposed to work?
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 10, 2012, 04:23 pm
when the my Control will send high to the ULN2003 it will pass it to relay and the following relay will switch to ON

-->if the Right relay will On the motor will run clockwise
-->if the Left motor will get on the Motor will run anti-clockwise
Title: Re: Steering Movement Problem
Post by: AWOL on Feb 10, 2012, 04:33 pm
I think there is much still missing from your schematic.
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 10, 2012, 05:25 pm
no this is it

you can tell me if i am missing
Title: Re: Steering Movement Problem
Post by: AWOL on Feb 10, 2012, 06:30 pm
Look carefully at the relays.
Tell me how they're supposed to work.
Think "electrical circuit".
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 10, 2012, 06:37 pm
dear if voltage is applied to the diode this will pass the voltage to the relay and motor will be connected and if the voltage gets off pin get disconnected and the inductor in the relay will be dischrged that'll produce back emf so for that i have placed a diode for that
Title: Re: Steering Movement Problem
Post by: AWOL on Feb 10, 2012, 06:41 pm
Most relays I've seen need at least two wires connected to them to energise the coil.
That's why I said "think electrical circuit".

( I hope this thread isn't going to degenerate into another "pulling teeth" sessions)
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 10, 2012, 06:45 pm
well i don't understand what you just said but what do you mean by two wires
Title: Re: Steering Movement Problem
Post by: AWOL on Feb 10, 2012, 06:49 pm
How does your "circuit" allow current through the relay coils?
Title: Re: Steering Movement Problem
Post by: johnwasser on Feb 10, 2012, 06:58 pm

Think "electrical circuit".


You may be asking a bit much. :(
Title: Re: Steering Movement Problem
Post by: johnwasser on Feb 10, 2012, 07:01 pm

you can tell me if i am missing


You should put Ground symbols on all of the parts that are connected to Ground.  Current won't flow into the relay coils unless the other side of the relay coil is grounded.
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 10, 2012, 08:55 pm
i have made modified the circuitry
Title: Re: Steering Movement Problem
Post by: keeper63 on Feb 10, 2012, 09:12 pm

i have made modified the circuitry


Why did you ground pin 9? That ain't gonna get you very far...

/pulling teeth, indeed! :D
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 10, 2012, 09:14 pm
i have not grounded the 9th but the 8 is grounded
Title: Re: Steering Movement Problem
Post by: keeper63 on Feb 10, 2012, 09:24 pm

i have not grounded the 9th but the 8 is grounded



My bad - was reading your schematic wrong... :)
Title: Re: Steering Movement Problem
Post by: AWOL on Feb 10, 2012, 09:55 pm
Still not seeing very much decoupling or common grounds.
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 10, 2012, 10:00 pm
if u can identify it with arrows or circle
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 11, 2012, 09:03 am
dear this is the circuit thats completed and why its not working keen to know it
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 11, 2012, 10:02 am
let me Explain you when it gets restarted/reset

when i say my steering to go Left it goes to left and when it starts to go left it restarts

and when its already left it doesnot restart

if i say it to go left and its turns the steering on left then its also get restarted

tell me please
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 11, 2012, 10:35 am
here is the code that i am using
Code: [Select]
const int potPin = A0;

const int leftMotor = 10; //PWM pin to the L293
const int rightMotor = 9; //PWM pin to the L293

bool isLeft()          {
  return (analogRead(potPin)/4) < 14;
}
bool isLeftOfCenter()  {
  return (analogRead(potPin)/4) < 119;
}
bool isRightOfCenter() {
  return (analogRead(potPin)/4) > 133;
}
bool isRight()         {
  return (analogRead(potPin)/4) > 245;
}

void motorStop() {
  digitalWrite(leftMotor, LOW);
  digitalWrite(rightMotor, LOW);
}
void motorLeft() {
  digitalWrite(leftMotor, HIGH);
}
void motorRight() {
  digitalWrite(rightMotor, HIGH);
}


void setup() {
  Serial.begin(115200);
  Serial.println ("Entering setup.");
}

void loop()
{
  if (Serial.available() == 0)
    return;

  switch (toupper(Serial.read()))
  {
  case 'L':
    Serial.println("New command: L");
    if (isLeft())
      Serial.println("Already Left");
    else
    {
      Serial.println("Heading Left");
      motorLeft();
      while (!isLeft()) /* JUST WAITING */;
      motorStop();
      Serial.println("Is now Left");
    }
    break;

  case 'C':
    Serial.println("New command: C");
    if (isRightOfCenter())
    {
      Serial.println("Heading Left toward Center");
      motorLeft();
      while (isRightOfCenter()) /* JUST WAITING */;
      motorStop();
      Serial.println("Is now Centered");
    }
    else
      if (isLeftOfCenter())
      {
        Serial.println("Heading Right toward Center");
        motorRight();
        while (isLeftOfCenter()) /* JUST WAITING */;
        motorStop();
        Serial.println("Is now Centered");
      }
      else
        Serial.println("Already Centered");


    break;

  case 'R':
    Serial.println("New command: R");
    if (isRight())
      Serial.println("Already Right");
    else
    {
      Serial.println("Heading Right");
      motorRight();
      while (!isRight()) /* JUST WAITING */;
      motorStop();
      Serial.println("Is now Right");
    }

    break;

  }  // end of switch on direction

}  // end of loop
Title: Re: Steering Movement Problem
Post by: johnwasser on Feb 11, 2012, 02:09 pm
Well, the code looks good (possibly because I wrote it for you).

What does the output on Serial Monitor look like?
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 11, 2012, 02:18 pm
well its get restarted after every two command or one command i send through serial monitor
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 11, 2012, 02:21 pm
i have Posted the schematic and what if i modify the code as
Quote
void setup() {
  Serial.begin(115200);
  Serial.println ("Entering setup.");
  pinMode(leftMotor, OUTPUT);
  pinMode(rightMotor, OUTPUT);
}
Title: Re: Steering Movement Problem
Post by: nickgammon on Feb 11, 2012, 09:38 pm

-->What will RAM do when i am Moving the code


I've been sent a personal message by CuteBuddy6 to ask for more help. Please don't.

I don't understand this sort of talk. Are you asking what the RAM will do if the buggy moves?

Oh. I see we are up to page 4.

Almost certainly the program is restarting because of electrical issues. To test disconnect the buggy and see if it restarts. The circuit you posted doesn't seem (to me) to have the Arduino in it.

You seem to be completely incapable of responding to direct questions, such as:


What does the output on Serial Monitor look like?



well its get restarted after every two command or one command i send through serial monitor


How about replying?

What Do You See In The Serial Monitor????? Copy and Paste. Don't Just Describe It.
Title: Re: Steering Movement Problem
Post by: johnwasser on Feb 12, 2012, 12:14 am

What does the output on Serial Monitor look like?


Perhaps I should rephrase that. :(

cutebuddy6, please start your sketch, start the Serial Monitor, try sending the commands L, R, C, R, L,  C.  Then copy all the text from the Serial Monitor window and paste it into a reply here.
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 12, 2012, 09:20 am
Quote
New command: L
Heading Left
Is now Left
New command: R
Heading Right
Is now Right
New command: C
Heading Left toward Center
Is now Centered
Entering setup.
New command: L
Heading Left
Is now Left
New command: R
Heading Right
Is now Right
Entering setup.
New command: C
Heading Left toward Center
Is now Centered
New command: L
Heading Left
Is now Left
New command: R
Heading Right
Is now Right
Entering setup.
New command: L
Heading Left
Is now Left
New command: C
Heading Right toward Center
Is now Centered
Entering setup.

here is what i get on serial Monitor
Title: Re: Steering Movement Problem
Post by: johnwasser on Feb 12, 2012, 02:41 pm

New command: L - Heading Left - Is now Left
New command: R - Heading Right - Is now Right
New command: C - Heading Left toward Center - Is now Centered
Entering setup.

New command: L - Heading Left - Is now Left
New command: R - Heading Right - Is now Right
Entering setup.

New command: C - Heading Left toward Center - Is now Centered
New command: L - Heading Left - Is now Left
New command: R - Heading Right - Is now Right
Entering setup.

New command: L - Heading Left - Is now Left
New command: C - Heading Right toward Center - Is now Centered
Entering setup.


So it has nothing to do with going Left specifically because it happens randomly after L, R, or C.  It has nothing to do the motors running because it only happens AFTER the message that gets sent AFTER the motors have been stopped.

If it were a real Arduino there could be the possibility that the PC is glitching the DTR signal for some reason and the auto-reset is happening between commands.  To test for that you could jumper the Reset pin to +5 and see if the symptom goes away.  Since you have built your own Arduino-like circuit and have not shown it I don't know if you implemented auto-reset or not.
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 12, 2012, 08:44 pm
It just worked
I followed the link given by the member and it just worked
http://arduino.cc/forum/index.php/topic,91456.0.html (http://arduino.cc/forum/index.php/topic,91456.0.html)
Title: Re: Steering Movement Problem
Post by: AWOL on Feb 12, 2012, 09:12 pm
I'd like to refer you to reply #41
Title: Re: Steering Movement Problem
Post by: cutebuddy6 on Feb 12, 2012, 10:50 pm
Thank you all of you in helping me out thanks