### Overview

Advanced signal waveforms are predominantly used in haptic feedback, but in fact, the effects of simple vibration alerting can be greatly improved with relative ease. With vibration alerting the output waveform need not be restricted to just a continuous vibration, and below we’ve covered three simple techniques that can be used to extend the capability of a vibration alerting system, without implementing fully a haptic feedback solution.

These techniques can be implemented independently or combined.

We’ve shown the expected output from the motor with example applications to aid understanding. If you have any questions about the bulletin, you can always contact our engineers for more advice.

### Vibration Pulse Duration Modulation

Duration modulation is where the length of the vibration pulse is changed throughout the alert. For example, it could be a long burst of vibration followed by a short one.

The waveform below is an example of the vibrating motor’s output; In order to modulate the duration to convey additional information as part of the alert, we must alter how long the motor is switched on for:

Vibration Pulse Duration Modulation

The edges are slanted because the eccentric rotating mass of the vibration motor has a relatively large inertia. This means it takes a little time to reach its maximum speed. Similarly, the motor does not stop immediately once the voltage has been cut off due to the momentum of the eccentric mass. The actual gradient of the slope (time taken to reach max or stop) will be dependant on the motor and the voltage applied to it; for ease, we have used a generic waveform.

As most vibration alerting devices are based around a microcontroller, implementing pulse duration modulation should be fairly easy to achieve. The vibration duration is already likely to be set by a simple ‘for’ or ‘while’ loop in the controller’s code, increasing or decreasing the duration should be achievable with a bit of adjustment. Defining the length of the ‘on’ pulse as a variable is the best approach. Then it can be easily changed within loops or stored as specific values.

Also consider changing the length between pulses, or the ‘off’ pulse period. The silent period between pulses can also be used to help create an irregular vibration pattern and increase the vibration alerting performance. Again, using variables in the code allows you to easily edit the pulse length and manage different values for ‘off’ pulses and ‘on’ pulses. It is even possible to create random pulse lengths so no two alerts are the same!

### Vibration Pulse Occurrence Modulation

This is slightly different from the above, and here we are looking to alter the number of pulses. We have not termed it Vibration Pulse Frequency Modulation to avoid confusion with the frequency of vibration itself, which is related to the vibration motor’s speed (which of course might also be controlled / varied / modulated).

For example, Pulse Occurrence Modulation is used in car parking assistance sensors. As the driver reverses the car, sensors on the rear bumper scan for objects and produce a beeping audio alert. As the car approaches an object, e.g. a wall or another car, the beeps become more frequent until the object is very close where a continuous tone is played.

With vibration alerting becoming more common in cars and steering wheels, this annoying audio tone can be replaced. Similar examples include metal detectors which previously required the operator to wear headphones to hear a similar beep or remotely driven robots where the operator can be alerted to distances or other information through the user interface.

Vibration Pulse Occurrence Modulation

### Overdrive

As mentioned previously, any vibration motor, by virtue that it has to move a mass to generate vibration, has a moving mass and therefore inertia. Therefore when they are switched on with their rated voltage there is a short period where the motor accelerates to its maximum speed. Similarly, it does not stop immediately when switched off. Our datasheets provide Typical Haptic Characteristics which define typical lag, rise, stop, and active break times.

The time taken for the motor to reach its maximum speed (Typical Rise Time) can be reduced using a technique called overdrive. This is where the motor is applied with a voltage higher than its maximum rated voltage for a short burst, causing the motor to accelerate quicker. This can only be done for a short time before reducing the drive voltage to the normal rated voltage or desired operating voltage (whichever is less).

Overdrive can be achieved in a number of ways, depending on how the motor is driven. The most likely would be with a PWM signal, but it is also possible to use two GPIO pins on the processor to achieve the same effect.

#### Simple GPIO Pins

If the motor is being driven through a MOSFET or other transistor, a second transistor is used to short a voltage reducing element that in normal running is left in series with the motor. See the example circuit below:

Overdrive Example Circuit with By-Pass MOSFET

A power source of 3.6 V is set above the motor’s rated voltage, e.g. the 312-107 rated at 3 V, and the diode has a constant voltage drop of 0.6 V, thereby reducing the voltage across the motor to a suitable value when the motor state signal is set to turn the upper MOSFET on. A second MOSFET is placed in parallel with the diode which can act as a shunt/bypass, thereby increasing the voltage applied to the motor. Now variables in the program which control the signal ‘motorstate’ and ‘overdrive’, can control the vibration motor and the bypass MOSFET respectively. This method uses two GPIO pins on the microcontroller.

#### PWM

Alternatively, if the motor is controlled by a Pulse Width Modulated signal the duty cycle can be used to implement overdrive. For more help on understanding PWM signals, see our previous Application Bulletin 012: Driving Vibration Motors with Pulse Width Modulation (PWM).

If the motor’s supply voltage is set to the desired overdrive voltage, then a duty cycle of 100% would overdrive the motor. This can then be reduced in normal operation to a duty cycle which drives the motor at the rated or desired voltage.

For example, we can use a simple circuit of a vibration motor, e.g. the 320-100, which is a 3v motor, connected to a 3.6 V power rail and controlled by a MOSFET, which in turn is driven by a PWM signal from the microcontroller.

The 320-100 is also rated at 3 V and can be ‘overdriven’ with a duty cycle of 100%. The microcontroller program can then reduce the duty cycle to around 83% to drive the vibration motor at its rated voltage:

$$Duty : Cycle = frac{Rated : Voltage}{Supply : Voltage} times 100$$

$$Duty : Cycle = frac{3V}{3.6V} times 100$$

$$Duty : Cycle = 83.33$$

### Example Code Using All Three Methods

Throughout this Application Bulletin, we have made assurances that implementing these techniques would be very easy on a microcontroller. Below we have included pseudo-code (example code which does not follow a specific language’s syntax, instead used to demonstrate structure) to show you how the techniques can be achieved.

To aid understanding, we have chosen to simulate a once very common application. When mobile phones became popular the alert tone for text messages sounded SMS in Morse code, three-dits / two-dahs / three dits. Dits are short pulses while dahs are longer. Once vibrate functions were introduced many mobile phone manufacturers simulated this with the vibration motor.

Here we can demonstrate all three waveform modulators:

• Vibration Pulse Duration Modulation – The difference between ‘dits’ (short pulses) and ‘dahs’ (long pulses).
• Vibration Pulse Occurrence Modulation –  The S is three pulses, while the M is only two. Without this change, there would also be three dashes (changing the M to an O and creating the SOS distress signal).
• Overdrive – Not actually required for producing an SMS signal, but we have included the feature in the code. Note for ease of understanding we are using the ‘2 GPIO Pins’ method, not PWM.

Here is the pseudo-code for creating a function called ‘vibrate’, which would be part of the microcontroller’s code.

Overdrive Pseudocode

It relies on a couple of other functions:

• motorstate() – a function which would be defined in a similar way, required to write a suitable value to the output pin’s port register to control the line connected to the motor’s MOSFET.
• overdrive() – similar to motorstate() function, instead writes to the pin connected to the overdrive MOSFET.
• sleep() – a fairly common function in C used to wait for a period of time before moving to the next line of the code. Different compilers and languages will have variations on this. If using an embedded real-time operating system, you would use delay routines and could do something useful with the processor like running other code in the background.

Also note that the ‘M’ has been created by decreasing the loop (pulsecount – 1), which is a bit crude and can be difficult to spot without proper commenting, however it works for the purpose of this demonstration.

Here is what you would expect from vibration motor which has been driven using the functions above:

Vibration Pulse and Duration Modulation with Overdrive

The program can be altered to use different combinations of the three modulators, and even change the output depending on a variety of inputs. This can be very easily achieved, even if you have no programming experience in-house there are many freelance engineers would be able to meet your needs for a small development cost.

### Conclusion

There are several methods for changing a vibration alerting signal, we have discussed three of them

• Vibration Pulse Duration Modulation
• Vibration Pulse Occurrence Modulation
• Overdrive

The above techniques can all have a positive impact on the performance of a device that features vibration alerting. It should be considered what type of waveform is most effective in transmitting information to the user for the application, and if it is achievable with the current system design. For example, if the chosen microcontroller supports interrupts, then the vibration alert can be activated indefinitely until an input is registered or a specific action is taken. This may be beneficial for important safety equipment that requires an acknowledgement before proceeding.

These can all be easily implemented with simple coding in the microcontroller, or with the aid of external circuitry such as motor drive ICs. You can find more information about motor driver circuits on our application bulletins page.