5.2. Motor Settings

The Motor Settings tab of the Pololu Simple Motor Control Center allows you to set up limits to protect your system and lets you specify the details of how your motor should be driven.

Motor Settings tab in the Pololu Simple Motor Control Center.

Hard Limits

The Hard Limits box allows you to set up hard limits on the motion of your motor in order to protect your system and reduce mechanical stress.

They are called Hard Limits because they are stored in non-volatile memory and they are always obeyed. However, all of them except Starting Speed can be temporarily modified using the appropriate USB or serial command. Only modifications that make the system safer are allowed. These temporary changes will only last until the next time the device resets, at which point the hard limits will be reloaded. See Section 6.2.1 for more details about setting temporary motor limits.

If you want to enter different limits for the reverse and forward directions, check the Asymmetric checkbox.

Max speed is a number between 0 and 3200 that specifies the maximum speed at which the motor controller will ever drive the motor. The default value is 3200, which corresponds to 100% and means there is no limit. A value of 0 means that the motor will not be allowed to drive in the specified direction. This setting also affects how the Target Speed is computed in RC and Analog modes: after mixing is optionally performed, a scaled value of 3200 or -3200 maps to the Max speed. The Max speed should be zero or it should be greater than the Starting speed.

Starting speed is a number between 0 and 3200 that specifies the minimum speed at which the motor controller will ever drive the motor. The default value is 0, which means there is no minimum, so this setting has no effect. This setting also affects how the Target Speed is computed in RC or Analog modes: after mixing is optionally performed, a scaled value of 1 means the Target Speed equals the Forward Starting Speed and a scaled value of -1 means the Target Speed equals the inverse (negation) of Reverse Starting Speed. The starting speed parameter allows you to save some energy by never driving the motor at speeds that are too low to actually make the motor turn. It can also make your joystick control be more accurate and responsive, because the motor can start moving as sooner as the stick leaves the neutral area.

Max. acceleration is a number between 0 and 3200 that specifies how much the magnitude (absolute value) of the motor speed is allowed to increase every speed update period. The default value is 0, which means there is no limit. An acceleration limit can help reduce mechanical stress and help reduce current spikes when the motor is starting up. If an acceleration value of 1 is too fast for your application, you can increase the Speed update period to make it slower.

Max. deceleration is a number between 0 and 3200 that specifies how much the magnitude (absolute value) of the motor speed is allowed to decrease every speed update period. The default value is 0, which means there is no limit. A deceleration limit can help reduce mechanical stress and help reduce current spikes when the motor is decelerating. Note that deceleration limits apply even when there is an error stopping the motor; depending on your setup, it might not be a good idea to use deceleration in conjunction with a limit switch because the motor will not stop as fast as possible with the limit switch is triggered. If an deceleration value of 1 is too fast for your application, you can increase the Speed update period to make it slower.

Brake duration is the time, in milliseconds, that the motor controller will spend braking the motor (Current Speed = 0) before allowing the Current Speed to change signs. The Forward Brake Duration is the braking time required before switching from forward to reverse (from positive to negative speeds). The Reverse Brake Duration is the braking time required before switching from reverse to forward (from negative to positive speeds).

The Speed update period is the time, in milliseconds, between consecutive updates to the Current Speed. The default is 1 ms, which is the lowest allowed value. By increasing the Speed update period, you can decrease the effective rate of acceleration and deceleration because the updates will be applied less often. The slowest possible acceleration/deceleration can be achieved by setting the Speed update period to 100 ms and the acceleration/deceleration limit to 1; with this configuration it will take 320 seconds to accelerate from speed 0 to speed 3200 (100 %) or decelerate from speed 3200 to speed 0.

The Invert motor direction option lets you switch the meanings of forward and reverse. By default, Forward means the average voltage on OUTA is greater than the average voltage on OUTB (and reverse means the opposite). With the Invert motor direction option enabled, Forward means the average voltage on OUTA is less than the average voltage on OUTB.

The PWM frequency setting specifies the frequency of the rapidly-switching (PWM) signal used to control the speed of the motor. Several PWM Frequency options are available between 1.12 and 21.77 kHz. The default PWM frequency is 21.77 kHz. This is an ultrasonic frequency; it is too high for humans to hear, so you won’t hear the high-pitched whine from the motor that other motor controllers can cause. Using a lower PWM frequency will reduce switching losses and slightly increase the power output to the motor because the duty cycle (the percentage of the time that the H-bridge is powering the motor) can be closer to 100%. Note that a speed of 3200 is called 100 % but it does not correspond to a duty cycle of 100 %. The correspondence between maximum duty cycle and PWM frequency is shown in the table below.

PWM Frequency Duty cycle when speed is 100%
21.77 kHz 96.8%
11.07 kHz 98.4%
7.42 kHz 98.9%
5.58 kHz 99.2%
4.47 kHz 99.3%
3.20 kHz 99.5%
2.04 kHz 99.7%
1.12 kHz 99.8%

Speed zero brake amount is a number between 0 and 32 that specifies how strongly to brake the motor when the Current Speed is set to 0. This corresponds to the percentage of time that the low-side MOSFETs will be turned on and braking the motor. The default is 32, which means full brake. This means that whenever the Current Speed gets set to zero (because of an error or any other reason) the motor will brake as fast as possible, and it will be relatively hard to turn the motor by hand while it is stopped. If you would prefer that your motor have a more gradual stop or be easier to turn while it is stopped, you can set Speed zero brake amount to 0, which is almost full coast. Another way to have gradual stops is to set a deceleration limit, which will cause the Current Speed to slowly drop to zero.