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

SendLR #60

Open
BaktiyarBr opened this issue Feb 6, 2024 · 8 comments
Open

SendLR #60

BaktiyarBr opened this issue Feb 6, 2024 · 8 comments

Comments

@BaktiyarBr
Copy link

hello thank you for your project it saved our lifes
i have a quiestion im using HoverSendLR function and passing -1000 and 1000 to spin the wheel to oposite directions but it doesnt work how spining to different sides can be done

2.10 test speed example

@RoboDurden
Copy link
Owner

  template <typename O,typename I> void HoverSendLR(O& oSerial, I iSpeedLeft, I iSpeedRight) // -1000 .. +1000
  {
    // speed coeff in config.h must be 1.0 : (DEFAULT_)SPEED_COEFFICIENT   16384
    // steer coeff in config.h must be 0.5 : (DEFAULT_)STEER_COEFFICIENT   8192 
    HoverSend(oSerial,iSpeedRight - iSpeedLeft,(iSpeedLeft + iSpeedRight)/2);
  }

Please post the serial feedback log sent from hoverboard to ESP32 (or alike).

@AILIFE4798
Copy link

gen2.x does not support tank steering afaik
use uartbus

@RoboDurden
Copy link
Owner

HoverSendLR should just do that. send a speed for left motor and a speed for right motor.
But have not tested it for a long time now..

@AILIFE4798
Copy link

ok i dk that it would be very helpful

@BaktiyarBr
Copy link
Author

so i have this HoverSendLR(oSerialHover, 1000, -1000); and log says iSpeed0 iSteer 1000 and wheels doesnt move at all
how to use uartbus for this?

@AILIFE4798
Copy link

uartbus master and slave will receive own speed and you need to change the slaveID of them so you can set them to different speed

@RoboDurden
Copy link
Owner

Well, @AILIFE4798 might be right and the hoverSendLR is old code from my EFeru FOC hovercar firmware.

For some reason, This gen2 firmware uses a large float array to map steer and speed to speedL and speedR in main.c

So maybe hoverSendLR does not work as expected.

@BaktiyarBr , you could replace the angle mapping with the original code from Niklas fauth

speedR = CLAMP(speed * SPEED_COEFFICIENT - steer * STEER_COEFFICIENT, -1000, 1000);
speedL = CLAMP(speed * SPEED_COEFFICIENT + steer * STEER_COEFFICIENT, -1000, 1000);

and report back if we can get rid of that huge angle array main.c

Or try uartBus as suggested by @AILIFE4798

@RoboDurden
Copy link
Owner

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

3 participants