

Asmartcap xMoto
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
6ATTINY1606-MN
QFN-20-EP(3x3)-40℃~+105℃ 1.8V~5.5V 10bit 16KB 18 1KB 20MHz 256Byte 8 Bit AVR Built-in FLASH QFN-20-EP(3x3) Microcontrollers (MCU/MPU/SOC) ROHSMicrochip TechnologyMicrocontrollers (MCU/MPU/SOC)CC6102ST
TSOT-23-3-40℃~+125℃ 2.5V~28V 2mA ±4mT TSOT-23-3 Hall Switches ROHSCross chipLinear Hall SensorsINA2143U
SOIC-14-18V~18V -40℃~+85℃ 100uV 1MHz 1uV/℃ 2 25mA 36V 36V 45nV/√Hz@10Hz 5V/us 86dB 950uA 9us Capacitive load driving、Integrated precision resistor network SOIC-14 Differential Amplifiers ROHSTexas InstrumentsDifferential AmplifiersMD9927
WDFN-8-EP(2x2)-40℃~+85℃ 1 1.8A 1.8A 1.8V~7V 120nA 500mΩ Yes WDFN-8-EP(2x2) Brushed DC Motor Drivers ROHSShanghai Mingda MicroelectronicsBrushed DC Motor DriversLP2985-33DBV
SOT-23-5-40℃~+125℃@(Tj) 1 150mA 16V 3.3V 30uVrms 45dB@(1kHz) 575mV@(150mA) 850uA Fixed Over Current Protection、Short Circuit Protection、Thermal shutdown、Enable control、Noise bypass terminal Positive SOT-23-5 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSTexas InstrumentsVoltage Regulators - Linear, Low Drop Out (LDO) RegulatorsTX 1
-- Microscope AccessoriesKaisiUncategorised
README
README.mdDocumentation 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:
encoder0PinAandencoder0PinB: Pins for the Hall Sensor PCBMotorIN1andMotorIN2: Pins for the motor driver (ifPWMCONTROLis set to1)MotorDIRandMotorPWM: Pins for the motor driver (ifPWMCONTROLis set to0)STEP_PINandDIR_PIN: Pins for the Ramps 1.4 stepper driverEnableLED: 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
encoder0PinAandSTEP_PINpins. - 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| Qty | Value | Footprint | References |
|---|---|---|---|
| 3 | 10k | Resistor_SMD:R_0402_1005Metric | R1, R2, R4 |
| 2 | 10u | Capacitor_SMD:C_0402_1005Metric | C1, C2 |
| 2 | CC6102 | Package_TO_SOT_SMD:TSOT-23 | U2, U3 |
| 1 | 100n | Capacitor_SMD:C_0402_1005Metric | C3 |
| 1 | 300r | Resistor_SMD:R_0402_1005Metric | R3 |
| 1 | ATtiny1606-M | Package_DFN_QFN:VQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm | U5 |
| 1 | Conn_01x04 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Horizontal | J1 |
| 1 | INA214 | Package_TO_SOT_SMD:SOT-363_SC-70-6 | U6 |
| 1 | LED_Small | LED_SMD:LED_0402_1005Metric | D1 |
| 1 | LP2985-3.3 | Package_TO_SOT_SMD:SOT-23-5 | U1 |
| 1 | M+ | TestPoint:TestPoint_Plated_Hole_D3.0mm | J2 |
| 1 | M- | TestPoint:TestPoint_Plated_Hole_D3.0mm | J3 |
| 1 | MD9927 | Package_DFN_QFN:DFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mm | U4 |
| 1 | NRT1 | TestPoint:TestPoint_Pad_D1.5mm | TP1 |
| 1 | RX1 | TestPoint:TestPoint_Pad_D1.5mm | TP2 |
| 1 | TX1 | TestPoint:TestPoint_Pad_D1.5mm | TP3 |
| 1 | shunt | Resistor_SMD:R_0402_1005Metric | R5 |
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 mm

- 4 layers73.9 × 84.5 mm

Aei
Severson-Group/AMDC-Hardware
Circuit board designs for controlling advanced motor systems
54 parts51 - 6 layers70 × 70 mm

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 mm

- 4 layers77.5 × 42.5 mm

- 4 layers44.5 × 28 mm

OpenPnPVis
angusgbishop/PnPCAM
An Open Source Vision Camera designed for pick-and-place machines.
70 parts7GPL-3.0 - 2 layers12.7 × 22.1 mm

Controller pcb
mvirkkunen/encodering
encodering (unfinished - the firmware for one has never even been run) ======================================================================
19 parts1 - 2 layers100 × 100 mm
