How to Sense Force with the BOS1901 Piezo Haptic Driver IC

Piezoelectric actuators convert force applied on them to voltage, and voltage applied on their terminals to displacement. This behavior can be used to sense pressure applied by a user to a device, but also to provide haptic feedback. BOS1901 actuator driver supports both these capabilities in a single product.

This document explains how to use BOS1901 to sense when the user applies enough force on a piezoelectric actuator in order to then trigger a haptic feedback response using the same chip. A typical click button application sequence is given.

1. System Overview

Since BOS1901 features both sensing and feedback driving, only one circuit is required to fully control the piezoelectric actuator. A typical solution will thus require three components: the piezoelectric actuator, the driver, and the microcontroller (MCU) or application processor.

Figure 1 System components using piezoelectric actuator

1.1 Piezoelectric Actuator

The actuator converts voltage to displacement, and displacement to voltage. Through its integration in a device, it can sense on much pressure the user is exerting on the device surface, and it can produce vibrations of various kind to be felt by the user. It is the component that will be in direct interaction with the human user.

When compressed, it converts internal stress to charges and voltage. This voltage can be measured and processed to determine how the user is interacting with the device, whether is it pushing a button, a screen or any other surface, or releasing it.

When a high voltage is applied on its terminals, it tends to deform. Through use of proper voltage waveforms, some effects and vibration can be played to give the user the impression of clicking a button or feeling a texture for example.

1.2 BOS1901 Driver IC

Electrical circuits must be used to measure the voltage on the actuator terminals and to generate the high voltage required to deform it and create a force.

BOS1901 was designed to drive piezoelectric actuators in haptics application, where the signal frequency content is typically below 300 Hz. It was designed to optimize power and be small enough to be integrated into battery-operated mobile devices. It features both sensing and feedback capabilities thereby reducing significantly the bill-of-material.

When sensing, it can read the voltage generated across the actuator and send it to the MCU via the SPI interface. When playing a feedback to be felt by the user, it drives the high voltage required for the actuator to vibrate. Any waveform shape, amplitude and frequency may be played to the BOS1901. Data points are sent via the SPI interface to the internal FIFO to be used at the predefined sampling rate.

The SPI interface operates in full-duplex, allowing to write operations and read information at the same time.

1.3 MCU or Application Processor

Although BOS1901 provides voltage measurement and driving capabilities it does not embed detection algorithms. These algorithms reside in the MCU or application processor connected to the BOS1901 by the SPI interface.

This allows any application to use the appropriate complexity for the sensing algorithm, and to change the feedback waveforms given the context and interaction with the user.

The MCU determines the operation mode of the BOS1901, handles its register configuration and initialization, processes the voltage readings to realize the appropriate sensing algorithm, and generates the waveforms to be played to it. All application-specific code is running on the MCU. BOS1901 is acting mostly as a driver and sensor circuit.

2. Sensing Detection Methodologies

MCU is host to the detection algorithm. Therefore, the system integrator will be responsible for developing and integrating the appropriate detection algorithm and setting the right parameters for the application and the selected piezoelectric actuator.

This section describes simple detection methods that may be used with BOS1901 and most piezoelectric actuators. Although very simple, the threshold method will be enough in many applications. Many of the following methods can be combined. Others can be developed.

2.1 Threshold Method

Applying pressure increases the voltage on the piezo actuator terminals. When the voltage reaches a certain threshold (Vth, see figure below), it indicates the user has reach a certain amount of force or pressure on the actuator. Once this threshold is reached, some feedback is recommended to acknowledge to the user the input was registered. The feedback may change depending on the context.

The detection could occur when crossing the threshold upward or downward. A different action might be used in each case. A delay may also be used to prevent detection of false event due to noise from the system or from bumps on the device frame.

Figure 2 Threshold detection

2.2 Double Threshold Method

This method is a combination of the above method using two thresholds. Depending on the amount of pressure the user applies, the first or both thresholds might be reached, and a different action may be taken depending on the level reached.

To ensure proper detection, delays should be used. The delay associated with the lower threshold should be longer than the one with the higher threshold.

Figure 3 Double threshold detection

2.3 Slope Method

In some cases, it might be more convenient to detect a rate of voltage change rather than only its level. For example, when trying to detect quickly repetitive press events a slope detection will be able to distinguish the events independently of the average pressure applied. In such an application, the repeated presses might be too quick and not reach a single voltage level every time. It also allows to detect pressure applied quickly and for a short amount of time, even though it is low in amplitude.

Calculating a moving average window across the measured voltage signal allows to get good resolution on the voltage change and increase the effective number of bits per value even though the BOS1901 returns voltage measurements as 10-bit representation.

Figure 4 Slope detection

2.4 Combination of Both

More complex detection algorithms can be built from the above methods. This allows for more complex behaviors to be detected, and to increase detection robustness.

For example, slope detection might be enabled only above a certain threshold to avoid false positives as low pressures.

Another example is depicted in the following figure. The press event can be registered at lower amplitude if the detected slope is high enough. Past a given voltage threshold the press is registered regardless of the slope detected to avoid the user applying too much pressure on the device and ease detection.

Figure 5 Combining threshold and slope detections

3. Actuator Voltage Sensing

This section describes how to perform the basic operations of sensing using the BOS1901. It gets more technical on the instructions to send over SPI. Please consult the BOS1901 datasheet available on Boréas Technologies website for more details.

3.1 Reading a Register

Sensing with the BOS1901 requires reading some register content. This is done in three steps:

1. Setting the register to broadcast

2. Writing a work on the SPI interface

3. Reading the register content on the SPI interface.

The SDO pin will output data to SPI at the same time a word is written on the SDI pin. To set which register will be broadcast, the BC parameter in the CONFIG register must be set to the value of this register. For example, to read the VFEEDBACK parameter, BC must be set to 0xD, the address of the SENSE register.

Once BOS1901 has been configured to broadcast the desired register, this register is read by writing any word on the SPI interface and reading SDO at the same time. Be careful to write a word that will not change the configuration or state of the IC unless intended.

It is possible to set the next register to be read while reading the currently set register broadcast. For example, the following sequence is possible:

1. Set BC = 0x1 address. This sets register 0x1 to be read.

2. Write CONFIG with BC = 0x2 address and read SDO at the same time. This reads register 0x1 while setting subsequent broadcasts to 0x2.

3. Write CONFIG with BC = 0x3 address and read SDO at the same time. This reads register 0x2 while setting subsequent broadcasts to 0x3. And so on.

3.2 Register Setup

For sensing to work properly a few registers must be configured. Except the following, most registers may be left either to their default state or to the values calculated using the equations given in the datasheet.

Sensing is done by reading the voltage measured by the BOS1901. This voltage is stored as 10-bit unsigned in parameter VFEEDBACK of the read-only SENSE register (0xD). To access this value, the BC parameter in the CONFIG register (0x5) must be set to 0xD to broadcast the SENSE register content on SDO. Then VFEEDBACK can be read on every SPI write sequence.

Once read, VFEEDBACK value can be converted to voltage using this equation:

where Vref is 3.6 V and FBratio is 31.

The SENSE bit in the SUP_RISE register (0x7) controls the output mode of the BOS1901. When set to 0 the driver output is active and set to the programmed REFERENCE register value. When set to 1 the output is not actively driven to allow for the piezoelectric actuator to freely change. Thus, when driving the output to play a feedback waveform, SENSE must be set to 0, and when sensing, SENSE must be set to 1. VFEEDBACK can be read for both values of the SENSE bit.

Finally, the driver output must be enabled for sensing and driving to occur. This is done by setting bit OE to 1 in the CONFIG register (0x5)

Sensing and playback can only occur when bit OE in CONFIG register (0x5) is set to 1. It is not necessary to set OE to 0 when switching between sensing and driving.

3.3 Setting the Bridge Polarity

BOS1901 output voltage is measured across an internal H-bridge using a 10-bit ADC (see Figure 6). Although the voltage to be driven is entered in 12-bit signed 2’s complement representation, VFEEDBACK is only read in 10-bit unsigned representation. Despite the fact only a positive value is returned, it is possible to sense for positive or negative output voltage.

This is achieved by setting the bridge polarity according to the polarity to be measured:

· to measure a positive voltage (OUT+ minus OUT-), it must be set positive;

· to measure a negative voltage (OUT- minus OUT+), it must be set negative.

The bridge polarity is set using the FIFO value in the REFERENCE register (0x0). The bridge polarity is set to the same polarity of the FIFO value, whether BOS1901 is driving (SENSE = 0) or sensing (SENSE = 1). Therefore,

· any code between 0x0001 and 0x07FF will set the bridge to positive polarity;

· any code between 0x0F00 and 0x0FFF will set the bridge to negative polarity.

By having the SENSE bit set to 1, the bridge can be safely polarized without inducing a voltage on the output. However, it is recommended to have the output programmed to an appropriate value when changing the SENSE bit to 0 since the BOS1901 will then drive this programmed voltage to the output.

Note that the corresponding positive and negative values (like +5 V and -5 V) would return the same VFEEBACK value. It is therefore important to keep track of the bridge polarity in sensing algorithms.

Inverting the bridge has the effect of draining the charges accumulated so far on the actuator. Therefore, switching back and forth continuously between polarities is not recommended.

Figure 6 Controlling bridge polarity for sensing

3.4 ADC Offset Value

The VFEEDBACK value returned by the ADC for 0 V across the actuator is not zero. This offset value also may be different from chip to chip. It is therefore useful to measure this offset and subtract it from VFEEDBACK measurements for accurate and repeatable sensing.

Follow this procedure to get the ADC offset when initializing the sensing: 1. Complete the register setup for sensing given in section 3.1.

2. Set bit SENSE to 0, and OE = 1 to set the BOS1901 in driving mode.

3. Write 0x0000 to actively force the output to 0 V.

4. Write 0x0000 again to read VFEEDBACK on SDO.

5. This VFEEDBACK value is the offset. Save it for later use.

3.5 Voltage Sensing Basic Operation This section gives only the principle to obtaining the sensed voltage from the BOS1901. Refer to section 2 for detection algorithms. Once BOS1901 has been configured for sensing as explained in section 3.1, VFEEDBACK is obtained by writing any word on the SPI interface and reading SDO at the same time. Be careful to write a word that will not change the configuration or state of the IC unless intended. It is convenient to use the words 0x0001 (1 LSB) and 0x0FFF (-1 LSB) as they ensure the proper bridge polarity at all times, even when the SENSE bit is 0. Once VFEEDBACK is read, it should be subtracted by the offset value obtained in section 3.4. The result then represents the voltage on the actuator terminals in unsigned 10-bit. This value can then be compared to the detection threshold or processed by the detection algorithm run in the microcontroller.

Note that voltage sensing is not cadenced by the PLAY sampling rate parameter. Every time VFEEDBACK is read, it contains the latest value measured by the ADC. VFEEDBACK reading may be done regularly or not.

3.6 Piezo Creep

When a waveform finished playing, the actuator will tend to continue displacing and this will induce a voltage change on the actuator. This voltage change can be high enough in some cases to exceed the sensing threshold, thereby inducing an undesired threshold detection and creating undesired effects.

For example, let’s consider using the actuator as a click button emulator, playing a pulse when the pressure threshold is reached and another pulse when the pressure release threshold is reached. After the second pulse, piezo creep would induce voltage to rise again without the user applying a pressure. This voltage rise may trigger another pulse such that two pulses are triggered when releasing the actuator. Depending on the algorithm, this “button” might even get stuck in pressed state.

To prevent problems related to piezo creep, it is often necessary to actively drive the actuator to its rest value for some time until the actuator has settled enough for the following voltage rise to be within tolerable limits. The amount of time required to wait is dependent on the sensing algorithm used, the actuator size, its internal capacitance and the peak voltage used when playing the feedback waveform. A time of a few milliseconds will work in most cases. However the appropriate value is determined at testing and is the one that will prevent the sensing to automatically occur in all conditions.

Figure 7 Piezo creep following feedback waveform

3.7 Piezoelectric Actuator Polarity Behavior

Not all piezoelectric actuators behave the same. Some will support only positive voltage applied to their terminals; others can be driven in both polarities.

Also, most piezoelectric actuators will increase voltage when pressed and decrease voltage when released. However, some actuators will have the opposite behavior, decreasing the voltage when pressed and increasing the voltage release, while requiring positive waveforms to be driven.

These polarity behaviors need to be considered when building the sensing algorithm. The sequence, SPI commands and sensing algorithm need to be adapted to each situation.

4. Typical Sensing Sequence

This section details a typical sensing sequence when emulating a button with click feedback when press and released. This sequence assumes the actuator is unipolar, and its voltage is rising when pressed. The figure below depicts this sensing sequence. Letters indicate each phase of the sequence.

Figure 8 Typical sensing and feedback sequence emulating a click/release button

Phase A: Sensing Initialization

This phase sets up the registers for sensing. This phase is generally done only once when entering the sensing.

1. RST = 1; resets the IC. This bit auto-clears after the reset has completed.

2. BC = 0xD; sets SENSE register to broadcast on SDO in order to read VFEEDBACK.

Then the ADC offset value is measured. Once the offset value is obtained, it is stored to be used later.

3. SENSE = 0; sets the output to drive the output

4. OE = 1 to enable the output.

5. Write 0x0000 to set the output to 0 V.

6. Write 0x0000 again to retrieve the ADC offset value. Store this value for later.

 

Entering Phase B: Press Sensing Setup

Before starting to sense the actuator voltage, complete the setup for press sensing.

1. SENSE = 1; sets the output in sensing mode for the actuator voltage to change freely.

2. Write 0x0001; sets the bridge to positive polarity, sensing positive voltage.

Phase B: Sensing for Press

1. Write 0x0001 and read SDO; reads a sensed voltage value.

2. Subtract the ADC offset value obtained in phase A from the value read in step 1.

3. Use the resulting value in the selected detection algorithm.

4. If detection is not achieved, return to 1.

5. Once detection is achieved, go to the next phase.

 

Phase C: Press Feedback Waveform

This phase is entered once the press event is detected.

1. SENSE = 0; sets the IC to driving the output.

2. FIFO = xxx; plays the desired feedback waveform by sending individual voltage points to the REFERENCE register. In this example, points sent define a single sine pulse waveform. There are many ways to play waveforms on the actuators. See other application notes for instructions on playing waveforms using BOS1901.

 

Phase D: Creep Stabilization

1. FIFO = 0x0FFF. Once the waveform finished playing, the bridge should be inverted at -1 LSB (0x0FFF) value to ensure BOS1901 actively drives the actuator close to 0 V for some amount of time. This stabilizes the actuator and reduces the piezo creep.

 

Entering Phase E: Release Sensing Setup

Before starting to sense the actuator voltage, complete the setup for release sensing.

1. SENSE = 1; sets the output in sensing mode for the actuator voltage to change freely.

2. Write 0x0FFF; sets the bridge to negative polarity, sensing negative voltage.

 

Phase E: Sensing for Release

1. Write 0x0FFF and read SDO; reads a sensed voltage value. Remember VFEEDBACK values will still be sent as positive values.

2. Subtract the ADC offset value obtained in phase A from the value read in step 1.

3. Use the resulting value in the selected detection algorithm.

4. If detection is not achieved, return to 1.

5. Once detection is achieved, go to the next phase.

Phase F: Release Playback Waveform

This phase is entered once the release event is detected.

1. SENSE = 0; sets the IC to driving the output.

2. FIFO = xxx; plays the desired feedback waveform by sending individual voltage points to the REFERENCE register. As for the press feedback, a single sine pulse waveform is played although here the amplitude is reduced.

 

Phase G: Creep Stabilization

1. FIFO = 0x0FFF. Once the waveform finished playing, the bridge should be inverted at -1 LSB (0x0FFF) value to ensure BOS1901 actively drives the actuator close to 0 V for some amount of time. This stabilizes the actuator and reduces the piezo creep.

2. After the creep stabilization, return to press detection (phase B).

 

4.1 Changes for an Inverted Polarity Behavior Actuator

Using inverted behavior actuators, the following changes to the previous sequence are necessary. These changes are depicted in Figure 9.

1. Press sensing (phase B) is done in the negative polarity (using 0x0FFF as SPI write).

2. Release sensing (phase E) is done in the positive polarity (using 0x0001 as SPI write).

3. Waveform pulses are still played in the positive polarity (check actuator datasheet to make sure this applies, otherwise make appropriate changes).

Figure 9 Typical sensing and feedback sequence for an inverted polarity behavior actuator

4.2 Code Example Code examples can be found on the Boréas Technologies website in the technical documents section, under BOS1901-KIT Firmware. Look for the sensing example demonstrating each phase explained in this document.

5. Related Parts

Part Number Description
1 BOS1901 BOS1901 Piezo Haptic Driver with Digital Front End

Leave a comment

Please note, comments must be approved before they are published