🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Accurate timesource / loop execution time?

    Scheduled Pinned Locked Moved UIFlow
    1 Posts 1 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      honkkis
      last edited by

      Hi,
      I'm developing (UiFLow2, Core2) powermeter/energy counter for wood fired boiler. So far, I've been able to create required hardware, read the sensors using ADC and digital input, but because it's powermeter, it needs exact timekeeping to count generated energy and power accurately. My software has five conditions in main loop for different states of boiler and only one of them is energy generating, other are warming up, cooling down etc...

      I think there are two options for calculating energy and power:

      1. loop that lasts exactly known time, preferably one second (1000ms) or

      2. loop lasting artificial time and time period is measured (this can be below one second, or slightly more, even variable)

      For the accuracy requirement, for option one it's not catastrophic to have, say 3590...3010 measurements in hour, but for example 2972 would be terrible accuracywise. For option two, still hoping to get measurement about every second. There are three purely analog temp sensors and two digital inputs, conversion times shouldn't be problem.

      Is 1000ms timer (UiFlow2 Timer) right tool for this, or timedelta (UiFLow2 Time / ticks)? This should be very easy, if loop execution time is known. Doucmentation for UiFlow2 still need improvements (compared to UiFlow1). I know this ain't running on RTOS, but still want it to be as accurate as possible.

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post