Wrong Servo Library?

Hi,

I received my Diecimila now, and did all the beginner stuff like blinking and light sensing etc.

However I stumbled over the servo control.

This pages says that it uses a library which is by using direct pulses much more acurate: http://www.arduino.cc/playground/ComponentLib/Servotimetimer1

However the link seems to point to the "normal" servotimer library (0-180° rotation). With this library my servo movement is very shaggy.

With the code from: http://principialabs.com/arduino-serial-servo-control

I get nice and smooth movement, perfect speed control with "hacked" servos, but it is software and not in hardware like the one above...

Any hints where to get the more precise lib?

Carsten

This may be what you are looking for: http://www.arduino.cc/playground/uploads/ComponentLib/servotimetimer1.zip

It does not work :(

Even the LED I attached to the PWM Pin is not working.

I installed the files from the zip, then I compiled, app is running (checked with serial debugging), but no reaction on the LED or the servo.

So I wondered if the ServoTimeTimer1.o in the zip is not compatible and removed it, then while compiling I get this error:

ServoTimeTimer1.cpp: In static member function 'static void ServoTimeTimer1::seizeTimer1()':
ServoTimeTimer1.cpp:43: error: 'TICIE1' was not declared in this scope
o: In function `__static_initialization_and_destruction_0':
undefined reference to `ServoTimeTimer1::ServoTimeTimer1()'o: In function `loop':
o: In function `setup':

It fails here: (second line)

#if defined(__AVR_ATmega168__)
    TIMSK0 &= ~(_BV(TICIE1) | _BV(OCIE1A) | _BV(OCIE1B) | _BV(TOIE1) );
#else
    TIMSK &= ~(_BV(TICIE1) | _BV(OCIE1A) | _BV(OCIE1B) | _BV(TOIE1) );
#endif
    SREG = oldSREG;  // undo cli()

I am lost :-X

Carsten

You will find the solution here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1200932603

It does not work :(I am lost :-X

Carsten

when all seems lost, try entering a few key words of the error message in the search box ;)

Hi:

I too am lost in the wilderness of getting the ServoTimeTimer1 library to compile under Arduino V9 or V10.
I get the same compiler error indicated in an earlier post.

Help would be appreciated.

-Terry Thrift-

Hi:

I too am lost in the wilderness of getting the ServoTimeTimer1 library to compile under Arduino V9 or V10. I get the same compiler error indicated in an earlier post.

Help would be appreciated.

-Terry Thrift-

Terry, you say you get the same problem as mentioned above but neglected to say if you tried any of the solutions linked in the post above yours.

I apologize for not trying any of the suggestions.

With some help I tried removing the OR of TICIE1 .

The code compiled and a pot now controls a servo. However, their is noticeable jitter when holding a constant servo position.

I need to see if I can find something other than the library that might be causing the jitter. I tried it with 3 servos (1 analog and 2 digital). Even the analog servo was chattering.

If I can't find anything else causing the jitter, I plan to try some of the other suggestions. a) TMSK1 instead of TMSK0 b) ICIE1 instead of removing TICIE1

Also I should go find some doc on the ATmega168 innards. (might not hurt to see what I can learn)

Thanks, -Terry-

OK no jitter now. ;D
Issuing location commands via serial communication instead of via the pot cleared up the jitter.

a) removing “_BV(TICIE1) |” seems to work fine.
b) using “_BV(ICIE1) |” instead of “_BV(TICIE1) |” seems to work fine.
c) the servo turns whether I use TMSK1 or TMSK0

Weird.
Wrt (c) I was expecting that one of them would work and the other one would fail.

I don’t understand how bashing the interrupt mask for timer0 would work at all if timer1 is being used.

-Terry-