Show Posts
Pages: 1 ... 310 311 [312] 313 314 ... 379
4666  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: DFRobotShop Rover Help on: December 06, 2010, 09:32:58 pm
Quote
But i still get nothing. One thing i think may be the problem is the Rovers motors arnt connected to pins on the micro-controller, there in those blue +/- screw terminals, labeled M1 and M2 on the board and each have 2 micro led leads on them. Whats the code for assigning them? Its the one parts thats utterly kicking my butt.

[edit]Stupid question: There should be wires from each motor running to the blue terminals - are these hooked up (I hope so)?

I re-read your sentence; the "there"/"they're" was throwing me off - so I think you were saying the motors are hooked up, but you don't know which pins control them - correct?[/edit]

You didn't say where you got the robot from, but have you read the manual (for the example code) and/or schematic for the robot from here?:

http://www.robotshop.com/dfrobotshop-rover-tracked-robot-basic-kit.html

(see the tab labeled "Useful Links")

The code seems to indicate that you need to apply a PWM signal using analogWrite() to the enable pin of the motor being controlled (sets the speed), then bring the motor's digital pin LOW with digitalWrite() to drive it forward, or HIGH to drive it backward (assuming the wires are connected properly - personally, I would have HIGH be forward, and LOW backward); the code in the manual reads:

Code:
/*
Title: DFRobotShop Rover Sample Sketch #1
Authors: DFRobot, RobotShop
Date: 12/03/2010
Licence: GPL v3
Description: Sketch for the DFRobotShop Rover.
URL: www.robotshop.com
This program allows serial commands to be sent to the DFRobotShop Rover by either a wired (USB) or
wireless (Bluetooth, XBee) connection. The commands are "w", "a", "s" and "d" for driving forward,
turning left, turning right and reversing. The rover will execute the command until it is told to stop by
pressing any other character.
We suggest using the DFRobot Bluetooth module or XBee module with Windows Hyperterminal for fluid
wireless control. Ensure you select the correct COM port and 9600 baud rate. Note that it is likely the
two motors are not identical and you will need to adjust the speed so the robot goes perfectly straight.
*/

int E1 = 6; //M1 Speed Control
int E2 = 5; //M2 Speed Control
int M1 = 8; //M1 Direction Control
int M2 = 7; //M2 Direction Control

void setup(void)
{
  int i;
  for(i=5;i<=8;i++)
  pinMode(i, OUTPUT);
  Serial.begin(9600);
}

void loop(void)
{
  while (Serial.available() < 1) {} // Wait until a character is received
  char val = Serial.read();
  int leftspeed = 255; //255 is maximum speed
  int rightspeed = 255;
  switch(val) // Perform an action depending on the command
  {
  case 'w'://Move Forward
    forward (leftspeed,rightspeed);
    break;
  case 's'://Move Backwards
    reverse (leftspeed,rightspeed);
    break;
  case 'a'://Turn Left
    left (leftspeed,rightspeed);
    break;
  case 'd'://Turn Right
    right (leftspeed,rightspeed);
    break;
  default:
    stop();
    break;
  }
}

void stop(void) //Stop
{
  digitalWrite(E1,LOW);
  digitalWrite(E2,LOW);
}

void forward(char a,char b)
{
  analogWrite (E1,a);
  digitalWrite(M1,LOW);
  analogWrite (E2,b);
  digitalWrite(M2,LOW);
}

void reverse (char a,char b)
{
  analogWrite (E1,a);
  digitalWrite(M1,HIGH);
  analogWrite (E2,b);
  digitalWrite(M2,HIGH);
}

void left (char a,char b)
{
  analogWrite (E1,a);
  digitalWrite(M1,HIGH);
  analogWrite (E2,b);
  digitalWrite(M2,LOW);
}

void right (char a,char b)
{
  analogWrite (E1,a);
  digitalWrite(M1,LOW);
  analogWrite (E2,b);
  digitalWrite(M2,HIGH);
}

Note at the top, the pins for PWM are pins 5 and 6, while the pins for the directional control are 7 and 8 (respective for each motor). This code of course is meant for serial control via bluetooth or xbee, but you could test it using hyperterminal pointed to the USB serial port, with a cable connecting the robot, and prop the robot on a stand so that the tracks aren't touching anything (this should be your testing method anyhow, at least initially).

Hope this helps...

 smiley
4667  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: DFRobotShop Rover Help on: December 06, 2010, 05:22:14 pm
Quote
I cant find any tutorials on how to code things as simple as making the Rover move forward a foot and stop.

Something to keep in mind about that rover: It is configured for open-loop control.

In other words, there's no feedback system to tell the Arduino how many rotations a given motor has moved; without this information you can't accurately tell it to move forward a given number of units, you can only at best tell it how long to leave a motor on. PWM control, the surface under the treads, battery voltage, etc - will all skew this. During one run you may get it to move so far perfectly, and a future run will cause it to move less (or more!).

Also, without feedback, you'll never get it to run in a perfectly straight line; feedback allows to speed up or slow down one side or the other in order to match conditions so that the robot can move in a straight line.

You aren't there yet with your knowledge to implement a method to introduce feedback control on the treads/motors. But keep it in mind as you progress, because at some point you will likely want to implement something to correct this deficiency...

 smiley
4668  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: beginner questions on: December 06, 2010, 05:00:58 pm
Quote
Was there a sudden inexplicable transient restriction on the length of characters of the input part of the form?

For all we know, he was riding in traffic on his motorcycle while weaving between a couple of semis while typing his post one-handed using T9...

 smiley-wink
4669  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: beginner questions on: December 05, 2010, 04:49:04 am
Quote
What on earth is an “fd”?

Textspeak for "friend"? That's my best guess...
4670  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Output a 1MHz clock for SID chip on: November 05, 2010, 11:15:27 am
I tend to wonder if, in the future, say - 20 years from now - we'll find all kinds of Commodore 64 machines without any capability for sound...?

BTW, golgobot, do you know the SID has been emulated with the Arduino?:

http://www.arduino.cc/playground/Main/SID-emulator

 smiley
4671  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: how do i connect all this?? on: December 02, 2010, 11:17:32 am
Not without some extra hardware (such as shift registers); if you went with a serial LCD (or possibly even 4-bit mode, if we are talking a character LCD) it could be done.

Past the hardware, you haven't described the application - you might be able to get the hardware to fit, but maybe the software is more complex (though I doubt it, but it is something to consider).
4672  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: analogRead messes up my frequency counter function on: November 12, 2010, 06:28:41 pm
Probably what was throwing him off was:

Code:
for(; counter < 199;)
{

It would probably be better stated as:

Code:
while (counter < 199)
{

While both pieces of code are equivalent, the second is easier to read, whereas the first is a kind of "for-loop" bastardization...

 smiley

4673  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Can i connect servos directly??? on: November 23, 2010, 11:34:46 pm
You don't need such a shield, but it might make things easier for you to build. My only concern on it is whether it supports in some manner a hook up to a separate power supply (battery pack or such) for use by the servos only. When you connect your servos (either with this shield or directly to the Arduino, which is easy), you should have them powered by a separate supply from the Arduino (rather than from the Arduino's regulator), because servos can use a bit of current, enough so as to cause a voltage sag and reset the Arduino (it won't harm the Arduino, but it can make debugging an issue a real pain). Regardless of how you hook them up, you would use the Servo library to control the servos.
4674  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Leaving Arduino Permanently On on: November 18, 2010, 06:44:26 pm
I wonder if with ROHS compliance if tin-whiskers would kill it much sooner...

 :-?

/have they figured out a solution to this problem, or do they consider it a built-in obsolescence switch? Maybe I am just being cynical...  smiley-wink
4675  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Arduino to 3d modelling program? on: November 23, 2010, 10:19:34 am
Quote
Well I haven't seen anyone do it on an Uno yet but I did read a page on doing it with another ATmega USB chip.

Somebody on these forums was playing around with some software to get the ATTiny (?) on the Uno (the controller that is the USB interface on the UNO) to act as a HID/Joystick/whatever device, soon after its release (like a week or so after).

At any rate - if that was solidified as an input option (ie, game controller) - this would probably be a good plugin to use for Cinema4D (not free, tho):

http://www.c4dplugin.de/indexx.php - DirectControl plugin

 smiley
4676  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Need advice on 24v/25A motor selection and lesson on: November 21, 2010, 03:28:47 am
I've not used motors this large yet, though I own a pair as part of a mobility chair transaxle assembly. I do have a word of advice:

Purchase a controller, don't attempt to build your own as such a controller for large motors isn't easy to design. Unless you have this experience, of course, your time and money (and sanity) will be far better spent on other aspects of the robot. Just note that such controllers are far from inexpensive (but likely less expensive than something you could design yourself - unless, like I noted, you have experience in such design work).

Good luck with your robot.

 smiley
4677  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Multiple inputs on: November 18, 2010, 06:21:44 pm
You might also want to look into macetech's centipede shield:

http://macetech.com/store/index.php?main_page=product_info&products_id=23

He's one of the regulars around here, btw...

 smiley
4678  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Remote controlled car robot on: November 18, 2010, 09:26:41 pm
BTW - I hope the above doesn't come across too much as "blowing my own horn"; that isn't my intent. My intent is to potentially show you a method of approaching the project, perhaps there is something you can learn from (good or bad). I mean to share how I am doing things, potentially to help others, such as yourself.

 smiley
4679  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Remote controlled car robot on: November 18, 2010, 09:23:37 pm
[edit]NOTE: This was a reply I was editing for your -first- post, before you moved it; I understand why you moved it, but at the same time I could have lost my book-sized reply below, and that would've really ticked me off, as I am looking for an agent and publisher, you see...

 smiley-wink
[/edit]

Quote
Hello all

Hello.

Quote
I am new to arduino and I just ordered my mega board. One of the reasons that made me buy it is because of this useful forum.

Cool. And welcome. Glad you found the forums useful!

Quote
I just started working on a project that is about a skid-steering robot (20kg) that is controlled remotely over long ranges (1km).

What is your experience in mechatronics? This project is anything but trivial; I trust you understand that?

Quote
This robot will have live video streaming and by reading many discussions on this forum and on the internet it was adviced to buy readymade wireless surveilance cameras. Therefore I am going to buy a camera, 1.2GHz AV transmitter and receiver. Is that the best solution?

Its one possible solution.

Quote
In addition, in this project I need two motors and they need to be controlled seperately (for skid steering).  To control the robot movement and after doing a lot of research, it ended on two possibilities:

-2 1600oz/in Nema34 stepper motors and two drivers
-2 350W brushless dc motors (similar to the motors in E-scooters) and a Sabertooth dual 25A motor driver (one driver can control two motors)
please keep in mind that I cannot get these motors and drivers where I live and I will have to order 3 motors and an extra driver just in case one of them failed and it takes about one month to be delivered. The total cost with the shipping was about 600$ for stepper motors and 480$ for DC motors. Should I use brushless motors or there are certain advantages for stepper motors? I know its more precise but its not really an issue in the project.

That's a lot of money! Those are also pretty powerful motors; you should know that you are going to need a fairly hefty power supply for that system (which is going add weight). Either motor system will probably be adequate, but you are likely going to need a gearing/transmission system to get the power to the wheels (you -do not- want to attach the wheels directly to the shafts without some form of indirect coupling; you are likely going to need at least a small amount of gear-down to provide the torque needed once the rest of the robot's weight is factored in anyway - besides, you need to keep the weight off the motor bearings, as they aren't designed for it).

Quote
Also, this robot will have sensors (eg. GPS, temperature, vibration, noise, gas sensors) and the values should be sent to the operator of the robot wirelessly.  This robot should have two way communication, one way is to control the movement of the robot and the 2nd is to send back the sensor values.  I found this chip online: XBee-PRO® 868 OEM RF Modules. Will it cause any interference if my country uses 900MHz as its GSM frequency? Is it better to use two seperate wireless chips if I want it to be fast?

I'm doing a similar project, however, I am using an existing motorized platform for my (beta) system that is already tried and tested to withstand the loading and abuse - a PowerWheels H2 ride-on toy:

http://www.phoenixgarage.org/show_article/114

Anyhow - in this project, my Arduino (ultimately, it will be a standalone unit in the final form - once I get there) will act as a controller for a custom steering servomechanism (unlike your design, this vehicle uses Ackerman steering), as well as for control of the drive motors. It will also relay commands for a pan/tilt unit controlled by a Pololu Serial Servo Controller.

An on-board Micro-ITX based PC, running Linux (Ubuntu, most likely) - will be used to send commands to the Arduino for steering, pan/tilt, and drive control:

http://www.phoenixgarage.org/show_article/78

This server also will handle the input and digitization (for machine vision as well as human control) of a USB camera, and communication with the system will be done via an encrypted (WEP and SSL), MAC-addressed locked, 802.11g link via a regular router. The server will run a LAMP (Linux, Apache, MySQL, PHP) stack, along with Python and OpenCV, and anything else that is needed (there's 2 GB of memory and 500 GB of hard drive space).

The Arduino will be custom programmed with a system to not only take in commands and such from the server, but also to include fail-safe mechanisms such that should something break and a "run-away", "unsafe", or "failure" mode occur, it will automatically detect this and shut the system down. That's the plan, anyhow. You should implement a similar system as well.

What's your chassis going to look like? Bolted or welded construction? Tubular steel? Aluminum? Something else?

I went with this chassis because, like I said, it was designed for abuse (ie, reckless 3-4 year olds!), it could carry the weight (I rode on it once, I weigh 240 lbs), it was "pre-built" (so no difficult design work coming up with a frame or such), and it was fairly cheap (bought used off of Craigslist). Plus there's already a large modder/hacking community for these ride-ons:

http://www.modifiedpowerwheels.com/

At a later point, if funds permit, I have a plan to go with either a custom framed differential steered system (like you're planning - I already have the motors needed, designed to run a large mobility chair), or maybe something like a Polaris off-road vehicle.

For your power source, you might look into a hybrid system, using a small camping generator wired to charge a deep-cycle battery (12 or 24 volts), then power your system off of that. Some of the small Honda gensets are extremely quiet (though I have heard good things about the smaller Harbor Freight gensets that work well after a few minor mods - plus they're cheaper!).

Finally - I sincerely hope this is not your first project of this nature; I really hope that you have experience in other areas that are similar to this nature, and have given a lot of thought to how such a robot can be constructed. 20 Kg doesn't sound like a lot, but once it gets moving...

Good luck, and let us know how things turn out!

 smiley
4680  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Downloading/Reading sketches from the Arduino? on: November 18, 2010, 02:24:09 pm
Quote
The application still worked - could see that with the serial monitor! However my IDE now gets a failure on avrdude when I try to upload a new sketch. Think I need to restart my PC  because restaring the IDE did not solve it. I'll be back

That's because you likely blew away your bootloader uploading the binary - so you'll need to find a bootloader binary for your board, and upload that again so you can upload sketches with the Arduino IDE (if I am understanding you correctly?)...
Pages: 1 ... 310 311 [312] 313 314 ... 379