Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable some auto-centering by default? #3

Open
chrisboyle opened this issue Mar 20, 2019 · 2 comments
Open

Enable some auto-centering by default? #3

chrisboyle opened this issue Mar 20, 2019 · 2 comments

Comments

@chrisboyle
Copy link
Owner

Just not the hard autocenter that was there before these patches.

@fred41 points out that the Windows driver sends 0x00 0x21 0x7f 0x46 (for _padding0, autocenter_strength, autocenter_force, autocenter_damping respectively) and writes:

I agree, it should be:

  1. initialised at device connect
  2. light and unobstrusive, minimal deadband (max coefficient, low saturation)
  3. disabled/overwritten, as soon as an ff-client starts a condition effect
  4. restored, if client disconnects
@fred41
Copy link

fred41 commented Mar 22, 2019

Maybe i should add: i think it can't be wrong to use a dedicated (8 resp. 4 byte) spring and/or damper condition slot for this purpose, because this slots can be reused if a ff-client connects.

@fred41
Copy link

fred41 commented May 27, 2019

... some weeks later:

I tested your linux driver against 5.2-rc2, your patch(es) works still great.

After some ffb related firmware research, i found the following implementation details confirmed:

  • there are really 2 slots for dedicated spring and damper effects (two dimensions each)
  • there is one combined (spring,damper and combined saturation, two dimensions) effect for hand on stick
  • there is one combined (spring,damper and combined saturation, two dimensions) effect for hand off, only as parameter set in firmware

Here is a link to my latest firmware patch:
https://github.com/fred41/G940-firmware-fixes

So my final view of the struct is something like this:

typedef` struct {
	int16_t	constant_force;
	int8_t	pad0;
	int8_t	combined_spring_coeff;
	int8_t	combined_spring_saturation;
	int8_t	combined_damper_coeff;
	int16_t	spring0_deadzone_neg;
	int16_t	spring0_deadzone_pos;
	int8_t	spring0_coeff_neg;
	int8_t	spring0_coeff_pos;
	int16_t	spring0_saturation;
	int16_t	spring1_deadzone_neg;
	int16_t	spring1_deadzone_pos;
	int8_t	spring1_coeff_neg;
	int8_t	spring1_coeff_pos;
	int16_t	spring1_saturation;
	int8_t	damper0_coeff_neg;
	int8_t	damper0_coeff_pos;
	int16_t	damper0_saturation;
	int8_t	damper1_coeff_neg;
	int8_t	damper1_coeff_pos;
	int16_t	damper1_saturation;
} __attribute__((packed, aligned(1))) ff_axis_t;

typedef struct {
	ff_axis_t x;
	ff_axis_t y;
} __attribute__((packed, aligned(1))) ff_t;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants