-
Notifications
You must be signed in to change notification settings - Fork 20
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
AFFBWheel with hoverboard wheel #38
Comments
This will require rewriting everything from scratch. But, may be there is a simpler way. There is an example of hoverboard control via UART, I2c, analog signal or PPM signal at https://github.com/p-h-a-i-l/hoverboard-firmware-hack UART seems to be most convenient. Atmega32U4 cannot produce true analog signal, PPM or I2c require additional coding. As for software change, all is needed is to rewrite motor.cpp to send rotation commands via UART to hoverboard controller instead of forming PWM signal. |
Thanks for the answer! In fact, in my first question, I didn't want to mention that the whole project should be rewritten. I suggested one extra implementation only. About the hoverboard firmware asking for steering and speed: there is a way to disable the steering request and that way only the speed is sent, and that's how I'm doing it. I am trying to do as per your guidance. I adjusted the Encoder for pins 2/3 of the Arduino Leonardo, but I'm having problems mapping from -16383 to 16383 to -1000 to 1000. Debugging through the Arduino serial I see that the mapping only occurs when the wheel is getting close to the extremes. For example: I configured the wheel at 1080º and when I turn it, getting close to 540º, the mapping starts to be done. Likewise for -540º. And in this scenario (-16383 to 16383 to -1000 to 1000), when reaching the extreme, the wheel spins uncontrolled in the same direction instead of pushing towards the center. But if in the Arduino Leonardo code I put the mapping -16383 to 16383 for 1000 to -1000, then when reaching one of the extremes the wheel makes an effort to return to the center, but it is the only FFB effect that occurs. All others do not appear to be activated. Debugging directly from the hoverboard board, I also see that the mapping values only activate near the extremes of the wheel. In the firmware part of the hoverboard board apparently everything is OK with the settings. I tested it with the Arduino code that accompanies the project https://github.com/EFeru/hoverboard-firmware-hack-FOC and it works perfectly. I'll keep trying to rewrite the motor.cpp, but I think it will take time. |
I think you see the work of endstop. It is always on (in fact, it is not an FFB effect at all)
How do you test them? In a game, FEdit, or Wheelcheck? |
I did new tests. I kept the mapping from -16383 to 16383 to 1000 to -1000 and tested it in Euro Truck simulator 2 and Assetto Corsa. In ETS2 collision effects do not happen. Too many effects are apparently happening, but there is a lack of control in the wheel at times. Watch the video that shows the problem: HIDE In Assetto Corsa this same problem occurs and there are also no collision effects and no track effects either. I tried tests on WheelCheck and the effects enable, but do not disable even selecting the option in the program. See the video please: HIDE I just edited the motor.cpp, added the mapping (map function) and inserted the settings and the Send method from the example file: https://github.com/EFeru/hoverboard-firmware-hack-FOC/blob/main/Arduino/hoverserial/hoverserial.ino In the rewritten motor.cpp, the Send method sends the Steering value zero and the mapped speed via serial: Send(0,mapedForce). I'm using only two wires from the Arduino Leonardo to connect to the hoverboard's motherboard: GND and TX (connected to the motherboard's RX). In the videos you can see a noise that I believe is from the power supply. Later I will get a stronger source. I am confident that your project can become the solution for hoverboard motherboard use in force feedback projects. |
Second video with wheel not stopping makes me think it is a communication issue. Please try:
Also, I prefer FEdit for testing FFB effects. In a game you don't really know what game is trying to tell. FEdit allows to create any effect with any parameters, isolated. Try to create a single Constant force effect with 1-2 seconds duration and see will it perform it and stop or not.
|
Hey.
Is there a possibility for you to make an implementation to make it possible to use the hoverboard wheel together with the hoverboard's controller board? Currently it is commonly used VESC+STM32 or Odrive to control hoverboard motor and use for force feedback. This scheme also requires an incremental encoder and a few more absolute encoder models. The controller board of the hoverboard itself already has an STM32 and all the necessary circuitry. In the hoverboard wheel, in addition to phase 1, phase 2 and phase 3, there is also a hall sensor for each phase. Therefore, it would not be necessary to use another controller besides the original one of the hoverboard itself. Here is a link talking a little about the board of the hoverboard itself:
https://github.com/lucysrausch/hoverboard-firmware-hack
If you can't do this implementation, could you give me some guidance to get started?
Congratulations on your project!
The text was updated successfully, but these errors were encountered: