In fact, calculators have the same floating point limitations as computers, which makes sense, because calculators are simple computers. Try adding 0.1 to 1,000,000,000 and you'll get 1,000,000,000, not 1,000,000,000.1 (unless your calculator uses 64-bit numbers, which can precisely display up to about 18 digits); or try cos(0.00001) and you'll get 1, not 0.99999999995. They seem to be more accurate because they can limit their outputs. It's worth noting that having a hardware FPU does not guarantee greater precision than using a floating point library, as Arduinos do. The highest precision operations are actually done in software. Take a look at Java's BigDecimal for a great example and explanation.
You are correct in thinking that there could be a loss of precision when working with base-10 numbers in a binary system. The IEEE 754 standard defines 5 binary and 3 decimal floating point formats, where the latter can store decimal numbers exactly. Since the libm.a floating point library (Arduino/avr-gcc, etc.) likely uses the "binary32" format, it does not represent decimal number exactly, and is accurate to about 7 digits. Any format is no more precise than the value of the least significant bit ("LSB") (big-endian only; MSB value for little-endien) in the significand. For binary32 numbers, this is 2^-23 times the exponent, which is related to its magnitude. A quick search found a library that may be able to introduce the decimal32/64/128 formats to an Arduino platform, [here]: GitHub.com/toddtreece/esp8266-Arduino/.../decimal (it is for the ESP8266, a 32-bit Xtensa system, however, so it wouldn't work out of the box, if at all, on the 8-bit AVR/etc. systems we are using).
Tyler Lucas November 15, 2017 - 1:20pm
Wow. How did you get so skilled in graphics, Tyler? Was it part of an engineering education? I wonder if I could import parts from Tinkercad into Photoshop. And what made that awesome animation? Fusion360? Nice work.
Susanne Cardwell October 20, 2017 - 6:38pm
Hi Tyler. How many degrees of freedom does your robotic arm have? Thank you.
Susanne Cardwell October 21, 2017 - 2:34pm
Hey, thanks. I've picked up on graphics by fiddling with it over the past decade, a photograhy hobby, and a bit of perfectionism. Fusion360 did the animation. It's actually not great at doing animations, but it does do the 'explode' bit well. The arm has 3 DOFs, 4 if including the claw.
Tyler Lucas October 22, 2017 - 10:46pm
I just tried linking in a larger library, SdFat, with multiple directories, using junctions (mklink /j <target> <source>). I've spent about 30 minutes fighting with Eclipse to build/link the thing, and it's still not working. Gonna give ParticleIO VSCode a shot for the next 30 minutes, to change the pace.
Tyler Lucas October 23, 2017 - 5:13pm
Just installed the SDFat library via PlatformIO library manager.
peterde October 23, 2017 - 6:16pm
Yep, everything is moved over now and working, using PlatformIO's version of the SdFat and QuickStats libraries. Thanks Peter!
Tyler Lucas October 23, 2017 - 7:27pm
This is a really good description of Eclipse setup. Thanks!
I have never used Eclipse, but i use NetBeans and having a good IDE is immensely helpful. I have not got to the point in my project where I am looking at whether the Arduino IDE is enough to do the coding, But I will definitely be looking into Eclipse if I find it is not.
Ebony Campbell October 14, 2017 - 1:44pm
I had trouble adding a library that wasn't in the Arduino Downloads Manager, so I wrote about it here: Using Private Arduino Libraries with Eclipse.
Tyler Lucas October 14, 2017 - 3:11pm
Tyler,
I was in the same boat looking for a more robust alternative to the Arduino IDE so your post Switching from the Arduino IDE to Eclipse came at the right time. Eclipse is a great IDE and I was happy to hear there was an Arduino extension. I followed your directions as well as watching Doug Schaefer’s video demonstration.
I was also frustrated by the shortcomings in the Eclipse C++ IDE for Arduino that you mention in this blog post. The steps necessary to include your own libraries makes the product feel like a not-fully-baked solution.
I just posted a summary of my IDE explorations and the solution I think I’m going to go with. I’d be interested to get your take on this.
Thanks for your helpful information…
Peter
peterde October 16, 2017 - 2:21pm
Nicely written Tyler. As for your article on control theory, is control theory onerous math ... and avoidable? What applications do we need control theory for ... and why is it so vital?
Thank you.
Susanne Cardwell October 11, 2017 - 6:55pm
Control theory does get into pretty gnarly math. Laplace and z-Transforms combined with linear algebra (non-linear if you're a masochist). You don't need it for this course, and can avoid it for many applications, even some of those that use a control system. That's what PID Without a PhD is all about. I've been trying to write a blog post all week that derives the optimal PID coefficients for moving my robotic arm, but have been stumped by the math to the point of giving up on that approach. (And I've already done a fair amount of that type of math before, having taken control systems courses.) The theory is important when you need to improve control performance.
Tyler Lucas October 11, 2017 - 7:50pm
Check out Tableau software for your Excel data, Tyler.
Susanne Cardwell October 11, 2017 - 8:20pm
The Landing is a social site for Athabasca University staff, students and invited guests. It is a space where they can share, communicate and connect with anyone or everyone.
Unless you are logged in, you will only be able to see the fraction of posts on the site that have been made public. Right now you are not logged in.
If you have an Athabasca University login ID, use your standard username and password to access this site.
We welcome comments on public posts from members of the public. Please note, however, that all comments made on public posts must be moderated by their owners before they become visible on the site. The owner of the post (and no one else) has to do that.
If you want the full range of features and you have a login ID, log in using the links at the top of the page or at https://landing.athabascau.ca/login (logins are secure and encrypted)
Posts made here are the responsibility of their owners and may not reflect the views of Athabasca University.
We block sites that track your web browsing without your permission. If a link is greyed out, click once to enable sharing, once more to share.
Thanks Tyler. Floating point numbers are a problem in computer languages. Inaccurate calculations. When I was in the math program, we rounded numbers to the fifth decimal place.
I wonder why computer languages have such inaccuracy while calculators are accurate. Might it have something to do with binary calculations instead of base 10?
Thanks Tyler for answering Ebony's and my questions on the circuit board. Much appreciated.
Susanne Cardwell November 15, 2017 - 11:14am