From 35c16bbd588797f7a72a777b6c6dd68397db02a3 Mon Sep 17 00:00:00 2001 From: Priti Jha <42322432+PRITI24@users.noreply.github.com> Date: Sat, 12 Oct 2019 13:17:13 +0530 Subject: [PATCH] Removed default pulse width This deafult pulse width is not good for some servos as Mg995 shows bad behaviour(while going to new position everytime, it first go to default position).This may result in damaging this servo motor.Almost 10-12 servos are damaged in our case. --- VarSpeedServo.cpp | 1 - VarSpeedServo.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/VarSpeedServo.cpp b/VarSpeedServo.cpp index d84582b..882de9c 100644 --- a/VarSpeedServo.cpp +++ b/VarSpeedServo.cpp @@ -301,7 +301,6 @@ VarSpeedServo::VarSpeedServo() { if( ServoCount < MAX_SERVOS) { this->servoIndex = ServoCount++; // assign a servo index to this instance - servos[this->servoIndex].ticks = usToTicks(DEFAULT_PULSE_WIDTH); // store default values - 12 Aug 2009 this->curSeqPosition = 0; this->curSequence = initSeq; } diff --git a/VarSpeedServo.h b/VarSpeedServo.h index f75d833..16cc5f6 100644 --- a/VarSpeedServo.h +++ b/VarSpeedServo.h @@ -116,7 +116,7 @@ typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ; #define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo #define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo -#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached + #define REFRESH_INTERVAL 20000 // minimum time to refresh servos in microseconds #define SERVOS_PER_TIMER 12 // the maximum number of servos controlled by one timer