Notifications
Clear all

Robot Car Continously Running Why ?

43 Posts
7 Users
0 Likes
9,015 Views
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 
Posted by: @gulshan

Thank You It was Very Helpful

No problem, glad that you were able to use it successfully... you've now made it easier for people to help you!


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@gulshan

From your last video, judging by the frequency of the driver lights, it's possible that the PWM frequency is too low for the motor to support that speed?


   
ReplyQuote
Gulshan
(@gulshan)
Member
Joined: 4 years ago
Posts: 127
Topic starter  

@frogandtoad

Actually It only happens when the arduino is being powered by the usb port but when i supply the arduino from the driver's 5V it self it Runs Smoothly.


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@gulshan

Posted by: @gulshan

Actually It only happens when the arduino is being powered by the usb port but when i supply the arduino from the driver's 5V it self it Runs Smoothly.

Then perhaps the USB cannot supply sufficient enough power, and that is the problem?


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

   
ReplyQuote
Gulshan
(@gulshan)
Member
Joined: 4 years ago
Posts: 127
Topic starter  
Posted by: @frogandtoad

const int xDirPin(A0); const int yDirPin(A1); void setup() {  Serial.begin(9600); } void loop() {  if((analogRead(xDirPin) < 480) or (analogRead(xDirPin) > 520)) {     Serial.print("X: "); // Stop the motor inside this statement     Serial.println(analogRead(xDirPin));    }      if((analogRead(yDirPin) < 480) or (analogRead(yDirPin) > 520)) {     Serial.print("Y: "); // Stop the motor inside this statement     Serial.println(analogRead(yDirPin));    }      delay(50); }

I think the Joystick Shield is working Fine. I tried and these are the results:- 


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@gulshan

It looks like your results show that it is still running when you let go of the joystick?

In my case, the code does not run (i.e: the X and Y values stop printing), unless I move the joystick... that was the whole point of the test to check if the joystick is operating as expected.


   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 

@gulshan

The code you showed above was just missing the Serial.begin(baudrate); in void setup()

Make sure you select the same baud rate in your serial monitor (if possible a rather high one like 57600 or 115200), and add some kind of method to avoid printing in each end every loop like i showed, oherwise the output will be overwhelming

Eric


   
ReplyQuote
(@freddie43)
Member
Joined: 4 years ago
Posts: 24
 

@zeferby

Would this topic be better in the 'Help wanted' section? It just goes on and on...


   
ReplyQuote
Gulshan
(@gulshan)
Member
Joined: 4 years ago
Posts: 127
Topic starter  
Posted by: @frogandtoad

It looks like your results show that it is still running when you let go of the joystick?

In my case, the code does not run (i.e: the X and Y values stop printing), unless I move the joystick... that was the whole point of the test to check if the joystick is operating as expected.

So That means my Joystick shield is not Properly. Guess I have to move on to the single joystick module.


   
ReplyQuote
Gulshan
(@gulshan)
Member
Joined: 4 years ago
Posts: 127
Topic starter  
Posted by: @freddie43

Would this topic be better in the 'Help wanted' section? It just goes on and on...

What is this Section or Where is it ?


   
ReplyQuote
Gulshan
(@gulshan)
Member
Joined: 4 years ago
Posts: 127
Topic starter  
Posted by: @frogandtoad

In my case, the code does not run (i.e: the X and Y values stop printing), unless I move the joystick...

but in many code examples i have seen that  for testing the joystick modules the the serial monitor continoues to show some values while the joystick shield is free. take a look in this video:-

please try this code for once with your module and share your results. I will try to do the same.

 


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@gulshan

No no no, the code I wrote is to test whether your joystick isn't behaving as expected (for example, when you let it go... it no longer produces values (because it's in the dead zone) and nothing more. 

Your question for help was: "Robot Car Continously Running Why ?"

If your joystick does continue to run under the code example I presented (even after you tweaked the range values as I mentioned), then your joystick is not behaving like mine, and you need to decide if the operation of your joystick is acceptable to you or not, and adjust your algorithm accordingly, or purchase a new one if you believe this test proves it's faulty.


   
ReplyQuote
Page 3 / 3