Show Posts
Pages: 1 [2] 3 4 ... 19
16  Using Arduino / Motors, Mechanics, and Power / Re: L298N Motor Module on: January 12, 2014, 09:15:57 am

Because the A4988 is a stepper driver, it's not made to control DC motors but stepper motors.
17  Using Arduino / Project Guidance / Re: Can I use an Arduino in my project on: January 12, 2014, 07:26:57 am
There is an Arduino modbus library: http://playground.arduino.cc/Code/ModbusMaster
Only the Arduino Due (32bit Arm micro controller) has 2 analog outputs (12bit). The Due also has 12 analog inputs with 12 bit resolution. Other Arduinos (AVR based) only have pwm outputs and 10bit analog inputs.  So you would need additional hardware to accomplish what you want.
Bluetooth is pretty easy to accomplish, you can buy a bluetooth shield or just connect a bluetooth module to your Arduino. Programming them is pretty straight forward as it's just serial communication.
18  Community / Products and Services / Re: Are there any products that include Bluetooth? on: January 09, 2014, 04:35:28 pm
I've used a cheap HC05 bluetooth module that I bought on Ebay to control a robot: http://www.bajdi.com/bluetooth-remote-control/
19  Community / Products and Services / Re: Are there any products that include Bluetooth? on: January 06, 2014, 01:30:54 pm
The Arduino BT has bluetooth onboard: http://arduino.cc/en/Main/ArduinoBoardBT?from=Main.ArduinoBoardBluetooth
But I'm not sure if it is still being made?
20  Using Arduino / Project Guidance / Re: which arduino board should i buy? on: January 02, 2014, 04:40:54 pm
The Arduino starter kit includes an Arduino Uno: http://store.arduino.cc/index.php?main_page=product_info&cPath=2&products_id=185
21  Using Arduino / Networking, Protocols, and Devices / Re: rf2401 problem with mega 2560 on: December 19, 2013, 03:37:33 am
I have absolutely no problems with the RF24 library and Arduino 1.0.5 IDE. Compiles without errors on my system. You sure that you have installed the right way? http://arduino.cc/en/Guide/Libraries
22  Using Arduino / General Electronics / Re: nRF24L01 wireless communication on: December 02, 2013, 04:04:39 pm
From my experience you will only get a range of 1km with 2 modules with PA+LNA . And you will need to use the slowest speed (250KBPS) and have a line of sight between the 2 modules. There is a reason they are cheap smiley
23  Topics / Robotics / Re: ArduinoRobot.h and Wire.h on: December 01, 2013, 06:26:12 am
The ArduinoRobot.h library already includes the wire library: http://arduino.cc/en/Reference/RobotLibrary
24  Using Arduino / Motors, Mechanics, and Power / Re: DC 5V 28YBJ-48 Stepper Motor Question on: November 30, 2013, 05:34:07 pm
Those motors can be used for a robot, but it will be a slow robot...  I've done it smiley



I was using a 3S Lipo (+-12V), makes the motors run pretty hot. I haven't killed them yet. They are dirt cheap so can take the risk smiley
I did need to write code to slowly ramp up the speed else I could not let them run that fast.  And I used 2 74HC595 shift registers to control the 4 ULN2003 boards. So I only needed 3 pins to control the 4 steppers  smiley-grin
25  Using Arduino / Networking, Protocols, and Devices / Re: RF24: one loop takes 30ms :( on: November 24, 2013, 05:32:19 am
I just tried using radio.setDataRate(RF24_2MBPS); and that does speed things up. Still not as fast as I want but maybe that's the limit of the hardware (and my lack of coding skills :p ). Should have tried this a long time ago  smiley-red
26  Using Arduino / Networking, Protocols, and Devices / Re: RF24: one loop takes 30ms :( on: November 24, 2013, 05:02:22 am
When running the test sketches I have zero packet loss. I'm using modules with amp and preamp, each powered by its own 3V3 regulator and a 100µF electrolytic and a 0.1µF ceramic capacitor on the output of the vreg. I don't think that's the problem...
27  Using Arduino / Networking, Protocols, and Devices / RF24: one loop takes 30ms :( on: November 23, 2013, 06:53:52 pm
I have a remote controlled Dagu Rover 5 ("robotic vehicle"): https://vimeo.com/42465800
The Rover 5 has an ATmega1280 and a nRF24L01 module, the remote control has an ATmega328 and a nRF24L01 module. I have been using it for more then a year without problems. I use the Maniacbug RF24 library. Now recently I connected the 4 encoders to the ATmega1280 and wrote some code to control the speed of the motors using encoder feedback.
Now I tried to integrate my encoder code in to my remote control sketch and ran in to some trouble. I found out that one loop takes a very long 30 milliseconds. This doesn't play well with my encoder code. Leaving out the RF24 radio code the loop takes less then a millisecond.
I have installed this fork of the RF24 library but to no avail. https://github.com/gcopeland/RF24
Is there any way to let this code run faster?

This is the radio code I use:
Rover 5:
Code:
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"

unsigned long startTime;
unsigned long endTime;
int time;

typedef struct{
  int X;
  int Y;
  int Z;
  int A;
  int B;
  int C;
  int D;
}
struct1_t;

typedef struct{
  float motors;
  float batRover;
  int distance;
  int bearing;
}
struct2_t;

struct1_t remote;
struct2_t rover;

RF24 radio(48,49);
const uint64_t pipes[2] = {
  0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };

void setup()
{
  Serial.begin(115200);
  delay(100);
  radio.begin();
  radio.setDataRate(RF24_250KBPS);
  radio.openWritingPipe(pipes[1]);
  radio.openReadingPipe(1,pipes[0]);
  radio.startListening();
  }
 
void loop(void)
{
  startTime = millis();
 
  // radio stuff
 
  radio.stopListening();
  bool ok =radio.write( &rover, sizeof(rover) );
  radio.startListening();
 
  unsigned long started_waiting_at = millis();
  bool timeout = false;
  while ( ! radio.available() && ! timeout )
    if (millis() - started_waiting_at > 100)
      timeout = true;

  if ( timeout )
  {
    Serial.println("Failed, response timed out.");

  }
  else
  {
    radio.read( &remote, sizeof(remote) );

  }
 
  // end of radio stuff
  endTime = millis();
  time = endTime - startTime;
  Serial.print("time = ");
  Serial.println(time);
  }


Remote control:
Code:
// Remote
// µController = ATmega328

#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"

typedef struct{
  int X;
  int Y;
  int Z;
  int A;
  int B;
  int C;
  int D;
}
struct1_t;

typedef struct{
  float motors;
  float batRover;
  int distance;
  int bearing;
}
struct2_t;

struct1_t remote;
struct2_t rover;

RF24 radio(8,9);
const uint64_t pipes[2] = {
  0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };


unsigned long startTime;
unsigned long endTime;
int time;

void setup()
{
  Serial.begin(57600);
  radio.begin();
  radio.setDataRate(RF24_250KBPS);
  radio.openWritingPipe(pipes[0]);
  radio.openReadingPipe(1,pipes[1]);
  radio.startListening();
}

void loop(void)
{
  startTime = millis();
 
    // radio stuff
  if ( radio.available() )
  {
    bool done = false;
    while (!done)
    {
      done = radio.read( &rover, sizeof(rover) );
    }
    radio.stopListening();
    radio.write(&remote, sizeof(remote) );
    radio.startListening();
  }
  // end of radio stuff
 
  endTime = millis();
  time = endTime - startTime;
  Serial.print("time = ");
  Serial.println(time);
}
28  Using Arduino / General Electronics / Re: LM2596 Step-down 5V>4V adjustable output voltage on: November 22, 2013, 09:50:03 am
There is a potentiometer (the blue "thing") on the board that lets you adjust the output voltage. Take a good look at the datasheet of the LM2596, I don't think it's possible to get 4V from an LM2596 with an input voltage of 5V. You will need to find a regulator with a smaller drop out voltage.
29  Topics / Robotics / Re: Dagu Rover 5 chassis robot demo on: November 19, 2013, 04:33:16 am
Greetings.
I've been working on modelling and control of this platform for a while now and I have a question to ask if it is possible. The encder pulses seem to be quite long or slow to be able to get a good PID control from them. Has anyone tride this? have you been successful? can you share with me the method you used for speed measurment? I'll be more than thankful for any answer.
Cheers.

I've finally hooked up the encoders on my Rover 5 and wrote some code for them: http://www.bajdi.com/rover-5-encoder-speed-control/ Just trying to make all 4 motors rotate at the same speed. It works but maybe a PID control would be better?
30  Using Arduino / Project Guidance / Re: 3 DOF Hexapod Algotithm on: November 08, 2013, 05:11:27 pm
I've built a hexapod with 3DOF legs: https://vimeo.com/67994924
I used inverse kinematics to code the positions of the legs / angles of the servos. Then I spent countless hours figuring out how to move the servos in little steps using a timer (millis). Took me a long time but I got it to work in the end. To be honest it's not that hard but I'm a noob programmer. I would recommend you use inverse kinematics, as it makes coding the different walking gaits a lot easier.
Pages: 1 [2] 3 4 ... 19