Show Posts
Pages: 1 ... 8 9 [10] 11 12 ... 26
136  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

137  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
138  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
139  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
140  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
141  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 ??


142  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
  }

143  Community / Exhibition / Gallery / Re: GPS logger on: November 14, 2013, 04:04:20 pm
@el_supremo

Yeah, that the way to go
Closing Tags should always be added after each Long/Lat recording, as the logger may be switch off at any time.
Out of curiosity, what's about ???
Code:
#ifndef BATTERY
.....
144  Community / Exhibition / Gallery / Waterproof box on: November 14, 2013, 03:50:48 pm
@Peter_I

Quote
And I like the box.
Is it a waterproof cigarette case?
Just a general purpose box
Search for "waterproof" "box" "plastic" on eBay
example: ($2.85 shipped)
http://www.ebay.com/itm/Outdoor-Waterproof-Plastic-Container-Key-Money-Storage-Box-Case-Holder-/180917961914?pt=LH_DefaultDomain_0&hash=item2a1f8d04ba



Thanks for the comments
145  Community / Exhibition / Gallery / Re: GPS logger on: November 14, 2013, 12:43:43 pm
Hi Pete,

Quote
If you don't actually need the .CSV file itself, you could record the data directly to the SD card

You are right, no real need for the cvs file
I choose this road for three reasons:

1) Terminate the file with the relevant ending Tags
Code:
      </coordinates>
    </LineString>
  </Placemark>
</Document>
</kml>

Could be done on the fly:
 - open SD card file
 - rewind 56 Bytes (erase previous ending Tags)
 - Write Long + Lat
 - write ending Tags
 - close file

2) compute average speed, cumulative uphill and downhill...

3) Get a final file with date stamp, which is not possible within Arduino ecosystem

Thanks for your interest
146  Community / Exhibition / Gallery / GPS logger on: November 14, 2013, 10:48:36 am
Yes this is another GPS Logger project
Track is recorded on the SD card as a .CVS file which is then converted as a Google Earth .kml file
Just download and double click on the attached sample file (you should be logged to the forum to see the file)
It will directly open in Google Earth and display the track.



This logger design is focused on low power consumption by combining several technologies that can be reused for other, non related, projects:
A stripped down Arduino (plain AtMega 328P, $2.99 shipped) removes Led's and FTDI overheads. Processor works @ 8Mhz, 3V.
The board is directly powered by a single 3.2V lithium iron phosphate battery; no need for a power hungry DC/DC converter.
Finally, the processor is put asleep below 3V to avoid battery deep discharge.
By combining all those, I was able to improve battery life from a couple of hours to 20+ hours





This project is rather modular and educational, it will let you master several techniques
 - Arduino on a board (thanks Super Nick  smiley-wink)
 - LiFePO4 battery technology
 - battery monitoring w/o voltage regulator (not trivial...)
 - Arduino sleeping modes (thanks again Nick)
 - GPS NMEA 0183 serial protocol
 - SD Card SPI communication
 - Python scripting
 - KML format
 - soldering and packaging in a nice waterproof box

Disclaimer: I invented nothing, just putting stuff together  smiley-wink

Should you need additional info's and links on specific points, let me know
147  International / Français / Re: Bluetooth JY-MCU on: November 08, 2013, 01:54:17 am
Quote
ok , merci , c'est  sympa
ce sera une valeur de trim independante (nouvelles "variables" vers arduino ) ou impactant les valeurs X/Y du joystick sous android ?
Il s'agit d'un décalage de zéro sur les valeurs X/Y du joystick (de -10 à +10)

Quote
quand c'est dispo tu fais signe ici ?
OK  smiley-wink


@BobbyWomack
Nous avons détourné le sujet initial  smiley-roll-blue smiley-roll-blue smiley-roll-blue
As-tu résolu ton problème de transmission ??
148  International / Français / Re: Bluetooth JY-MCU on: November 06, 2013, 11:17:16 am
Quote
un truc qui pourrait etre sympa, mais je sais que la place est comptée
mettre 2 slider (un en X et un en Y) pouvant etre utilisé sur arduino comme trim ou autres usages.

Je prepare une nouvelle application qui permettra également le pilotage avec les accelerometres, en inclinant le smartphone.
En raison de la place limitée, j'ai inclu un écran séparé pour le réglage du trim.
Voici une copie écran dans Eclipse:

149  International / Français / Re: Bluetooth JY-MCU on: November 03, 2013, 01:28:55 am
Quote
déjà et sans avoir aucune idée des possibilités/difficultés, je verrais bien un bouton clickable au centre de la "boule" du joystick

J'ai essayé, ça ne donne rien d'intéressant, car le fait de presser le bouton central entraine souvent un déplacement indésirable du joystick.  smiley-sad-blue
J'ai donc ajouté des boutons, qui peuvent être configurés en ON/OFF ou en poussoir
150  International / Réalisations et Projets Finis / Re: Robot Araignee on: November 02, 2013, 06:25:52 am
Super boulot, en conception et en réalisation
Il ne te manque plus qu'une carte Bluetooth et un smartphone pour piloter la bête

Va voir ici:
http://forum.arduino.cc//index.php?topic=195225.msg1451921#msg1451921
réponse #7
Pages: 1 ... 8 9 [10] 11 12 ... 26