Jonny999999 / armchair_fw

Firmware for a homemade automated electric armchair using an esp32 controller on a custom pcb
https://pfusch.zone/electric-armchair-v2
0 stars 0 forks source link

smooth joystick coordinate scaling #3

Open Jonny999999 opened 2 years ago

Jonny999999 commented 2 years ago

Scale coordinates of joystick to have more precision (joystick travel) at slower speeds. Currently implemented with linear scaling (see below), however this currently results in a weird/unexpected acceleration at the rapid change of scaling. => find a better way to scale the coordinates

already tried

exponential scaling

first tried with exponential scaling: 1c6586c29eb75b8b27c34f87be18559fb08b6623 => smooth but some some area with almost no output change at start

linear scaling

then linear scaling with switching point: b460a521811bf028e27fd2b4cdb33b403e7e2fe2 => can be adjusted precisely but the point it switches to the other slope is very hard/noticeable while driving

ideas

Bezier curve??

have a function that represents the desired scaling curve example: https://www.desmos.com/calculator/cahqdxeshd