scotty134

Count uptime on servo motors

5 posts in this topic

Hello,

I need to cound uptime on servo motors. I though to use AccumulationTimer and have ET as retain. Unfortunately, AccumulationTimer resets ET after each power loss. Is it a simple way to count uptime on servo motors without making extra logic?

Regards,

Scotty

Share this post


Link to post
Share on other sites
50 minutes ago, scotty134 said:

without making extra logic

I don't know what you expect, but if the built-in feature doesn't do what you need, how would you avoid extra logic?

What precision you need dictates how complex the alternate logic is.  Consider monitoring the RTC's seconds.  Whenever it changes, and the servo is on, increment a DINT register.  Make sure that DINT register is set to retain its value.

Share this post


Link to post
Share on other sites

ET is constantly overwritten. Your value is indeed being retained but upon the first scan it is overwritten. Like pturmel said just use the RTC. The logic is quite small and simple:

 

Capture.PNG

2 people like this

Share this post


Link to post
Share on other sites

Initially I started with logic below #picture#1. But my idea was crashed after fist power reboot.

photovaltaic, based on your example. I modified a bit the node to get rid off the bit using embedded tools - picture#2. I will test it and let you know soon.

ServoUpTime.JPG

ServoUpTime2.JPG

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now