Author Topic: Motors vibrates but it doesnt do anything(doesnt move forward nor left or right)  (Read 17585 times)

0 Members and 1 Guest are viewing this topic.

Offline coolnerdTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
  • I am currently study Computer System Engineering
Hello my fellow robot builders,
am doing a project and ive connected my arduino to the motors but when i compile the C code, my stepper motor vibrates but doesnt do nothing, i ve used the code code from the arduino library and edited but i still cant manage to make it move forward.
Please please Help!!! :(((

Offline jkerns

  • Robot Overlord
  • ****
  • Posts: 270
  • Helpful? 12
A lot more information is needed.

How are the motors connected? What kind of driver are you using? What kind of motor?

Include a copy of your software.

Now, have you read the data sheet for the motor driver? Is it connected correctly? How fast are you sending pulses? What does the motor data sheet say about starting it up?
I get paid to play with robots - can't beat that with a stick.

http://www.ltu.edu/engineering/mechanical/bachelor-science-robotics-engineering.asp

Offline coolnerdTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
  • I am currently study Computer System Engineering
We are using stepper motors, first we had to build a motor circuit using the schematic that was provided via lecture notes, the motors work well when connected to the motor circuit. but when wen we connected the direction wire and clock wire  from the motor circuit into the arduino pins thats when it vibrates, we are using C programming.

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
[...] first we had to build a motor circuit using the schematic that was provided via lecture notes [...]
Can You post circuit diagram? Now we have no idea what You're talking about.

[...] the motors work well when connected to the motor circuit.
Again, circuit diagram would help a lot.

but when wen we connected the direction wire and clock wire  from the motor circuit into the arduino pins thats when it vibrates
If driver circuit works without Arduino, how come You need to connect it to Arduino, or are these different circuits You are talking about?

[...] we are using C programming.
Posting source code would get You answers much faster.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline coolnerdTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
  • I am currently study Computer System Engineering

#define stepPin 4
#define dirPin 5

void setup() {
  Serial.begin(9600);
  Serial.println("Starting stepper exerciser.");

  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);

  digitalWrite(dirPin, HIGH);
  digitalWrite(stepPin, LOW);
}

void loop() {
      digitalWrite(stepPin, HIGH);
      delayMicroseconds(50000);
      digitalWrite(stepPin, LOW);
      delayMicroseconds(50000);

    delay(5);

  }

Offline coolnerdTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
  • I am currently study Computer System Engineering
Here are a few pics to show the robot...i just need a code in C programming that will make it move forward or backward or even make a 90degree turn

Offline coolnerdTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
  • I am currently study Computer System Engineering
Here is the motor circuit i was talking about but we managed to fix it but i just thought i shud upload a picture for u to know what i was talking about.

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
If a stepper motor is just vibrating, and not moving smoothly in one direction, then some of the wires are hooked up wrong, or you're driving the wires in the wrong order, which ends up being equivalent.
The simple thing to do is to permute your wiring, until you get a working hook-up, and then write that down as the proper connections. This is assuming that your driver itself is outputting a proper cadence. (+A, +B, -A, -B, repeat, for example.)


Offline Pogertt

  • Full Member
  • ***
  • Posts: 60
  • Helpful? 3
  • Pogertt
Try changing:

delay(5)

to:

delay(500)

and see what happens.

Pogertt
Mmmmmmmm....Cookies

Offline coolnerdTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
  • I am currently study Computer System Engineering
hi ya...@ Jwatte, we have connected the wires correctly and also tried to make changes to the code but sometimes it jst stops working:(((((
@ Pogertt...we have changed the delays but it still vibrates
Any one who can PLEASE be able to send me a new code in C programming i can try out. I'll be greatful.

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Any one who can PLEASE be able to send me a new code in C programming i can try out. I'll be greatful.
You did not send us stepper motor driver circuit diagram, so how possibly we can come up with the code for it?
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline Pogertt

  • Full Member
  • ***
  • Posts: 60
  • Helpful? 3
  • Pogertt
We are using stepper motors, first we had to build a motor circuit using the schematic that was provided via lecture notes, the motors work well when connected to the motor circuit. but when wen we connected the direction wire and clock wire  from the motor circuit into the arduino pins thats when it vibrates, we are using C programming.


Sounds like you were able to get the motors to rotate before connecting to  your arduino.
Is that correct?

If so, how did you make them move? 
By grounding the step and direction pins, or by putting them to positive voltage?


Can you find a simple program in the arduino library that will toggle an output on and off slowly?
Use that program to toggle your step wire, while direction if held to positive and then ground.



Mmmmmmmm....Cookies

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Other possibilities:

- not connecting the grounds between the Arduino, the controller, and motor power

- overcurrent causing controller to shut down motor

- overcurrent causing undervoltage resetting Arduino

All of these depend on the actual circuit/wiring, so a full system circuit diagram would be needed to debug further.

Offline coolnerdTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
  • I am currently study Computer System Engineering
that is right the motors rotate well when connected to motor ciruit but when connected to the arduino , its doesnt rotate..it vibrates instead.

@ Jwatte below is circuit diagram....

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
that is right the motors rotate well when connected to motor ciruit but when connected to the arduino , its doesnt rotate..it vibrates instead.
What is input CLOCK frequency when circuit is NOT connected to Arduino?
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline coolnerdTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
  • I am currently study Computer System Engineering
that is right the motors rotate well when connected to motor ciruit but when connected to the arduino , its doesnt rotate..it vibrates instead.
What is input CLOCK frequency when circuit is NOT connected to Arduino?

the clock frequency is at 10khz...
we played arnd with different frequencies but the 10kHz was the appropriate frequency.

Offline jkerns

  • Robot Overlord
  • ****
  • Posts: 270
  • Helpful? 12
According to your diagram, you have teh clock connected to the direction port and the direction connected to the clock port.

What did you have it hooked to before you used the Arduino?
I get paid to play with robots - can't beat that with a stick.

http://www.ltu.edu/engineering/mechanical/bachelor-science-robotics-engineering.asp

Offline coolnerdTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
  • I am currently study Computer System Engineering
i have uploaded both the schematic of the motor circuit and the motor circuit that we wired up o the board based on the schematic. this works VERY well when we tested the motors. the question is why wont the stepper motors rotate when the clock and direction pins of the motor are connected on to the arduino...I hope am making sensing??

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
You did not show the Arduino in the circuit diagram, hence the diagram is NOT COMPLETE.

So, let's go back to the questions I already asked:

- Are you taking 5V from a power supply, or from the Arduino board?
- Are you taking 12V from the same power supply as supplies the Arduino?
- Are you using a common ground between the driver and the Arduino?
- What is the capacity of the power supply or power supplies you're using, in amperes and watts?

My guess is that you either don't use a common ground, or you are somehow overloading your power supply such that the Arduino browns out.

Btw: Driving a unipolar stepper motor directly from an Arduino can be very simple. You can do it with four digital pins and four N-channel MOSFETs directly from an Arduino; no controller needed. I did this for an egg painting robot a while back. Using simple 500 mA BS170 MOSFETs actually worked great with 12V/250 mA motors.

I also see no current limiting resistors going into the L297, or the D2003. Make sure there's no excessive heating (and thus power draw) going on in those chips.

Offline coolnerdTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
  • I am currently study Computer System Engineering
The micromouse competition is on monday...any suggestion of programming my robot so it moves forward, even if it moves an Inch, that would be an accomplishment, I have given up on the Arduino.  :'( :'( :'( :( >:(

paulstreats

  • Guest
As said above, that diagram shows that you are connecting your direction from the arduino to the clock pin of the L297 and the direction pin to the clock pin. Just try switching them over and see what happens

 


Get Your Ad Here

data_list