For the main part of this roadtest, I wanted to look at the features of the TMC2300 that dealt with power consumption. The key one of these is coolstep but as we'll see there are a few other things to consider too.
This article looks at the registers used when controlling the motor via the UART pin. However, it is also possible to use the TMCL protocol via the Landungsbrucke board
Automatic Power saving
When the board is configured for stand-alone mode and hence controlled with step and dir, the chip will automatically reduce power when the motor is stationary. This is enabled when the PDN_UART pin is set low.
Basic current control
One of the first things you can do to control the power consumption is to disable the outputs using the EN pin. This would however cause the motor to freewheel, so is not appropriate if there is a load on the motor when it is at standstill.
The main parameter for controlling the current in the motors is IRun, This is a scaling factor that allows the current to be configured in software.
As well as IRun there is a second value which is used when the motor is stationary, IHold. If you are controlling the motor with the UART then the PDN_UART pin is disabled and the values set in the registers are used. To disable the current reduction, set IRun and IHold to have the same values.
The IHoldDelay value affects the rate that the current is reduced, you can see this in the graphs below, the first was taken with the a value of 7 and the second a value of 15. The higher values would be useful if the motor is rapidly switching from moving to stationary or if there was a high inertia load on the motor. An additional delay can be added in the form of TPowerdown which would also be advised if your motor was doing a lot of stop/start operations.
The coolstep technology is a technique for reducing the current in a stepper motor until it is needed when a load is detected. Unlike the IHold feature, this works when the motor is moving. The load is measuring by looking at the current in the sense resistors for a known supply voltage.
There's a whole page in the data sheet for selecting the right sense resistors. But in summary, the smaller the resistor, the larger the maximum current for the motors.
There are many settings for the coolstep configuration, some of these are also used for the stallguard, stall protection.
To enable the stallguard and hence coolstep, the minimum speed threshold setting TCOOLTHRS should be set to be lower than your operating speed. Also the stallguard threshold SHTHRS needs to be set to lower than the stallguard measurement SG_VALUE, otherwise the guard will enable and stop the motor.
Once stallguard is enabled then there are the coolstep configuration values to enter. These look a little intimidating at first. The settings effectively configure 2 bands and the rates of change. The upper band is defined by SEMAX+SEMIN+1. If the stall guard value is higher than this value then the motor current is reduced to a minimum of 1/2 or 1/4 of the IRun values, as defined by the SEIMIN value. The lower band is between SEMIN and SGTHRS. If the stall guard value drops into this band the current is increased to increase the torque of the motor. If the stall guard value drops below SGTHRS then the motor is stopped. The SEDN an SEUP values control the rates of change.
To test this behaviour, the coolstep configuration page was used. The first spike of motor current was the motor turning on. It then rapidly drops back down the half current. In the middle of the chart, I applied a load to the motor and the current shoots back up to maximum. Then as the stallguard value rises again the current steps back down. Finally the motor was stopped and as it decelerates below the TCoolThrs the current jumps right back up to the top and then steps back down as the motor comes to a halt.
The orange bar on the right of the graph shows the range of current. The blue bar is the coolstep settings. If the stall guard rises above that initiates the decrease in current and if it drops below it causes a rise. So the blue bar represents the SEMIN to SEMAX+SEMIN+1 range in the figure 11.1 above.
I found the settings to be quite hard to tune but it did seem to err in the favour of saving energy. Also if the IHold current is set higher than the cool step minimum you may find that the motor uses more current when stopped than when running.
But in general there are loads of energy saving features in this chip and it's use could mean that you could fit smaller batteries in a device or that it could go a longer time between charges for a rechargeable system. I have another experiment i wish to do which is to look at the current use in comparison to a simple microprocessor controlled full step H-Bridge circuit.