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

Speed sensors issue. #478

Closed
tbellembois opened this issue Jan 28, 2025 · 5 comments · Fixed by #479 · May be fixed by tbellembois/OpenBot#1
Closed

Speed sensors issue. #478

tbellembois opened this issue Jan 28, 2025 · 5 comments · Fixed by #479 · May be fixed by tbellembois/OpenBot#1
Labels
help wanted Extra attention is needed

Comments

@tbellembois
Copy link
Contributor

Hello,

I have an issue with my speed sensor. Only one reports speed for both right and left.
If I only run the left wheels the OLED display gives the same speed for both right and left wheels.
If I only run the right wheels the OLED display gives 0 rpm.

I have checked my wiring three times. I have tested with the Android application and Arduino console.

Desktop: linux Fedora 42
Smartphone: Sony xperia xa2 for the bot, Volla phone 22 for the controller

DIY version.

Here is my firmware configuration (relevant part only):

#define OPENBOT DIY
...
//-------------------------DIY--------------------------//
#if (OPENBOT == DIY)
const String robot_type = "DIY";
#define MCU NANO
#define HAS_VOLTAGE_DIVIDER 1
const float VOLTAGE_DIVIDER_FACTOR = (20 + 10) / 10;
const float VOLTAGE_MIN = 2.5f;
const float VOLTAGE_LOW = 9.0f;
const float VOLTAGE_MAX = 12.6f;
const float ADC_FACTOR = 5.0 / 1023;
#define HAS_INDICATORS 1
#define HAS_SONAR 1
#define SONAR_MEDIAN 0
#define HAS_SPEED_SENSORS_FRONT 1
#define HAS_OLED 1
const int PIN_PWM_L1 = 5;
const int PIN_PWM_L2 = 6;
const int PIN_PWM_R1 = 9;
const int PIN_PWM_R2 = 10;
const int PIN_SPEED_LF = 2;
const int PIN_SPEED_RF = 3;
const int PIN_VIN = A7;
const int PIN_TRIGGER = 12;
const int PIN_ECHO = 11;
const int PIN_LED_LI = 4;
const int PIN_LED_RI = 7;

Any idea? Thanks for your help.

@tbellembois tbellembois added the help wanted Extra attention is needed label Jan 28, 2025
@tbellembois
Copy link
Contributor Author

Update: after more tests the Arduino console reports correct values. This is an oled display issue.

@tbellembois
Copy link
Contributor Author

I found the issue, in the firmware file, line 1622:

String right_rpm_str = String("Right RPM:  ") + String(rpm_left, 0);

just replaced rpm_left with rpm_left.

@thias15
Copy link
Collaborator

thias15 commented Jan 29, 2025

Thanks for finding this bug? 🐛 Do you mind raising a PR to fix it?

@tbellembois
Copy link
Contributor Author

Yes, I will do it.

@tbellembois
Copy link
Contributor Author

added: #479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
2 participants