Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses

Arlo with an Arduino Uno & BOE Shield Brain

Curriculum

  • 1 Section
  • 14 Lessons
  • Lifetime
Expand all sectionsCollapse all sections
  • Arlo with an Arduino Uno & BOE Shield Brain
    14
    • 1.1
      ArloRobot Arduino Library
    • 1.2
      Connect BOE Shield to DHB-10
    • 1.3
      Test Shield Electrical Connections
    • 1.4
      Clear the Arduino Sketch
    • 1.5
      Test Arduino to DHB-10 Communication
    • 1.6
      Test BOE Shield Arlo Motor Connections
    • 1.7
      Test BOE Shield Arlo Encoder Connections
    • 1.8
      Try & Tune Some BOE Shield-Bot Code
    • 1.9
      Increase BOE Shield Arlo’s Top Speed
    • 1.10
      Control BOE Shield Arlo with the Terminal
    • 1.11
      More Precise BOE Shield Maneuvers with Encoders
    • 1.12
      Connect & Test BOE Shield + Arlo Ping))) Sensors
    • 1.13
      BOE Shield + Arlo Control System Adjustments
    • 1.14
      Troubleshooting Your Arlo + BOE Shield

BOE Shield + Arlo Control System Adjustments

Arlo Control System Adjustments

Integration and deadzone are part of a group of values that may need to be tuned to accommodate certain payload weights, gearbox play, and to optimize performance at certain speeds. 

If your battery is charged, and the payload is small, the default settings should be fine.  If payloads increase and decrease during runtime, you may wish to programmatically adjust those constants, either to give it some extra push to get to each final goal, or to apply less push toward the final goal to prevent oscillations (repeated over corrections). 

The next example sketch adjusts two of those constants, named KI and DZ.  Thier values can be read from the DHB-10 with the ArloRobot readConfig function, and pass “KI” to read the KI constant, DZ to read the DZ constant.  For example, Arlo.readConfig(“KI”) returns the DHB-10 motor controller’s current KI value.  To modify those values, use the ArloRobot writeConfig function.  For example Arlo.writeConfig(“KI”, 65) sets the value of KI to 65. 

Arlo.storeConfig calls for making the changes semi-permanent by writing them to the DHB-10’s EEPROM have been commented out.  For example, Arlo.storeConfig(“KI”) would make whatever value has been most recently loaded into the DHB-10 the default when it starts up.  So, long as you keep the lines with STORE commented, the changes only affect performance until the DHB-10 is restarted.  You can restart the DHB-10 by pressing and releasing its Reset button or turning the Motors power off, and then back on.

NOTE: For more information, see the DHB-10 command set in the DHB-10 Motor Controller Firmware Guide. 

  • No need to run this sketch unless you want to observe different possible Arlo behaviours as it approaches its final distance destination.
/*
  Arlo-Tune-Integral-Constants
 
  Set control system constants that give the extra push to get to the
  final position and control the allowable positional error.
*/

#include <ArloRobot.h>                        // Include Arlo library
#include <SoftwareSerial.h>                   // Include SoftwareSerial library

// Arlo and serial objects required
ArloRobot Arlo;                               // Arlo object
SoftwareSerial ArloSerial(12, 13);            // Serial in I/O 12, out I/O 13

void setup()                                  // Setup function
{
  tone(4, 3000, 2000);                        // Piezospeaker beep
  Serial.begin(9600);                         // Start terminal serial port
 
  ArloSerial.begin(19200);                    // Start DHB-10 serial com
  Arlo.begin(ArloSerial);                     // Pass to Arlo object

  int ki = Arlo.readConfig("KI");             // Check KI
  Serial.print("KI = ");                      // Display KI
  Serial.println(ki);

  int dz = Arlo.readConfig("DZ");             // Check DZ
  Serial.print("DZ = ");                      // Display DZ
  Serial.println(dz);

  Arlo.writeConfig("KI", 65);                 // Change KI
  Arlo.writeConfig("DZ", 1);                  // Change DZ

  // Uncomment code below to store new settings to the DHB-10's EEPROM.
  // Tip: To uncomment, replace the two * characters with / characters.
 
  /*
  Arlo.storeConfig("KI");                    // New KI to DHB-10 EEPROM
  Serial.println(Arlo.lastExchange);

  Arlo.storeConfig("DZ");                    // New DZ to DHB-10 EEPROM
  Serial.println(Arlo.lastExchange);
  */
}

void loop() {}                                // Nothing for main loop

Printer-friendly version
Connect & Test BOE Shield + Arlo Ping))) Sensors
Prev
Troubleshooting Your Arlo + BOE Shield
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2026 Parallax Learn • Built with GeneratePress