Skip to the content
PCBKitNew board
2 layers10.6 × 18.5 mmAsmartcap xMoto, the printed circuit board in 3D

Asmartcap xMoto

xpix/XMOTO_TINYAVR6

This code is designed for a motor controller and has merged the PID code of Josh Kopel with the code of the Makerbot servo-controller board. This code can be used on some boards by changing some values.

Size
10.6 × 18.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
21
Nets
27
Pads
79
Tracks, vias
185, 37
Pours
1
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
25 Jul 2022
Updated
9 Feb 2025

Overview

Asmartcap xMoto is an open-source printed circuit board by xpix, from the xpix/XMOTO_TINYAVR repository on GitHub. It is a 2-layer board of 10.6 × 18.5 mm with 21 parts on 27 nets, routed with 185 tracks and 37 vias.

It is built around the ATTINY1606-MN, CC6102ST and INA2143U, with the MD9927, LP2985-33DBV and TX 1 among its other parts. Its parts include 6 ICs, 5 resistors, 3 capacitors, 3 connectors and 1 diode. It belongs with the robots and motor control boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

6

README

README.md

Documentation for Motor Controller with PID Control to use a DC motor as stepper/servo

This code is designed for a motor controller and has merged the PID code of Josh Kopel with the code of the Makerbot servo-controller board. This code can be used on some boards by changing some values.

Hardware Requirements

  • motor controller as H-Bridge
  • Hall Sensor PCB
  • Ramps 1.4 stepper driver

Software Requirements

  • PID_v2.h library
  • EEPROM.h library

Code Explanation

Motor Driver Type

The type of motor driver is defined using the PWMCONTROL variable. If PWMCONTROL is set to 1, it means that the motor driver has only a PWM interface. In this case, the minimum and maximum values for PWM to turn the motor are defined using PWMMIN and PWMMAX.

Pin Definitions

The pins used in the code are defined as follows:

  • encoder0PinA and encoder0PinB: Pins for the Hall Sensor PCB
  • MotorIN1 and MotorIN2: Pins for the motor driver (if PWMCONTROL is set to 1)
  • MotorDIR and MotorPWM: Pins for the motor driver (if PWMCONTROL is set to 0)
  • STEP_PIN and DIR_PIN: Pins for the Ramps 1.4 stepper driver
  • EnableLED: Pin for the LED that signals if the MCU is running

PID Values

The default PID values are defined using the MyObject struct. The kp, ki, and kd values are set to 7.00, 0.04, and 0.20 respectively. These values can be changed by the user.

Setup Function

In the setup() function, the following tasks are performed:

  • Serial communication is started at a baud rate of 9600.
  • The saved PID values are retrieved from the EEPROM. If no values are saved, the default values are used.
  • The pins are set to their respective modes.
  • Interrupts are attached to the encoder0PinA and STEP_PIN pins.
  • The PID is set to automatic mode with a sample time of 2 and an output limit of -255 to 255.

Loop Function

In the loop() function, the following tasks are performed:

  • The set

Parts

21
QtyValueFootprintReferences
310kResistor_SMD:R_0402_1005MetricR1, R2, R4
210uCapacitor_SMD:C_0402_1005MetricC1, C2
2CC6102Package_TO_SOT_SMD:TSOT-23U2, U3
1100nCapacitor_SMD:C_0402_1005MetricC3
1300rResistor_SMD:R_0402_1005MetricR3
1ATtiny1606-MPackage_DFN_QFN:VQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mmU5
1Conn_01x04Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_HorizontalJ1
1INA214Package_TO_SOT_SMD:SOT-363_SC-70-6U6
1LED_SmallLED_SMD:LED_0402_1005MetricD1
1LP2985-3.3Package_TO_SOT_SMD:SOT-23-5U1
1M+TestPoint:TestPoint_Plated_Hole_D3.0mmJ2
1M-TestPoint:TestPoint_Plated_Hole_D3.0mmJ3
1MD9927Package_DFN_QFN:DFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mmU4
1NRT1TestPoint:TestPoint_Pad_D1.5mmTP1
1RX1TestPoint:TestPoint_Pad_D1.5mmTP2
1TX1TestPoint:TestPoint_Pad_D1.5mmTP3
1shuntResistor_SMD:R_0402_1005MetricR5

Questions

How big is the Asmartcap xMoto PCB?

It measures 10.6 × 18.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Asmartcap xMoto use?

21 parts, built around the ATTINY1606-MN, CC6102ST, INA2143U and MD9927. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Asmartcap xMoto KiCad files?

From the xpix/XMOTO_TINYAVR repository on GitHub, at the commit this page was made from: the board is Hardware/asmartcap_xMoto.kicad_pcb and its schematic Hardware/asmartcap_xMoto.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Asmartcap xMoto design in my own project?

Its repository states no licence, so its author keeps all rights: ask xpix before reusing the design.

Similar boards

  • 2 layers11.8 × 9.4 mmEncoder-8mm, the printed circuit board in 3D

    Encoder-8mm

    neilpstevenson/monty-mouse-mini

    Source code for micromouse Monty Mini

    7 partsMIT
  • 4 layers73.9 × 84.5 mmAei, the printed circuit board in 3D

    Aei

    Severson-Group/AMDC-Hardware

    Circuit board designs for controlling advanced motor systems

    54 parts51
  • 6 layers70 × 70 mmRp2350-decoder, the printed circuit board in 3D

    Rp2350-decoder

    mikesmitty/rp24-dcc-decoder

    DIY DCC decoder for model railroad locomotives in an E24 form factor, powered by an RP2350 (Raspberry Pi Pico 2)

    543 parts12
  • 4 layers57 × 56.2 mmRp2040-decoder, the printed circuit board in 3D

    Rp2040-decoder

    mikesmitty/electronics-projects

    599 parts1
  • 4 layers77.5 × 42.5 mmCapper Decapper, the printed circuit board in 3D

    Capper Decapper

    robertpuccinelli/pcb_czb

    Random PCB designs from mini projects at czb

    86 parts
  • 4 layers44.5 × 28 mmOpenPnPVis, the printed circuit board in 3D

    OpenPnPVis

    angusgbishop/PnPCAM

    An Open Source Vision Camera designed for pick-and-place machines.

    70 parts7GPL-3.0
  • 2 layers12.7 × 22.1 mmController pcb, the printed circuit board in 3D

    Controller pcb

    mvirkkunen/encodering

    encodering (unfinished - the firmware for one has never even been run) ======================================================================

    19 parts1