cancel
Showing results for 
Search instead for 
Did you mean: 

Pad Force Vs Velocity Implementation and Testing using STM32

Rider
Associate II

Hello, 

I am trying to implement a STM32 based pad assessment functionality, in which the applied force should be converted to the velocity based on user set polynomial degrees as in below image. I have implemented the code to calculate velocity based on ADC values and apply it to pad curve functionality. But I don't have any mechanical setup to measure the force applied so I can plot the Force vs Velocity curves. I would like to get some feedback on the implementation and need some idea on how to test the same.

frcvsvel.png

 

 

FinalVelocity = ApplyPadCurve(user_velocity, usr_degree);

uint8_t ApplyPadCurve(uint8_t velocity, uint8_t degree) 
{
	uint8_t FinalscaledValue = scaledValue;
	switch (degree)
	{
	case 1: // Curve deg 1 (Linear)
		FinalscaledValue = scaledValue; 
		break;

	case 2: // Curve deg 2 (Quadratic)
		FinalscaledValue = pow(scaledValue, 2.0) / 100; 
		break;

    case 3: // Curve deg 3 (Cubic)
        FinalscaledValue = pow(scaledValue, 3.0) / pow(100, 2.0); 
		break;

    case 4: // Curve deg 4 (Quartic)
        FinalscaledValue = pow(scaledValue, 4.0) / pow(100, 3.0);
		break;

    default:
        break;
    }
	return FinalscaledValue;
}

 

 

 

 

5 REPLIES 5

What do you mean by "pad" here?

Hello Andrew Neil,

I’m referring to the velocity-sensitive pads used in MIDI instruments, as shown in the image below.

Rider_1-1729181319677.png

 

 

 

So where did you get that curve from?

Are you creating a new device, or just "hacking" an existing product?

If it's an existing product, can't you just just look at the MIDI output it gives?

 


@Rider wrote:

I don't have any mechanical setup to measure the force applied


Weight is a force ...

 

But isn't what you're really interested in just the velocity? The actual force is immaterial, surely?

You could measure velocity with a light-gate.

Or drop a known weight from a known height - so velocity can be calculated ...

Actually, I am working on requirement to develop a velostat based stand alone pressure sensitive pads. The requirement is that pad should work in 4 modes based on the curves set by user. I have the hardware setup and code, but I don't know how I can validate this. Since, I don't have any external setup to measure the force applied. As of now, I am plotting the obtained ADC values and calculated velocity data. I don't know whether this is a correct approach. I need suggestions on how I can validate this functionality.


@Rider wrote:

I am working on requirement to develop a velostat based stand alone pressure sensitive pads. 


Still unclear on what the actual purpose of this is.

What, exactly, is the required output of this system?

Is this a school/college assignment? If so, you should be going to your teacher/supervisor for advice.

It really has nothing to do with STM32 as such.

 


@Rider wrote:

I don't have any external setup to measure the force applied. .


Again, weight is a force. Very easy to apply a controlled static weight, or drop a known weight from a known height.

 

PS:

 


@Rider wrote:

 velostat based .


Something like this: https://www.adafruit.com/product/1361 ?

So maybe ask on Adafruit's forums: https://forums.adafruit.com/ ?