Trinamic TMCM-0960-MotionPy SBC + Stepper Motor - Review

Table of contents

RoadTest: Trinamic TMCM-0960-MotionPy SBC + Stepper Motor

Author: navadeepganeshu

Creation date:

Evaluation Type: Development Boards & Tools

Did you receive all parts the manufacturer stated would be included in the package?: True

What other parts do you consider comparable to this product?: IFX9201 and XMC1300 Motor Control Shield by Infineon, TMC2300EVAL by Trinamic, DRV8825EVM by Texas Instruments.

What were the biggest problems encountered?: I had issues in getting started with the MotionPy board and CAN interface of the PD42-1270 motor with the PC. The documentation and Python scripts over GitHub weren't sufficient as such, but by opening an issue and with the support of a Trinamic engineer, I was able to get it modified, up and running on my board.

Detailed Review:

In this RoadTest, I am reviewing Trinamic's motion control hardware with TMCM-0960-MotionPy and PD42-1270 stepper motor, exploring its features, and configuration. After my previous RoadTest on Trinmaic IoT kit, Trinamic TMC2300-IOT-REF Stepper Driver + Motor - Review I was curious about exploring the technology of motors, its features, and this Trinamic device has real-time monitoring and control. This roadtest kit looked very interesting with the brainy motor having a CAN interface and several cool control features over TMCL IDE. The Micropython support for the interface board made it furthermore interesting and with the thought of using this for exploration in motion control, load estimation application, I applied and ended up here.

 

1] What's all this?

 

The RoadTest Kit included a TMCM-0960-MotionPy board, PD42-1-1270 PANdrive™ smart stepper motor, 16GB SD card, and a hookup adapter board.

image

Some of the major highlights with this kit are that the MotionPy board is a single-board computer running MicroPython which opens up possibilities for quick prototyping and control. The board comes with multiple serial interfacing options like UART, RS485, and CAN. The SD card option helps in loading large firmware and also in logging the motor data/parameters directly from the TMCL motion control IDE for analysis and further processing. The coolest feature is with the smart stepper motor which interfaces with the MotionPy board via CAN protocol and provides tonnes of interesting control and live monitoring features which really excited me to go for this RoadTest. It's a simple example of what can be done to a normal NEMA17 stepper motor by adding a magical module in hardware and tonnes of smart processing with the software.

 

2] First Look!

 

The kit arrived well packed in a nice spongy box and all required accessories were included. The adapter board really came in handy for connecting multiple wires and powering up the motor.

 

{gallery} First Look!

image

image

image

image

 

3] Specs and Working

Generally seen, stepper motor tends to have Low efficiency, Substantial decline of torque with speed, Low positioning accuracy and they are noisy. Trinamic's PD42-1-1270 stepper motor overcomes some of these major issues by using intelligent motion control technologies. PANdrive™ smart motor, Integrated SixPoint™ ramp motion controller, StealthChop™ silent PWM mode, SpreadCycle™ smart mixed decay, StallGuard2™ load detection, and CoolStep™ automated current scaling.

 

In an overview, the motion control signal chain with this Trinamic kit looks so:

Local PC with TMCL-IDE <-> USB interface <-> MotionPy running microython <-> CAN interface <-> TMCM-1270 module >> 4 wire for motor coils >> Stepper motor  (all bidirectional except the motor)

imageimage

 

 

4] Getting Started

This is where I was stuck for sometime figuring out the examples and interfacing for the stepper motor bringup. The documentation is good but wasn't specific about interfacing motor with TMCM-0960-MotionPy board. Okay, I don't expect that while having too many modules and motors with not many users at starting point. While I raised an issue over the GitHub page, Trinamic engineer quickly responded and was able to help me throughout in getting started! Several examples are provided for interfacing over CAN, RS485 in the PyTrinamicMicro repository.

 

What I thought: MotionPy board is a controller for the stepper motor and by interfacing with the PC, we can run MicroPython scripts for smart control.

What I realized: MotionPy board is a common interface device bridging various motor controllers with the PC over a variety of serial interfaces like CAN, RS232, RS485, UART etc or acting as a TMCL master/slave by running a set of python scripts. The PD42-1270 motor itself has a controller and processor which can be interfaced with TMCL-IDE via a USB to CAN adaptor.

What I used MotionPy for: To run some blinky LED scripts using MicroPython and as a USB to CAN bridge interface from my PC to the stepper motor.

 

The MotionPy board came with MicroPython pre-loaded and could directly be used by scripting on main.py to toggle GPIOs and control with pushbuttons. It uses an STM32F405 microcontroller onboard, having SD card, USB and serial interfaces. The set of default files included a pybcdc.inf windows device driver file.

image

image If these default files get corrupted or don't show up somehow, press SWDIO and NRST buttons together, leave NRST immediately but hold NRST for the next 5 seconds and then release it upon which the red LED flashes multiple times and newly loads the default files to the PYBFLASH.

 

Got an opportunity now. I ran a blinky script and there it goes!

Trinamic MotionPy Blinky

 

# main.py -- put your code here! #

#define all LEDs onbaord MotionPy and turn them off!
pyb.LED(1).on()
pyb.LED(2).on()
pyb.LED(3).on()
pyb.LED(4).on()

pyb.delay(1000)

led1 = pyb.LED(1)   #call and toggle LED1

while True:
    led1.toggle()

    pyb.delay(1000)

image

And some math over here in the python command line by accessing the serial port of MotionPy via PuTTY!

 

The default microcontroller's PYBFLASH storage was 96KB and that wasn't sufficient to import any libraries nor run a fairly big code. Thanks that the PyBoard comes with an SD card interface and upon plugging it, the PYBFLASH is recognized as the SD card attached. Now, there is a PyTrinamicMicro repository containing examples, test codes, and generally a lot of python scripts for interfacing several Trinamic devices and utilities using micropython platform. Cloning/loading this repository into the PYBFLASH makes it easy to get the peripheral devices interfaced with the MotionPy board. But it's more than a copy-paste.

 

>> Download the full PyTrinamicMicro repository to a local directory(say C:\ )

>> Open the available command prompt/terminal and navigate to the downloaded repository(C:\ cd PyTrinamicMicro)

>> Invoke the install.py script in PyTrinamicMicro and direct it to install in PYBFLASH root(C:\ PyTrinamicMicro > python install.py H:\ -c)

>> Now copy boot.py from H:\ PytrinamicMicro > platforms > micropython to the root of H:\

>> Open the respective COM port to which MotionPy board is attached via a serial terminal like PuTTY and it'll show up the PYBv version and host microcontroller giving access to run micropython scripts.

>> Find example scripts at

 

 

{gallery} PyTrinamicMicro Installation Steps

image

image

image

image

image

 

Yikes, now it's time to have the beast on stage. Introducing PD42-1-1270 smart stepper motor. The front part of it is a generic NEMA17 stepper motor and the TMCM-1270 addon module is what makes it smart! The 4 wires A1/A2/B1/B2 comes from the motor coils and is plugged into the TMCM-1270 module. It houses a powerful TMC5130A motor driver with all fancy motion control features interfaced via SPI bus to NXP's ARM® Cortex®-M0+ Kinetis KE06 MKE06Z128V microcontroller having CAN interface. Why this NXP MCU here? Aww,.. I dont know.


imageimage

image

 

5] Setting Up

image

The 100ohm resistors with the onboard LEDs made them too bright to bear with and were blinding me out,......haha. Replaced those with 1.2K.

 

In this setup, I will use the TMCM-0960-MotionPy board as a TMCL bridge for linking the PD42-1270 motor with my PC. The MotionPy board has a TJA1051 CAN transceiver which connects to the two-wire CAN interface in the STM32 microcontroller. The other side, on the motor, the NXP MKE06Z128V microcontroller hosts the CAN port.

image

Setting this up and invoking the tmcl_bridge/tmcl_bridge_usb_can.py script should get the MotionPy board's CAN interface bridged to PC via USB and the TMCL-IDE should be able to recognize both the hardware interfaced via respective serial COM port. In the same serial terminal which starts the Python command line, invoke this script:

exec(open("PyTrinamicMicro/platforms/motionpy1/examples/tmcl_bridge/tmcl_bridge_usb_can.py").read())

 

Now, the board should be running as a TMCL bridge and after closing the same serial terminal, the TMCL-IDE should detect two devices with their IDs.

 

{gallery} Connecting with TMCL Bridge

image

image

image

image

image

 

This is it! Now via the IDE, the PD42-1270 motor can fully be equipped with its nice live motor control features.

image

6] Testing

The stepper motor can be driven in multiple ways over TMCL-IDE. This IDE has a lot of features to (re)configure the motor and work upon optimizing its function.

 

Using Direct Mode: There is a direct mode operation where rotation parameters and values (ROR - rotate right, MST - motor stop, etc) can be defined and executed in a single go. The other one is TMCL creator window where commands can be typed and executed like generic programming wherein the project files are saved in .tmc format.

image

 

Using the TMCL IDE GUI: The IDE comes with a GUI with nice knobs for controlling the velocity and acceleration of the motor. It really gives a superpower feel to look upon the motor cranking up as the knob is turned(relatable to accelerating in a motorbike)

In this video, I am testing the motor bring up and controlling it via knobs in the velocity mode GUI.

 

 

Testing the StealthChop feature: StealthChop is a voltage-regulated chopper feature that completely silences the stepper motor by eliminating the noise caused by unsynchronized motor coil chopper operation, PWM jitter, etc. It modulates the current on the PWM duty cycle which minimizes current due to the constant PWM frequency.

To test this, I am measuring the voltage across both the coils of the stepper motor by probing the oscilloscope to A1/A2/B1/B2 coil wires which go out to the motor from the driver IC. Measuring voltage may not be a very staple way of analysis when the current is what acts in and magnetizes the coil, but it does the job as the voltage is a function of coil current here(actual reason is that I don't have current probes for my scope :/)

In this video, I am testing the StealthChop features by using various chopper settings in TMCL IDE.

 

 

The motor which was vibrating over my table became so calm and cool as if was meditating upon enabling the StealthChop and High Speed Chopper, High Speed Fullstep modes. I really liked that feature and this would be very suitable for Robotic, Indoor Motion Control, 3D Printer applications.

 

7] Summary

Though the getting started phase of my RoadTesting took some more time, it was a very insightful one. The SteathChop motor silencing was quite interesting and it was totally unexpected for me to see such a smooth waveform and silent operation of the stepper motor before to which I am used to buzzy, vibrating, and heat bleeding steppers. The price of TMC5130A is competitive with other products out in the market. In my future projects, I will think of possibilities to integrate this driver IC as a replacement.

It was long, a lot of fun, some debugging, surpriseful RoadTest. Thanks to Element14 for giving me this opportunity and engineers at Trinamic for their support. Thanks for reading through, do share your thoughts or suggestions about this RoadTest, and probably let's discuss about cool project ideas with this.

 

Cheers!!!

 

Links and References

Explore Stepper Motors: https://realpars.com/stepper-motor/

Trinamic MotionPy Kit: https://www.trinamic.com/products/modules/details/tmcm-0960-motionpy/

PD42-1270 Motor: https://www.trinamic.com/products/drives/details/pd42-x-1270/
TMCM-1270 Module: https://www.trinamic.com/products/modules/details/tmcm-1270/
PyTrinamic GitHub Repo: https://github.com/trinamic/PyTrinamicMicro

The Basics of Stepper Motor: https://www.digikey.lt/en/blog/the-basics-of-stepper-motors

PD42-1270 Firmware Manual: https://www.trinamic.com/fileadmin/assets/Products/Drives_Documents/PD-1270-TMCL_firmware_manual_fw1.15_rev1.04.pdf

Anonymous
Parents Comment Children