Activity Board Arlo Control System Adjustments

Activity Board Arlo Control System Adjustments

Integration KI and deadzone DZ are part of a group of values called control system constants that may need to be tuned to accommodate certain payload weights, and gearbox play.  This example program is actually setting the default values, but you can change them, and then test the responses under the conditions you need the Arlo to perform. 

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).  For more information, see the DHB-10 command set for information on KI, KIT, KIP, and DZ. 

Code for making the changes semi-permanent by writing them to the DHB-10’s EEPROM have been commented out.  As 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: No need to run this program unless you want to observe different possible Arlo behaviours as it approaches its final distance destination.

/*
  Arlo - Control System Adjustments.c
*/

#include "simpletools.h"
#include "arlodrive.h"

char *reply;

int main()
{
  print("CHECK CONSTANTS\n\n");
  print("To DHB-10      From DHB-10\n");
  print("-----------    ----------------\n");

  print("KI\\r           ");
  reply = dhb10_com("KI\r");
  if(*reply == '\r') print("\\r\n");
  else print("%s", reply);
 
  print("DZ\\r           ");
  reply = dhb10_com("DZ\r");
  if(*reply == '\r') print("\\r\n");
  else print("%s", reply);

  print("\n\nSET CONSTANTS\n\n");
  print("To DHB-10      From DHB-10\n");
  print("-----------    ----------------\n");
 
  print("KI 65\\r        ");
  reply = dhb10_com("KI 65\r");
  if(*reply == '\r') print("\\r\n");
  else print("%s\n", reply);
 
  print("DZ 1\\r         ");
  reply = dhb10_com("DZ 1\r");
  if(*reply == '\r') print("\\r\n");
  else print("%s\n", reply);

 
  print("\n\nSTORE CONSTANTS\n\n");
  print("To DHB-10      From DHB-10\n");
  print("-----------    ----------------\n");

  print("STORE KI\\r     ");
  reply = dhb10_com("STORE KI\r");
  if(*reply == '\r') print("\\r\n");
  else print("%s\n", reply);
 
  print("STORE DZ\\r     ");
  reply = dhb10_com("STORE DZ\r");
  if(*reply == '\r') print("\\r\n");
  else print("%s\n", reply);
 
  print("\nAll done!\n");
}