Aller au contenu


lyc-gb

Inscrit(e) (le) 10 févr. 2014
Déconnecté Dernière activité févr. 17 2014 07:19
-----

Sujets que j'ai initiés

Problème entre servos moteur et arduino en utilisant le tlc 5940 de sparkfun.

10 février 2014 - 05:54

Le problème est le suivant :
Normalement nous pouvons orienté les servosmoteurs de 0 à 180 degrés a partir du programme suivant de la librairie tlc 5940:

#include "Tlc5940.h"
#include "tlc_servos.h"

#define SERVO_CHANNEL 0
#define DELAY_TIME 20

void setup()
{
tlc_initServos(); // Note: this will drop the PWM freqency down to 50Hz.
}

void loop()
{
for (int angle = 0; angle < 180; angle++) {
tlc_setServo(SERVO_CHANNEL, angle);
Tlc.update();
delay(DELAY_TIME);
}
for (int angle = 180; angle >= 0; angle--) {
tlc_setServo(SERVO_CHANNEL, angle);
Tlc.update();
delay(DELAY_TIME);
}
}

___________________________________________________________________________________________

mon programme:

#include "Tlc5940.h"
#include "tlc_servos.h"

#define SERVO_CHANNEL 0
#define DELAY_TIME 20

void setup()
{
tlc_initServos(); // Note: this will drop the PWM freqency down to 50Hz.
}

void loop()
{

tlc_setServo(SERVO_CHANNEL, 30);
Tlc.update();
delay (1000);

tlc_setServo(SERVO_CHANNEL, 90);
Tlc.update();
delay (1000);
tlc_setServo(SERVO_CHANNEL, 0);
Tlc.update();
delay (1000);
tlc_setServo(SERVO_CHANNEL, 180);
Tlc.update();
delay (1000);
tlc_setServo(SERVO_CHANNEL, 60);
Tlc.update();
delay (1000);
tlc_setServo(SERVO_CHANNEL, 120);
Tlc.update();
delay (1000);

}
_________________________________________________________________________________________

Cependant quand nous utilisons celui-ci , le servomoteur ne tourne qu'à 90 degrés.
En augmentant la valeur de 0 a 255 nous pouvons augmenté l'angle , cependant il s'arrête a 255 et on est a peut près à 110°aprés cela il y a un décrochement.

Pouvez vous m'aider afin de pouvoir atteindre 180° .
Merci d'avance ! :)