Show Posts
Pages: 1 ... 8 9 [10] 11 12 ... 27
136  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 06, 2014, 02:10:30 pm
Quote
any chance that you  can add a window to show the feed from a wifi camera? Then we will have the ultimate robot controller
smiley-roll smiley-roll smiley-roll
that's a slightly more complex story  smiley-wink
137  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 06, 2014, 01:57:31 am
Hi juycce

Quote
do u think in a future could make one to be IOIO otg compatible?
Sorry, no experience yet with IOIO  smiley-confuse

Quote
this app is the best,on Google Store
Gracias smiley-red

138  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: December 25, 2013, 10:11:59 am
Hi hib1,

I am currently on holydays and will be home next week
In the meantime, please make sure you are using the latest AndroLED Arduino demo sketch (V10.2)
modify:
Code:
boolean DEBUG = false;
to:
Code:
boolean DEBUG = true;

DEBUG can also be toggled using Button #2

Let me know the outcome

@all
Merry Xmas  smiley smiley
139  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: December 13, 2013, 03:29:08 pm
Hi kovacsgellert, thanks for your comments

Quote
Referring back to an older post I believe as well that the addition of accelerometer to the available control options would be really nice.   smiley
I had the idea to develop an accelerometer based application, but it didn't generate enough interest here, to justify development time   smiley-confuse
140  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: December 05, 2013, 09:44:32 am
Quote
Edit, problem solved, Thanks KAS for the time you have put in, I will upload a "dummy's guide" later in a bid to contribte : )
Glad you sorted it out
Your contribution will be very welcome  smiley-wink
141  Community / Exhibition / Gallery / Re: GPS logger on: December 05, 2013, 09:15:46 am
Hi Gabi,

Thanks for your interest, welcome to this forum

Quote
- Have you thought about include another battery and measure the impact in the autonomy ? It must duplicate it, doesn't it?
You can install a second battery and get twice the time
Alternatively, replace the 1000mAH 14500 battery by the larger 1500mAH 18650 model

Quote
I'm thinking too in a temperature logger. I guess a temperature sensor will consume less power than a gps so the autonomy with two of those batteries could increase to a few days
For temperature, just hibernate the processor between two readings, with 2mn log time, your battery should last well over one month

Quote
What's the point of the CR1220 battery? are there a realtime clock? or it's used for another reason?
This is the GPS backup battery for storing ephemeris data and allow "warm boot" in a couple of seconds (cold boot takes one minute)
Since my last post, I replaced the battery by a .22 Farad supercap



Quote
Which GPS module has been used for your project?
Fastrax UP501, $27 shipped
http://www.ebay.com/itm/High-performance-and-Quality-UP501-GPS-Antenna-Module-For-Arduino-/170979281074?pt=LH_DefaultDomain_0&hash=item27cf28c8b2

142  International / Français / Re: ATMega328 seul on: November 28, 2013, 12:28:23 pm
Bonjour,

Un exemple d'alimentation directe en 3.2V (LiFePO4) ici
143  Topics / Robotics / Re: Balancing robot PID tuning trouble on: November 24, 2013, 12:45:08 pm
Impressed  smiley-eek-blue smiley-eek-blue smiley-eek-blue
Your project is really moving in in the right direction

Quote
I still can't get proper, clean balance when robot stays stationary. I looked at the Balanduino and it's very still when stationary, it uses the same motors as me so I know it's doable.
I suggest you come back to the basics and, before moving it,  make sure you bot can stay still forever
Encoders feedback will help staying at the same place
 
Code:
int updatePid(float targetPosition, float currentPosition)   {
  float error = targetPosition - currentPosition;
  pTerm = Kp * error;
  integrated_error += error;                                      
  iTerm = Ki * constrain(integrated_error, -GUARD_GAIN, GUARD_GAIN);
  dTerm = Kd * (error - last_error);                            
  last_error = error;

  count = -count_R;
  pTerm_Wheel = Kp_Wheel * count;
  dTerm_Wheel = Kd_Wheel * (count - last_count);                            
  last_count = count;
  return -K*(pTerm + iTerm + dTerm + pTerm_Wheel + dTerm_Wheel);
}

This is how bot should behave when pushed:


I also used (count_R - count_L) to compensate for motor speed difference, and follow straight lines

Quote
I'm thinking of adding a 3rd PID loop to control motor speed
I had the same idea, as motor torque is very weak at low PWM.
Have a look at the second source code here...

Ho... I can't see your sensor board
Make sure it is located near the COR (R for rotation)

Good luck for your Quest for Balance  smiley-wink
 
144  International / Réalisations et Projets Finis / Enregistreur GPS on: November 23, 2013, 07:05:14 am
Bonjour,

Pour les inconditionnels de la langue de Molière, voici la traduction d'un post en langue de Shakespeare
La VO se trouve ici

La trace est enregistrée sur la carte SD, dans un fichier .cvs, qui est ensuite converti en fichier .kml
Télécharger le fichier example (vous devez être connecté au forum pour voir le fichier)
Le fichier s'ouvrira directement dans Google Earth et affichera la trace
 


The projet met l'accent sur le coté basse consommation, en combinant plusieurs technologies suceptibles d'être réutilisées dans d'autres projets:

Utilisation d'un Arduino "déshabillé" (AtMega 328P, $2.99 transport compris), sans Leds, régulateur et puce FTDI
Fonctionnement sous 3V @8Mhz
La carte est directement alimentée par une batterie 3.2V lithium phosphate de Fer, sans convertisseur cc/cc, qui plombe le rendement.
Enfin, le processeur est mis en hibernation en dessous de 3V pour éviter la décharge complete de la batterie

En combinant tout cela, l'autonomie est passée de quelques heures à plus de 20H





Ce projet est modulaire et didactique et permet d'aborder différentes techniques
 - Arduino simplifié
 - technologie des batteries LiFePO4
 - surveillance d'une batterie montée sans regulation de tension
 - les modes d'hibernation du processeur Atmel
 - Le protocole GPS NMEA 0183
 - La communication SPI pour la carte SD
 - les scripts Python
 - le montage dans la boite étanche

Enjoy  smiley-wink

145  Topics / Robotics / Re: Balancing robot PID tuning trouble on: November 23, 2013, 06:01:58 am
Sorry for the late response, didn't get the reply notification

I understand encoders are not yet implemented; you can't get proper balancing w/o encoders, as they are part of the  PID algorithm. this will be now your next task  smiley-wink

PID tuning is (at least for us  smiley-roll-blue) a pure hit and miss, experimental task
I just checked my current setup, both values are positive

Before adding R/C control, make sure that you bot is able to balance forever, even being pushed rather hard
You should end up with a slight back and forth move, due to the motors blackslash

Bigger/softer wheels as shown here also really help balancing
146  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: November 23, 2013, 04:55:38 am
Quote
Hey kas!
Thanks for making this application. It's cool and the controls are easy to use. My friends and I have never worked with Arduinos before and hacked up this robotic ball in a week that uses your app. It was really fun!
Keep up the good work. We love your app!

Hi rtso489
Thanks for taking the time to register and post your first comments on the forum

This is a very cool hack  smiley-cool smiley-cool smiley-cool
Please let us have more info, link to the original device and possibly photo of the internal mechanism
Thanks again for sharing
147  Community / Exhibition / Gallery / Re: GPS logger on: November 19, 2013, 08:09:33 am
Here is the kasGPS V3.0 source code:

Code:
// GPS Logger kasGPS V3.0        Kas 2013

// SD wiring:
// MOSI: D11, MISO: D12, CLK: D13, CS: D10 (D53 for Mega)

// V30: Use sdfat (http://arduino.cc/forum/index.php/topic,149504.0.html)
// .....
// V1.0 Initial release

#include <SdFat.h>
#include <avr/sleep.h>
#include <TinyGPS.h>

#define PMTK_SET_NMEA_OUTPUT_RMCONLY "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29"     // only RMC data

TinyGPS gps;                              // TinyGPS object
SdFat sd;                                 // SD file system.
SdFile file;                              // Log file.
int CS = 10;                              // SPI chip select
int logLED = 8;                
int bipPin = 9;  
int minDist = 30;                         // Minimum distance in meters between logs
long logRate = 3000;                      // Minimun time in ms between logs
int voltMin = 300;                        // Minimum battery voltage
static char dtostrfbuffer[20];
float flat, flon;
float flat_ant=0, flon_ant=0;
unsigned long age;
long distance;
long startLog = 0;
String SD_lat = "invalid";
String SD_lon = "invalid";
String dataString ="";
int maxSkip = 5;                          // do not log initial inaccurate values
int skip = 1;

static bool feedgps();

void setup()    {
  pinMode(CS, OUTPUT);                                     // Chip Select Pin for SD Card
  pinMode(bipPin, OUTPUT);                                 // Buzzer
  pinMode(logLED, OUTPUT);                                 // LED Indicator
  Serial.begin(9600);
  Serial.println(PMTK_SET_NMEA_OUTPUT_RMCONLY);            // turn on only RMC
  if (!sd.begin(CS) || !getConfig())  {                    // Initialize SD card and get configuration
    bip(bipPin, 250, 3);                                   // error
    blinkLED(logLED, 10, 3);
    while(1);
  }
  if (!file.open("LOG.CSV", O_CREAT | O_WRITE | O_APPEND)) {// Initialize the SD and create or open the CVS data file for append.
    bip(bipPin, 250, 4);                                    // error
    blinkLED(logLED, 10, 4);
    while(1);
  }
  blinkLED(logLED, 10, 2);
  bip(bipPin, 10, 2);                                      // ready
}

void loop()    {
  bool newdata = false;

  if(getBatVolt() < voltMin)  {                           // battery monitoring
    bip(bipPin, 200, 5);
    GoToSleep();                                          // ATMega low hibernation mode
  }

  unsigned long start = millis();
  while (millis() - start < 1500)   {                    // data acquisition from GPS module
    if (feedgps())  newdata = true;
  }
  if(newdata)  {  
    gps.f_get_position(&flat, &flon, &age);
    if(flat == TinyGPS::GPS_INVALID_F_ANGLE)    {
      SD_lat = "***";
      SD_lon = "***";
    }  else  {
      SD_lat = dtostrf(flat,8,5,dtostrfbuffer);    
      SD_lon = dtostrf(flon,8,5,dtostrfbuffer);
    }
    dataString = SD_lat + "," + SD_lon;  
    feedgps();
    
    if(dataString != "***,***")  {  
      if(skip > maxSkip)  {                                  // discard first values
        if((millis() - startLog > logRate))  {               // time log conditions
          startLog = millis();  
          distance = TinyGPS::distance_between(flat, flon, flat_ant, flon_ant);
          if(distance > minDist)      {                      // distance log conditions
            if(abs(distance > 1000))    distance = 0;        // max speed 1200Km/h
            file.println(dataString);                        // write to file
            file.sync();                                     // Use sync instead of close.
            flat_ant = flat;    
            flon_ant = flon;
            bip(bipPin, 3, 1);                              
            blinkLED(logLED, 10, 1);
         }  
        }  
      }  else {
        skip++;
        blinkLED(logLED, 10, 1);
      }
    }  else    { blinkLED(logLED, 200, 1);  blinkLED(logLED, 10, 1); }
  }  else   digitalWrite(logLED, HIGH);
}

static bool feedgps()  {
  while(Serial.available())  {
    if(gps.encode(Serial.read()))    return true;
  }
  return false;
}

void bip(int pin, int duration, int n)    {                 // Bip piezo: duree en ms et repetition
  for(int i=0; i<n; i++)  {  
     digitalWrite(bipPin, HIGH);        
     delay(duration);
     digitalWrite(bipPin, LOW);        
     delay(75);
  }
}

void blinkLED(int pin, int duration, int n)    {            
  for(int i=0; i<n; i++)  {  
   digitalWrite(pin, HIGH);        
   delay(duration);
   digitalWrite(pin, LOW);
   if(n > 1)    delay(200);  // ex500
  }
}  

int getBatVolt()      {
int results;
const long InternalReferenceVoltage = 1098L; //1050L;  // Adjust value to your boards specific internal BG voltage x1000
   // REFS1 REFS0    --> 0 1, AVcc internal ref.    // MUX3 MUX2 MUX1 MUX0  --> 1110 1.1V (VBG)
  for (int i=0; i <= 3; i++)     {  //4 readings required for best stable value?
    ADMUX = (0<<REFS1) | (1<<REFS0) | (0<<ADLAR) | (1<<MUX3) | (1<<MUX2) | (1<<MUX1) | (0<<MUX0);
    ADCSRA |= _BV( ADSC );                                                    // Start a conversion
    while( ( (ADCSRA & (1<<ADSC)) != 0 ) );                                   // Wait for it to complete
    results = (((InternalReferenceVoltage * 1023L) / ADC) + 5L) / 10L;        // Scale the value
 }
 return results;
}

void GoToSleep()    {
  Serial.end();
  ADCSRA = 0;                                        // disable ADC
  set_sleep_mode (SLEEP_MODE_PWR_DOWN);  
  sleep_enable();
  MCUCR = _BV (BODS) | _BV (BODSE);                  // turn on brown-out enable select
  MCUCR = _BV (BODS);                                // this must be done within 4 clock cycles of above
  sleep_cpu ();                                      // sleep within 3 clock cycles of above
}  

boolean getConfig()  {                              // Read the Configuration information (Config.txt)
boolean result = true;                              // file content: X;Y
  if (file.open("Config.txt", O_READ) )    {        // X=seconds Y=metersX10 (between 2 records)
    if(file.available() >= 3)  {    
      logRate = (file.read() - '0') * 1000;
      file.read();                                  // drops ";"
      minDist = (file.read() - '0') * 10;
    }    else  result = false;
    file.close();
  }    else    result = false;
  return result;
}

I use two nice libraries for this project
 - SdFat from William Greiman
 - TinyGPS from Mikal Hart

Both libraries come with sample code I happily reused
Kudos to these two gentlemen for their hard works
148  Topics / Robotics / Re: Balancing robot PID tuning trouble on: November 16, 2013, 02:40:37 am
Hi Dwacito
Quote
For the code I mostly followed the advice from Kas' thread which has been super helpful (thanks heaps Kas!)

Thanks, glad it helped for your project  smiley-cool smiley-cool

I suggest you have a look at Balanduino open project for additional ideas
You can contact Kristian, he is very knowledgeable and helpfull

Finally, when you bot is resonably stable, add a bluetooth card and move it !!!

Should you own an Android phone or tablet, you can use Kristian code or my general purpose Joystick bluetooth Commander application.



Discussion and support here

Enjoy this fascinating and educational balancing project  smiley-wink
149  Community / Exhibition / Gallery / Re: GPS logger on: November 15, 2013, 10:47:30 am
Quote
Nice logger.... kas are you going to release your code and stripboard layout?

Thanks rbright

I will clean my code and post it within a few days

For the layout ...  smiley-red smiley-red
would the breadboard prototype photo help ??


150  Community / Exhibition / Gallery / Re: GPS logger on: November 15, 2013, 10:07:22 am
Quote
If it is running on a battery, which it does when I'm driving and it's recording the track, there's no point trying to talk to the Serial port. I suppose it doesn't really matter - the bits won't go anywhere :-).
If I'm testing it at home, then I do want to see the failure message on the Serial monitor. Basically, it's a bit of old debugging

In this project, error Messages are "Bip coded" and transmitted both through the built in buzzer
and the status LED



If everything is OK, I expect 2 short Bips at startup
If I forget to insert the SD card, I am warned with 4 long Bips  smiley-red

Code:
void setup()    {
....
  if (!sd.begin(CS) || !getConfig())  {                    // Initialize the SD and get configuration
    bip(bipPin, 250, 3);                                   // error
    blinkLED(logLED, 10, 3);
    while(1);
  }
  if (!file.open("LOG.CSV", O_CREAT | O_WRITE | O_APPEND))  {// create or open the data file for append.
    bip(bipPin, 250, 4);                                     // error
    blinkLED(logLED, 10, 4);
    while(1);
  }
....
  blinkLED(logLED, 10, 2);
  bip(bipPin, 10, 2);                                       // ready
}


void bip(int pin, int duration, int n)    {                 // ms and number of bips
  for(int i=0; i<n; i++)  {  
     digitalWrite(bipPin, HIGH);        
     delay(duration);
     digitalWrite(bipPin, LOW);        
     delay(75);
  }
}

void blinkLED(int pin, int duration, int n)    {             // ms and number of blinks
  for(int i=0; i<n; i++)  {  
   digitalWrite(pin, HIGH);        
   delay(duration);
   digitalWrite(pin, LOW);
   if(n > 1)    delay(200);  // ex500
  }

Pages: 1 ... 8 9 [10] 11 12 ... 27