µMotor (or micro-motor) is a motor controller PCB and software made to control any BLDC and DC motor up to 250W.
The micro-motor is supplied with power and CAN bus via a single connector and can control the motor independently. In addition, a limit switch can be read out and the temperature of the motor can be monitored.
Communication is done via Can-Bus using CANopen protocol.
The software is written using the modm.io framework and librobots2.
For more information read the following blog posts about the project (in German):
- µMotor: Idee
- µMotor: Inbetriebnahme und Debugging
- µMotor 2 - Teil 1: Konzept
- µMotor 2 - Teil 2: Strommessung
- µMotor 2 - Teil 3: Microcontroller & Stromversorgung
- µMotor 2 - Teil 4: Strom- und Spannungsmessung mit ADC
- 3 phases (BLDC and DC motors)
- Approx. 10A per phase (with precise current measurement)
- 24V nominal operating voltage
- Adjustable cycle-by-cycle current limiting (short circuit protection)
- CAN bus
- CAN-FD supported
- CANopen protocoll (partial implemented)
- AB(I) incremental encoder connector
- Hall sensor connector
- Temperature sensor (NTC) connector
- Limit switch (GPIO) connector
- LEDs for status and diagnosis
- Configurable ID (from STM32 hardware ID)
- Easy to solder and assemble
PCBs micro-motor-v1 (rev1) and macro-motor are not supported anymore.
The second version micro-motor-v2 is basically functional, software improvements are in progress.
PCB micro-motor-v2.1 is similar to v2, but with added RC filters at encoder connector, added 1 µF capacitor to the STM32 VREFBUF output and changed DC/DC converter modules (caused by component shortage).
Software at HEAD is compatible with micro-motor-v2.[0,1,2], however the correct version needs to be selected in the project.xml to account for hardware differences with "Board.v2_1" being compatible with v2.0, and v2.1 and "Board.v2_2" being compatible with v2.2.
- KiCad files of the PCBs
- Pinout configuration of the STM32 microcontrollers done with STs CubeMX software
- Test software. Useful during PCB assembly
- Main Software
- Common files used between main software and tests.
When first assembled the boards will be stuck inside the STM32 bootloader because BOOT0 is used as a GPIO pin.
This behaviour can be overwritten by setting an option byte:
First read flash option byte:
openocd -f interface/stlink.cfg -c "transport select hla_swd" -f target/stm32g4x.cfg -c "reset_config none" -c "init" -c "stm32g4x option_read 0 0x20" -c "shutdown"
Should respond 'Option Register: <0x40022020> = 0xffeff8aa' on a new PCB
or 'Option Register: <0x40022020> = 0xfbeff8aa' once the nSWBOOT0 bit is cleared.
Clear the bit:
openocd -f interface/stlink.cfg -c "transport select hla_swd" -f target/stm32g4x.cfg -c "reset_config none" -c "init" -c "stm32g4x option_write 0 0x20 0x00000000 0x04000000" -c "shutdown"
Software is licensed under GPLv3. Hardware (PCB files, ...) is licensed under CERN OHL v.1.2.