go_away

Author Topic: WebbotLib timer skipping count?  (Read 1822 times)

0 Members and 1 Guest are viewing this topic.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
WebbotLib timer skipping count?
« on: September 11, 2009, 02:36:21 PM »
I'm using WebbotLib v1.5 on an Axon.

The timer isn't outputting correct values. What I mean is, clockGetus() is disagreeing with delay_ms() . . .

For example, I tell it to delay_ms() for 60 seconds, then output the final time. Code below.

My guess is that its some kind of rounding error in the lib that just keeps adding up . . .

The results:
delay_ms()    clockGetus()
10000          10238
30000          30716
45000          46075
61000          62457

Its like an additional 238ms are being added every 10 seconds!

Code: [Select]
start_freq = clockGetus();

delay_ms(60000);//input time in ms

end_freq = clockGetus();

duration_freq=(end_freq-start_freq);

rprintf("\n s: %ld\n",duration_freq/1000);

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,152
  • Helpful? 110
Re: WebbotLib timer skipping count?
« Reply #1 on: September 11, 2009, 03:06:52 PM »
Is this using the last 1.5 official release or with the unfficial 1.5a release I emaied to you for testing/playing with servo judder?
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: WebbotLib timer skipping count?
« Reply #2 on: September 11, 2009, 03:20:19 PM »
Is this using the last 1.5 official release or with the unfficial 1.5a release I emaied to you for testing/playing with servo judder?
1.5 official release. ;D
(I was quick to downgrade after that 1.5a failure, hehe :P)

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: WebbotLib timer skipping count?
« Reply #3 on: September 14, 2009, 07:30:16 AM »
Thanks for your v1.5b.

It works! I told it to delay 45ms, and it outputted exactly 45000.

Also, it mostly fixed the servo twitching problem. It still happens, but its significantly reduced.

It doesn't seem to have broken anything, but then again I haven't tried the scheduler yet.

I believe you have a new release ready to ship ;D

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,152
  • Helpful? 110
Re: WebbotLib timer skipping count?
« Reply #4 on: September 16, 2009, 03:24:43 PM »
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: WebbotLib timer skipping count?
« Reply #5 on: September 24, 2009, 05:15:42 PM »
I hooked it up to an oscope today with an Axon.

It was accurate to the oscope within 0.58% of real time. Pretty darn good! I didn't try multiple Axons, but I'm sure they are all close.

 


Get Your Ad Here

data_list