Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

kaiaai/firmware

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

244 Commits
244 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kaia.ai platform robot firmware

Use this open-source firmware to easily make (relatively advanced) self-driving Arduino/ROS2 robots equipped with a spinning Lidar distance sensor. Currently, I support out-of-the-box the differential (2-wheel) round base with a rear caster.

My DIY Arduino robot loves self-driving

Complete build, setup, bring-up and operation instruction - watch videos here and read troubleshooting post here.

My DIY Arduino robot loves self-driving

Technical support - visit the support forum

Compatible Lidars

List of supported Lidar models here. I wrote this Arduino Lidar library.

Compatible Motors

Steering

  • supports differential steering (2 motors with a coaster wheel)
  • 4WD skid steering, mechanum, 3WD omniwheels on the TODO list

Brushed Motors

  • supports motor drivers with two inputs (IN1/IN2)
    • including L298N, TB6612FNG, DRV8871, DRV8833, DRV8835, etc.
  • supports motors with two (quadrature) encoder outputs
    • including N20, GA25-370, etc.

Brushless (BLDC) Motors

  • supports ESC controller (PWM, CW and FG pins)
  • BLDC motors with these specifications are recommended
    • 9..24V voltage (higher voltage increases efficiency)
    • models JGA25-2418, JGA25-2430; 24.4mm outer diameter
    • ~190..450 no-load (max) RPM, ~140..350 rated RPM
    • JST SH 1.0mm 5-pin connector on the back (PWM, CW/CCW, VMOT, GND, FG)
    • built-in BLDC driver and encoder
    • ~0.5..1.5 Kg*cm rated torque
  • Examples
    • CHR-GM25-BL2418 24V 200RPM 270PPR
    • JGA25-BL2418 24V 245RPM 630PPR
    • CHR-GM25-BL2418 24V 260RPM 204PPR
    • JGA25-BL2418 24V 408RPM 127.8PPR
    • CHR-GM25-BL2418 24V 450RPM 120PPR

Where to Purchase Motors/Components

  • Maker's Pet online store
  • AliExpress
  • Ebay
  • Amazon
  • online robotics specialty stores
    • robotshop.com
  • in India
    • robu.in, zbotic.in, robokits.co.in, robocraze.com, roboticsdna.in, probots.co.in, roboindia.com, flipkart.com, digikey.in, mouser.in, in.element14.com

Choosing a Motor

  • choose a motor with a minimum rated torque of ~0.5Kg*cm (a guess). Your motor must have enough torque
    • to accelerate the weight of your robot reasonably quickly, let's say 2lbs or so
    • to drive over thick carpet, floor mats, etc.
  • for the given rated torque, choose a motor with the highest RPM
    • the higher the motor RPM, the faster your robot can drive
  • we recommend 24V BLDC ~400 RPM motors, e.g. JGA25-BL2418 24V 408RPM 127.8PPR
    • these motors are fast, powerful and (generally) long-lasting
  • 12V BLDC ~300 RPM is the second choice
    • often 12V BLDC offer less torque at the same RPM compared to 24V BLDC motors
  • if you cannot get a BLDC motor, get yourself a brushed GA25-370 motor with encoder
    • this motor is (generally) less powerful compared to the recommended BLDC motors
    • brushed motors (generally) do not last as long as BLDC motors
  • if you cannot get a GA25-370 motor, you can use N20 motors as the last resort
    • N20 motors have considerably less torque compared to the recommended motors
    • However, some N20 motors with low RPM (e.g. <=100RPM) do offer sufficient torque

Change Log

v0.8.6-iron

v0.8.5-iron

  • stop robot once it has traveled a certain distance or yaw since the last cmd_vel was received
    • (hack) specified in cmd_vel linear.z and angular.x respectively
    • simplifies robot app control when not using a navigation map
  • refactor SPIFFS error handling

v0.8.4

  • bugfix: builds in Arduino for Ubuntu

v0.8.3

  • bugfix: Delta, Delta-2G LiDAR decoding

v0.8.1, v0.8.2

  • bugfix: sketch data filename too long causing SPIFFS upload to fail

v0.8.0

  • moved board config from web to config.yaml
  • upload config.yaml as sketch data
    • config.yaml stores board/robot config
    • network.yaml stores network-only config portion for security reasons
  • web config GUI now only configures WiFi
    • web config got too complicated, too many parameters to set manually
  • added multiple board support: assign GPIO pins in config.yaml
    • Kaia.ai-compatible boards will come with a GPIO assignment config file
    • config.yaml for Maker's Pet BDC-30P, BDC-38C4, MINI-32E, MINI-S3M boards
  • cleaned up some micro-ROS parameters
  • simplified motor PID library
    • removed ON_ERROR vs. ON_MEASUREMENT
    • added Kpm proportional-on-measurement factor
    • removed the direction setting (negate all PID factors to reverse control direction)
    • fixed PID adjustment for sample timing
  • web config launches on BOOT button long-press without reboot
  • pulled updates into the micro_ros_kaia library
  • fixed library name conflict
    • renamed motor_ctl.h to motor_ctl_kaia.h
  • updated LDS library
  • bugfix: pause motors on WiFi loss
  • Arduino ESP32 Nano builds, works
  • set GPIO slew for EMC
  • builds with Espressif 5.x, but issue with micro_ros communication

v0.7.0

  • set Maker's Pet mini as the default robot
  • added more N20 motors
  • set/get LDROBOT LD14P rotation speed
  • MAKERSPET_MINI works
  • added YDLIDAR X4-PRO (not tested)

v0.6.0

  • MAKERSPET_MINI works
    • tested with YDLIDAR SCL, LDROBOT LD14P

v0.5.0

  • motor driver
    • brushed motor support: drivers TB6612FNG, LM298N, DRV8871 and others with same IN1, IN2 control input logic
    • N20 motors supported
    • quadrature encoders
    • reverse motor direction, reverse motor encoder - for wiring convenience
  • web configuration
    • additional options including PID, motor drive type, motor encoder type
    • LiDAR scan frequency option
    • automatically loads values from previous configuration
  • ROS properties
    • motors: get max RPM, derated max RPM, target RPM, current RPM
    • motor encoders: get current value, get/set PPR (pulses per revolution), get TPR (ticks per revolution)
    • motor PID: get/set Kp, Ki, Kd, update period, PID mode on-error vs. on-measurement
    • robot base: get model name, base diameter, tire diameter, wheel base
    • LiDAR: get current scan rate, LiDAR model,
  • code refactored into separate files for readability
    • motor controller code moved into its own library
  • added support for YDLIDAR SCL
  • set micro-ROS client key using ESP32 MAC for smoother micro-ROS reconnect
  • refactored code into separate files

v0.4.1

  • added Delta-2A 230400 baud version (vs old 115200 baud)
  • added Delta-2B
  • added motor voltage to configuration
  • added Camsense X1

v0.4.0

  • moved from KaiaaiTelemetry to KaiaaiTelemetry2 message
    • added battery voltage telemetry
    • added WiFi RSSI telemetry
  • added LDROBOT LD14P laser distance scan sensor
  • included all library dependencies in library/ to make the code self-contained
    • do not use Arduino IDE Library manager
    • instead, just copy everything to your Arduino sketch folder
  • included the ESP32 sketch data upload tool in tools/

v0.3.0

  • added 3irobotix Delta-2A, Delta-2G
  • library version dependencies
  • requires Kaia.ai ROS2 image kaiaai/kaiaai-ros-dev:humble-02-11-2024 or kaiaai/kaiaai-ros-dev:iron-02-11-2024

v0.2.0

  • added LiDAR/LDS laser distance scan sensors support
    • YDLIDAR X3, X3-PRO
    • Neato XV11
    • SLAMTEC RPLIDAR A1
  • library version dependencies
  • requires Kaia.ai ROS2 image kaiaai/kaiaai-ros-dev:humble-02-05-2024 or kaiaai/kaiaai-ros-dev:iron-02-05-2024

v0.1.0

  • initial release
  • supports sensors
    • YDLIDAR X4, X2/X2L
    • LDS02RR
  • robot model configuration via web browser
  • requires libraries
  • requires Kaia.ai ROS2 image kaiaai/kaiaai-ros-dev:humble-01-28-2024 or kaiaai/kaiaai-ros-dev:iron-01-28-2024

1/21/2024

  • updated to match PID_Timed v1.1.0 library
    • PID_Timed v1.1.0 replaced constant #define with class constants to fix namespace collisions
  • added LDS library as dependency
    • refactoried and moved YDLIDAR X4 into LDS library
    • added support for Xiaomi 1st gen LDS02RR laser distance scan sensor
  • started moving #define constants into CONFIG class to clean up namespace
  • added motor choices
  • miscellaneous cleanup

12/02/2023

  • BREAKING ESP32 pinout assignment change to support the newly ESP32 breakout board
    • the new ESP32 breakout board works
    • the motor pin change fixes the "motor kick" upon ESP32 hard reboot
    • the LDS pin change fixes the LDS motor enabled by ESP32 upon hard reboot
    • MOT_FG_RIGHT has changed from GPIO27 to GPIO35_IN
    • LDS_MOT_EN has changed from GPIO12_OUT to GPIO19
    • MOT_CW_LEFT has changed from GPIO32 to GPIO23
  • requires micro_ros_kaia Arduino library version 2.0.7-any.3 minimum
  • added ROS2 parameter server
    • works successfully
  • added lds.motor_speed parameter
    • controls the laser distance sensor motor speed
    • type double; set lds.motor=0 to stop LDS motor; set lds.motor=1.0 for maximum speed
    • set lds.motor=-1.0 for LDS default motor speed
  • added minimum micro_ros_kaia library version check
    • Arduino build errors out at compile time if the library version is too old
  • renamed some #define symbols from YDLidar-specific to generic LDS

Acknowledgements

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.