pic: Time flies when you're having fun... with an RTC on the RoboRIO.



Project is here:

Use at your own risk obviously. Do you really need to be warned not to put code on your robot written by Marshall?

Also, consult an LRI if you obtain an NTP correction for longer than 4 hours.
Clickable Link: GitHub - FRC900/rtc-bq32k-rRIO: Supercharging the RoboRIO with the BQ32000 from TI

1 Like

10/10

Pardon my ignorance, but the purpose of this is what? :confused:

Keeping time of course. It’s an RTC module.

The RoboRIO does not have a RTC (calendar/wall time clock). It normally gets the correct time from the driver’s station, but there are use cases where this might not happen and you still want to create logs with useful timestamps, a RTC (real time clock) is a good way to handle the problem if you do not have (or cannot depend on) internet connectivity.

Interesting, I was not aware of this. Are there cases aside from data logging that this could benefit as well? Say time-based robot actions (autonomous, etc.)? Is there enough variance in the DS-acquired time that there would be any benefits to this for anything aside from logs?

Maybe. :wink:

Probably not, because most of the things you care about have to do with the *change\i] in time, rather than the time itself. So as long as you have a base number to say ‘this is the start of the program’, then everything past there will be in reference to that start number.

Knowing the ‘exact’ time is really only useful for logging, but even then, not really useful. Knowing that the robot finished autonomous at 11:33:22.879 is (to me) less useful than knowing it finished 11.3 seconds into autonomous*

  1. Why are exact timestamps useful?

  2. Why are relative timestamps not useful?

Both are useful. They aren’t mutually exclusive.

Does that RTC module have a battery?

If so probably should check the battery rules.

EDIT: I see that is a super capacitor.
So no battery issue.
http://www.newark.com/kemet/fc0v474zftbr24/cap-super-0-47f-3-5v-smd/dp/18X4840

You read the friendly manual… Excellent. :slight_smile:

Have you tried fully discharging that capacitor then connecting it and turning on the RoboRio?

I don’t see a charger circuit schematic.

Ohh! Good question! So, my code changes to the stock module were to enable the trickle charge setting for the RTC (without all of the device tree shenanigans). It has some internal bits to flip to make that work:

http://i.imgur.com/r849owXl.png

Image is from the TI data sheet for the BQ32000.

I’m still testing all of this so it really is “use at your own risk” right now.

Because someone is going to ask: I wasn’t happy with the charge rate on the diode side above so I went the other route.

Positive feedback left - you’ve taken great initiative - love to see this work out.

I would recommend putting a label on it that says “Not a Battery” :yikes:

In all seriousness, I had wondered the same thing, how you were persisting the clock through power outages, and had to go take a look myself earlier. I may have missed it in the documentation, how long will the clock persist once the robot is turned off?

There are situations where power may be inadvertently cut to the RoboRio. Even if it’s for a fraction of a second, if it’s enough to cause the RoboRio to reboot the relative timestamps may not give you what you want. Further, if you’re trying to track down an issue at the end of the day and have video showing it occurring in different matches, having exact timestamps can let you more easily isolate the different occurrences.

And looking at non-FRC robot related usage, exact timestamps are pretty much critical for many applications. When a user calls in to complain that “something bad” happened with an application, many times your first question (after ascertaining that it really was “something bad”) is going to be when did it occur. Then you can go to the logs, search the timeframe the user gives (plus or minus half an hour because users aren’t always the most accurate people) for the user’s ID and figure out exactly what happened and why. Relative timestamps are pretty useless in many professional applications.

Testing this now. I’ll have an update once I know. I know it can handle 4 hours but I suspect 12 is likely.

Even if it had a battery, it should be legal unless Q&A or other authority says that an RTC is not a computing device.

Well, you would need to secure the RTC a lot better than in the picture.

So in other words… longer than a team could really need at a competition. Set the time first thing in the morning, then don’t worry about it the rest of the day. Nice!

And really, it would be possible to take it off the roboRio and plug it into a small battery pack to persist overnight at competitions if you really wanted to. That wouldn’t even be that difficult.

This supercap solution is just a bit less likely to get you held up as people start asking questions like: was the battery shipped with the RTC module?

Always wondered if inspectors would catch a Dallas Semiconductor RTC chip. The 1/4" tall package with the litium coin cells potted in:

http://www.mcamafia.de/mcapage0/dsrework.htm