Landing : Athabascau University

Activity

  • Tyler Lucas published a blog post Beyond PID November 28, 2017 - 7:12pm
    Beyond PID
    Let’s talk about feedback in closed-loop control systems.
    Comments
  • Tyler Lucas published a blog post PID Without a Clue November 28, 2017 - 7:03pm
    PID Without a Clue
    Based on the article "PID Without a PhD" by Tim Wescott
    Comments
    • Tyler, great article. Very well written. Thanks.

      Susanne Cardwell November 29, 2017 - 9:08pm

    • Thanks, Tim, I might do that. Noise was already being smoothed with a rolling average (100-point), but it wasn't enough and averaging so many points was causing problems of its own. My next step would be circuit isolation from heater and some RC filter.

      Tyler Lucas November 29, 2017 - 10:01pm

    • Filtering only helps for noise that's well outside of the desired bandwidth of the control loop -- if the noise is within five to ten times the desired bandwidth, then you need to get rid of it at the source.

      That means figuring out if the problem is the sensor choice, it's location, the cabling, or the signal conditioning electronics.  You mentioned separating grounds -- that's a Really Good place to start, but it may not be the end.

      (It may be that you'll get too deep into this than is reasonable for a class project, too -- getting the utmost out of a control loop is like peeling an onion -- you take a layer off, the problems get a bit smaller, you cry, and then you have to do it all over again.)


      - Tim Wescott

      Anonymous December 2, 2017 - 12:51pm

  • Tyler Lucas commented on the blog Implementing Sine and Cosine Without Floats November 15, 2017 - 1:20pm
    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...
  • Tyler Lucas published a blog post Implementing Sine and Cosine Without Floats November 15, 2017 - 10:46am
    Implementing Sine and Cosine Without Floats
    Working example of integer-based sine and cosine lookup table for Arduino.
    Comments
    • 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

    • Tyler,

      This is a great write up, good explanation and documentation. Thank you. If I have time I’m going to refactor this into my project. I just spent the last while programming the basics of dead reckoning for a two-wheeled, differential steering rover and of course the core of it involved the use of sine and cosine and lots of floats. I’ve read several articles admonishing the use of floats on micro controllers. It’s understandable as you’ve noted due to their limited memory, processing power, and lack of floating point unit. I plowed ahead anyway and with no noticeable performance problems yet. The encoder interrupts are firing about 750/s and I’m calculating coordinates and orientation 10/s. My only concern would be sacrificing precision. Dead-reckoning is known for error accumulation anyway.

      peterde December 11, 2017 - 8:30pm

    • Glad you could use it!

      You can add another factor of ten or two to increase precision. (The above code is the float output multiplied by 1000.) Would just need to be a bit more careful about overflow when doing math with the output, especially multiplication. E.g. 'sinx' output may be as high as +10000, so don't multiply by more than 32 if using int, ~200000 if using long. Really, manually keeping track of these ranges is a pain in the ass, especially when debugging it (without a debugger/JTAG/etc), so if your application works with floats, I'd just use them... until it doesn't work. :)

      Also, IntegerGeometry.h and IntegerGeometry.cpp were promoted to the master branch after a bit more review.

      Tyler Lucas December 11, 2017 - 8:58pm

  • Tyler Lucas commented on the blog Using Private Arduino Libraries with Eclipse October 23, 2017 - 7:27pm
    Yep, everything is moved over now and working, using PlatformIO's version of the SdFat and QuickStats libraries. Thanks Peter!
  • Tyler Lucas commented on the blog Using Private Arduino Libraries with Eclipse October 23, 2017 - 5:13pm
    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...
  • Tyler Lucas replied on the discussion topic Are the RedBoard ICSP pins connected to the GPIO SPI pins 10-13? October 23, 2017 - 11:58am
    I got a reply on the Arduino.cc forums: https://forum.arduino.cc/index.php?topic=507299.0 They ARE connected. -- spycatcher2k   Meaning I'll have to move my sonar and servo gadgets to other pins.
  • Tyler Lucas added a new discussion topic Are the RedBoard ICSP pins connected to the GPIO SPI pins 10-13? October 23, 2017 - 11:16am
    I'm adding an SPI SD card module to my gizmo. It'd be great if I could use the ICSP header (and one GPIO for CS) to plug it in, as my project is already using the GPIO SPI pins (10 - 13) for non-SPI purposes (HC-SR04 sonar distance sensor and servo...
  • Tyler Lucas commented on the blog Generating Robotic Arm Working Ranges October 22, 2017 - 10:46pm
    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...
  • Tyler Lucas published a blog post Generating Robotic Arm Working Ranges October 20, 2017 - 5:58pm
    Generating Robotic Arm Working Ranges
    tl;dr - Use Photoshop.
    Comments
    • 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

  • Tyler Lucas commented on the blog Project Proposal: Automatic Object Relocation October 19, 2017 - 9:07am
    Thanks! The end-effector has a metal claw, servo, and sonar sensor. Joint friction adds a bit of load, too. It was a tiny drill bit -- must have been 1/16" -- just for a pilot hole.
  • Tyler Lucas commented on the blog Project Proposal: Automatic Object Relocation October 19, 2017 - 12:37am
      Although the servos have proven to be sufficient to move the whole contraption with a moderate load, I have ended up adding something like a counterweight. The end-effector is kept level with respect to the ground regardless of arm angle via...
  • Tyler Lucas commented on the blog Using Private Arduino Libraries with Eclipse October 16, 2017 - 6:22pm
    Looks great @peterde! The screenshot is the Atom version, right? I haven't given Atom much attention beyond downloading and playing with the windows. (It sure is pretty.) I wonder how it's serial terminal behaves in our embedded toolchain. Eclipse's...
  • Tyler Lucas commented on the blog Using Private Arduino Libraries with Eclipse October 14, 2017 - 3:41pm
    GitHub code runs fine using the Arduino IDE, and it's really easy. This guy lays it out: https://www.baldengineer.com/installing-arduino-library-from-github.html I'm going to use the QuickStats library to filter some noisy sensor data. It is...
  • Tyler Lucas commented on the blog Switching from the Arduino IDE to Eclipse October 14, 2017 - 3:11pm
    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 published a blog post Using Private Arduino Libraries with Eclipse October 14, 2017 - 3:10pm
    Using Private Arduino Libraries with Eclipse
    I can't believe this is still so difficult.
    Comments
    • 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

  • Tyler Lucas published a blog post Switching from the Arduino IDE to Eclipse October 13, 2017 - 5:34pm
    Switching from the Arduino IDE to Eclipse
    Eclipse eats the Arduino IDE for breakfast.
    Comments
    • 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

  • Tyler Lucas commented on the blog Teaching Machines to Think with Programming Languages October 11, 2017 - 7:50pm
    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...
  • Tyler Lucas published a blog post Teaching Machines to Think with Programming Languages October 11, 2017 - 5:36pm
    Teaching Machines to Think with Programming Languages
    The chief function of the body is to carry the brain around. -- Thomas A. Edison
    Comments
    • 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

  • Tyler Lucas replied on the discussion topic How to fit non-linear functions to data in Excel? October 9, 2017 - 2:24pm
    Thanks, might take a look if I get a few hours to kill. Haven't been able to get the free membership upgrade through AU to work, but I'll try again.