Show Posts
Pages: 1 [2] 3 4
16  Topics / Robotics / Re: FLC on: January 28, 2013, 05:59:45 pm
Not really relevant but my logic has always been fuzzy.

But in response to the OP that is a pretty vague question, what do you want to do would help a bit.
17  Topics / Robotics / Re: Two Arduinos an RC Monster truck and a 4channel long range link on: December 28, 2012, 05:14:25 pm
The bits less receiver, I will wire it all up and grab the code and post up later today


18  Topics / Robotics / Re: Two Arduinos an RC Monster truck and a 4channel long range link on: December 28, 2012, 04:46:26 pm
I am not sure how much help I can be as I suspect we are doing very different things to accomplish the same end.  I use a dedicated R/C receiver and transmitter, mine is a 2.4 spectrum but I have also used an old Airtronics fm unit, they work the same.  It looks like you are hacking an existing receiver.

My components are

Mega
R/C receiver
ESC
Motor
Servo

Hook Up is

Mega to the receiver
servos to the mega
motor to an ESC
the ESC to the Mega.

The sticks on my R/C transmitter fire up the motor and turn the servo, I have an Uno and it would work the same way.

I will post this to your thread too and add some pictures.

Here is the code I used for the Throttle test, I need to dig up my test code that combines this with the servo for rotation

Code:

    // This sketch uses the servo library to arm the Hacker X-5 Pro ESC.
    // beauty works with Castle Creations just fine

    #include <Servo.h>
     
    Servo esc; // Define the ESC as a servo object
     
    int arm = 1000;    // defines pulse width of 1000 us
    int speedvalue = 1000; //should be throttle off
    int speedcalue2 = 1000; // should be throttle off
    int steady = 300;
    int initiate = 0;
    int escPin = 9;
     
   //  RC Reciever control
   
   int ch1; // Here's where we'll keep our channel values
   int current_throttle = 0;
   int Min_throttle = 0;
   
   // Led Stuff
   
    int led = 10;           // the pin that the LED is attached to
    int brightness = 0;    // how bright the LED is
    int pos;
 
     
    void setup()
    {
       // declare pin 10 to be an output for LED:
      pinMode(led, OUTPUT);
      pinMode(5, INPUT); // Throttle on our Receiver
     
      esc.attach(9);
      esc.writeMicroseconds(arm); // This command sends a pulse train
                                  // from pin 9 that continues until
                                 // the pin is called to do something else.
     
     /*  Once armed the setup could also be used to specify the
         run speed of the motor. The commented out lines provide
         a 2 second delay between changes in speed.
      delay(2000);
      esc.writeMicroseconds(1200);
      delay(2000);
      esc.writeMicroseconds(1300);
      delay(2000);
      esc.writeMicroseconds(1400);
      delay(2000);
     */
     
   //   Enable to put in debugging lines
   //    Serial.begin(9600); // Pour a bowl of Serial
    }

    void loop()
    {
 
      /*
      Calls a sub to throttle up motor from 0 rpm to a steady running value.
      The if statement is used to run the throttle up once.
    */
      while (Min_throttle <= 10)
      {
        current_throttle = pulseIn(5, HIGH, 25000); // get current throttle val
        delay(3000); // give the operator a chance to do something
 
         // there is some bounce on my DX7 this
         // low point is actually 1095 to 1098
         // 1100 works as a nice high point
 
        if (current_throttle <= 1100)
         {
           Min_throttle = Min_throttle + 1;
           delay(1000);    // 1 second
          }
         
          if (current_throttle != pulseIn(5, HIGH, 25000))
           {
            throttleUp();
            initiate = 1;
           }
      }
   
      esc.detach();  // Disengage ESC from pin

    }
     
     
    //**************************************************
    // Currently a tad slow as I am only increasing by a factor
    // of 1 will have play with this to get the best
    // speed for throttle up
   
    void throttleUp()
     {
 
      ch1 = pulseIn(5, HIGH, 25000); // Read the pulse width of
      speedvalue = current_throttle;

      if (speedvalue < ch1)
      {
      for (int count = speedvalue; count < ch1; count++){
        Serial.println(speedvalue);
        digitalWrite(escPin, HIGH);
        esc.writeMicroseconds(speedvalue);
        digitalWrite(escPin, LOW);
        speedvalue = speedvalue + 1;
        delay(20);
      }
     }
      if (speedvalue > ch1)
      {
      for (int count = speedvalue; count > ch1; count--){
        digitalWrite(escPin, LOW);       
        esc.writeMicroseconds(speedvalue);
        speedvalue = speedvalue - 1;
        digitalWrite(escPin, LOW);
        delay(20);
      }
     }

    }
       

If you are using an all in one unit from the truck then you will have to figure out how it all works, I should add as a R/C helicopter/ plane guy I have spare r/c bits around.
19  Using Arduino / Networking, Protocols, and Devices / Re: I2c always reads as 255 on: December 27, 2012, 06:22:31 pm
Hi there,

You might want to try this library : http://dsscircuits.com/articles/arduino-i2c-master-library.html

It includes a scan function which can be very handy, I had a similar problem with an LCD panel the address supplied was not the address the device was actually set to.

The Scan function automatically prints to the serial monitor.

Code:

#include <I2C.h>

#define SD21 0x61

int x = 0;
int y = 0;
int z = 0;
int err_c = 0;

unsigned int ServoHigh, ServoLow;
unsigned int Servo_pos = 0;

void setup()
{
  I2c.begin();
  Serial.begin(9600);
  //configure device for continuous mode
  //I2c.write(SD21,0x02,0x00);
}

void loop()
{
  delay(3000); //give us time to open serial monitor
  // display I2C bus address info
  for (int i=0;i<1;i++)
  {
      I2c.scan();
  }
20  Topics / Robotics / Re: 2 servos (or any functions) operating simultaneously? on: December 27, 2012, 12:21:13 pm
What are you using to control the servo's ?  If you are running a full 18 or more you may want to look at a dedicated Servo controller which will give you much more flexibility in managing your servos.  The Lynxmotion one allows for group moves others have servo speed control etc.
21  Topics / Robotics / Re: which lipo battery to have for robot on: December 27, 2012, 12:16:47 pm
You need a couple of things:

Lipo battery / with a battery protection circuit
Balancing charger
Voltage regulator

Most hobby lipos run from 7.4 to 11.2 volts there are higher and some lower but they are hard to find.

The charger needs to properly balance the cells, this can be done by the charger or by an external device.

The voltage regulator to reduce the voltage to what you need.

That is the really simple explanation, for more information on lipo and chargers most R/C car or Helicopter sites have much more detailed information.
22  Topics / Robotics / Re: General Questions re Robot startup on: December 10, 2012, 03:41:13 pm
Oric_dan, interesting observation and it mirrors mine, it seems like a lot of math unless you are try to keep your center of gravity precisely set for uneven ground.  I setup an idiot walking system that works fine for forward motion to verify servo range of movement. 

I also have been playing with FSR's as that seems like a good way to determine a safe leg position on the ground.

Thanks for your feed back.
23  Topics / Robotics / General Questions re Robot startup on: December 05, 2012, 06:03:11 pm
Hello All,

I not sure this belongs in this section, but as it pertains to my Hexapod Robot I thought I would post here.

Currently I use a Spectrum Dx7 and Ar6100E receiver to run things

I am looking at a startup sequence for my bot this consists of the following:

1) Query the Servo controller and confirm Input voltage, Firmware version and of course that I can actual talk to it.

2) Have the user establish the high and low positions for the throttle and directional control.  Basically move the sticks and save the values.

3) Flick a switch to move each the servos as a serviceability test, servo movement is automatic and done sequentially

4) A sensor test to confirm data is being received correctly no long lines of zero - this is a target on a stick that is at a known range it works pretty well.

5) Finally flick the switch back to continue

All requests currently pass through the serial interface, a small LCD with buttons to be added.

My question is this overkill ?  I look at it as a logical startup process but I have been known to over think things.

Any input would be appreciated, I need a rest from IK, it has been way too many years since I had to think that hard.
24  Using Arduino / Project Guidance / Re: A problem controlling multiple servos. on: December 04, 2012, 05:37:25 pm
If you go with a R/C hobby BEC add a small 5 volt fan on that heatsink, they are designed to to have fairly constant airflow over the heatsink, think heli's and airplanes fast moving cars.

Lastly if you plan on using a dedicated servo controller later make sure the output wires will handle your maximum amperage. If not you will have to change them out.  I use a Castle Creations 20 amp for my bot, and it is nice and easy to switch wires, I am not sure why they don't come with 20 amp capable to start with.
25  Topics / Robotics / Re: Waypoint with a GPS and compass on: December 04, 2012, 11:08:27 am
Hi,

Which chunk of code are you using, there is quite a lot on that page.  You should start at the top with simple and work your way down.

So start with this AGV_test_turn2.pde, the waypoints are documented in there as floats flat2 flon2 etc.  Play with that code until you understand it.  Then work way through the rest.  The best thing to do is get the steering working, with out having the motors connected, or with the bot on a support so the wheels are off the ground.

You should be able to create your own waypoints with a hand held GPS, so you know exactly where they are in relationship to your bot.  You will need to do that to make sure the steering turns the correct way.
26  Using Arduino / Project Guidance / Re: RFID which Arduino on: November 28, 2012, 07:03:22 pm
Been debugging code at work all day, it means to say that I do not really understand the difference in Arduino model capabilities.

Thanks for your reply.
27  Topics / Robotics / Re: Obstacle avoidance with an UGV -HELP PLEASE- on: November 28, 2012, 07:01:29 pm
I have some ideas, but currently I have just started playing with ping sensors ,the mail man was good to me today.

I will play around a bit and see what I can come up, I want to build an autonomous tank so it fits in.

The big issue I see with the small servo movements, is sort of a constant left/right turn effect if the the range and time is too small.

If your current code gets you down halls pretty centered then perhaps the problem is more defining a minimum distance.  So if we are with in X distance on the left side adjust to steer right a bit and move forward.  You have a forward arc set up it should be possible to tweak the settings to curve away from or around obstacles.  Which is what you want to accomplish in general terms.

Let me put some thought into this, I need to scrawl some stuff on paper and scan it so it makes sense. I can see in my mind what you want to do, but it is the end of a long work day and I keep coming up the gibberish.

28  Using Arduino / Project Guidance / RFID which Arduino on: November 28, 2012, 06:47:10 pm
Hello just looking for some direction here would an Arduino UNO  be sufficient to  :

Read RFID encoded cards using a Parallex read/writer
Display the data from the card to a LCD panel (2x16). 
Triggering a 2 servo's, one on power-up and one on card read

Seems like it should, but I like only but things once and I am new to this.
29  Topics / Robotics / Re: Obstacle avoidance with an UGV -HELP PLEASE- on: November 28, 2012, 06:37:28 pm
Sorry that was badly worded most of the examples are for some form of aircraft.  But that link I added should give you a start on navigating from waypoint to waypoint.
30  Topics / Robotics / Re: Obstacle avoidance with an UGV -HELP PLEASE- on: November 28, 2012, 05:46:41 pm
It does all seem to be flight based that's for sure.  But can you define your parameters a bit better, when you say navigate via gps do you mean move from known starting point to a known waypoint ?  Or from a known start point to a waypoint that is identified by a system other than gps coordinates ?

If it is the 1st option try this link http://letsmakerobots.com/node/19554 you may have found it already but there is some useful info there.
Pages: 1 [2] 3 4