Show Posts
Pages: 1 ... 32 33 [34] 35 36 ... 307
496  Using Arduino / Motors, Mechanics, and Power / Re: simple car on: August 07, 2014, 01:44:21 am
So what trouble-shooting have you done?

Have you checked that you have voltage going into the 293? (both the 5v logic and the motor power)- out of the 293? Is your power supply adequate?

You could disconnect the motors from the 293 and put leds (with suitable resistors in series) in their place and see if they work. Do you know the motors are ok in the first place?- do they work if you hook them to the batteries?



497  Using Arduino / Motors, Mechanics, and Power / Re: can't brake 1 of the 2 motors using motor shield on: August 07, 2014, 01:24:18 am
I don't know why one motor is braking late.

But as your code stands, I stick with what I said before, and that's in the backwards case, there is no braking because one pin on each channel is still low.

Quote
I have put back the pin 3 and 11 as input in the setup code, but they didn't solve the problem.

I hope you mean output not input. And I didn't mean it was anything to do with your problem, that's why I say "btw".

498  Topics / Robotics / Re: I need a help and guide in this case on: August 07, 2014, 01:17:49 am
Ok well I can't help further I'm afraid because I've never used a rotary encoder. I theory I guess it's possible to keep track of your position based on the rotation of the wheel, but I have no personal knowledge of that.

Starting point is to try to understand your encoders: seems you don't yet know how they work. Someone here will probably have experience with them, especially if you know their make and model, and perhaps link to a datasheet.

http://en.wikipedia.org/wiki/Rotary_encoder
499  Using Arduino / Motors, Mechanics, and Power / Re: can't brake 1 of the 2 motors using motor shield on: August 07, 2014, 12:37:17 am
But at the end of loop(), in the part where you brake both motors, looks to me that one pin on each motor is still low so I'm surprised either motor is actually braking.

//
Code:
Motor A backward @ half speed
  digitalWrite(12, LOW); //Establishes backward direction of Channel A
  digitalWrite(9, LOW);   //Disengage the Brake for Channel A
  analogWrite(3, 123);   //Spins the motor on Channel A at half speed
  //Motor B backward @ half speed
  digitalWrite(13, LOW); //Establishes forward direction of Channel B
  digitalWrite(8, LOW);   //Disengage the Brake for Channel b
  analogWrite(11, 123);   //Spins the motor on Channel B at half speed  
  
  delay(2000);
  digitalWrite(9, HIGH); //Engage the Brake for Channel A <<<<<<<<<<<<<<<<< pin 12 is still low
  digitalWrite(8, HIGH);//Engage the brake for channel B <<<<<<<<<<<<<<<<<<<<< pin 13 is still low

Also, jbtw, you don't seem to have set your PWM pins (3 and 11) as output.
500  Using Arduino / Programming Questions / Re: Combining Codes on: August 07, 2014, 12:20:32 am
Implication there is that you've been testing your dc motor code with the motor powered from the Arduino, is that correct? That's dangerous, since it may (read as: probably did) draw too much current. It's also a pity that, iirc, the tutorial here on the Arduino site shows a servo powered from the 5V. Bad....

This tutorial shows connecting a motor with a transistor. The Arduino controls the transistor (which is basically an electronic switch): when the Arduino pin is high, the transistor is closed and the motor current flows; when Arduino pin is off, transistor is open and motor is off. You can read about transistors here.

The attached schematic shows how you should (or could...) connect. Pin numbers random: choose your own. You also need that diode.

ps... if you don't have a breadboard, you should probably get one. Makes it easy to connect a bunch of things to + on one side and ground on the other.



501  Using Arduino / Motors, Mechanics, and Power / Re: simple car on: August 06, 2014, 11:16:58 pm
the code is ok
the car just not working

How do you know the code is ok: maybe the car isn't working because the code is not ok.

Quote
someone have guide for that situation

Yes: provide the details I asked for earlier, then maybe someone can help.
502  Using Arduino / Programming Questions / Re: Combining Codes on: August 06, 2014, 11:27:43 am
Quote
What will happen when I put the servo motor on a different pin? Will it still work the same? Sorry for  being so inexperienced, I really am a beginner.

Yep it will... just change the servo.attach(put the right pin number here)
503  Using Arduino / Sensors / Re: sensor switch on: August 06, 2014, 11:25:33 am
How do I read the position of the desk (height & width) using the sensor..

I doubt if anyone can answer that until you furnish details of the sensor.
504  Using Arduino / Project Guidance / Re: Absolute noob:Looking to power a waterpump for 1 minute on the push of a button on: August 06, 2014, 10:49:03 am
I'd say there are two aspects to consider:

  • The Code: when you say you've done some LED work, in principle turning on a pump is no different. Have you looked at the blink without delay example? You could use a delay() (as in blink WITH delay) but it's ugly and makes changing yout code to do other stuff a bit tricky. So your first thing is to embrace the millis() timer approach in blink without delay
  • The Hardware: have you got / decided on the pump? If so share the details and you'll get some help. If not, and / or meantime, look at examples like this for a dc motor, or maybe this for a relay to drive ac.

Edit.... John beat me to it and went with delay() which is ok if the fact that it blocks your program from doing anything else is not a problem.
505  Topics / Robotics / Re: I need a help and guide in this case on: August 06, 2014, 09:45:50 am
Seems to me here, that the issue is one of discriminating between an obstacle and a target. There are many ways of measuring distance to something (ultrasound, eg), but knowing that something's a target (attract) or an obstacle (repel) is another question.

Then, you need to be able to detect a target even if there's an obstacle in the way.

So, you need to investigate what sensors are available that are a) able to discriminate between friends and foes and b) be visible behind each other.

Infrared beaconing comes to mind, although I have no knowledge of it. How about RFID?- although I don't know what range that works over. I think electronic toll tags are RFID, not sure.

How does aircraft IFF (Identify Friend of Foe) work? Maybe look into that?

506  Using Arduino / General Electronics / Re: Basic Power Question - I think on: August 06, 2014, 08:57:27 am
Quote
JimboZA, thanks for the great description on the way that chip works.

Pleasure... one thing I didn't say, but which you probably realised, is that those 4 wires from the Arduino i/o pins control the direction of the motor.
 
Assuming one motor is enabled by 5V on 293's pin1, the polarity of the inputs from the Arduino into pins 2 and 7 dictates the polarity of the outputs to the motor on 293's pins 3 and 6. A high / low input will mean a high / low output and motion in one direction (let's call that forward, whatever that means); low / high input => low / high output and reverse spin.

Same for other motor on its associated pins.

So your next question will be "what about speed control"?

There's a command analogWrite which gives a "pseudo" voltage between high and low, so the motor runs below full speed. You give the command analogWrite instead of digitalWrite. This is called Pulse Width Modulation.
507  Using Arduino / General Electronics / Re: Opto coupler wiring basic on: August 06, 2014, 07:58:07 am
Hi.
Quote
I/P pulse from an encoder @ 24V
O/P pulse required for AVR @5V

So, OP is only looking at level changing and isolating pulses.


Tom.... smiley

This is a confusing thread since there's an OOP (Original Original Poster) from  over a year ago, and an NOP (New Original Poster) who basically re-started yesterday but not with the identical question: the NOP doesn't mention pulses as such. This is the NOP's post:

Quote
Is there any IC (Optocoupler) available to have 24vdc digital input convert to 5vdc signal for Aurduion Due board? Want to avoid more component on board.
508  Using Arduino / Project Guidance / Re: Efficient Programming Techniques on: August 06, 2014, 01:48:46 am
Eschew the use of delay()
509  Using Arduino / Motors, Mechanics, and Power / Re: 2 servos - 4 buttons jitter problem on: August 06, 2014, 01:13:18 am
The forum's first question when a member has Spastic Servo Syndrome is "how are they powered?"

I'm wondering if you are powering the servos from the Arduino, in which case it's likely to be a current issue. (I say "powering" as distinct from "controlling".)

The pic below shows how you should hook them up....
510  Using Arduino / Motors, Mechanics, and Power / Re: make motor rev up gradually on: August 06, 2014, 12:55:15 am
The example on this page is exactly what you want.

I'd put it here:

Code:
digitalWrite(pinEnableLeftRight, HIGH);  
          analogWrite(pinSpeedForwardBack, velocity);  //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
          digitalWrite(pinLeft,HIGH);
          digitalWrite(pinRight,HIGH);

(ie, wrap the analogWrite in the for... and of course do it a number of times, wherever you need it)

PLEASE use code tags  smiley-yell

Pages: 1 ... 32 33 [34] 35 36 ... 307