Go Down

Topic: arduino motor shield (Read 998 times) previous topic - next topic

vini_i

i am using an arduino motor shield r3 to drive two brushed dc motors.

on the motor shield can the brake function be engaged without stopping the PWM command to the motors.
for example if the robot is driving forward full throttle (PWM at 255) and a obstacle is detected and i want the robot to stop until the obstacle is gone can i engage the brakes with out dropping the PWM to zero. so when the brakes are disengaged the robot will continue full speed. or will doing so fry the board by short circuiting it.

is the board protected?

ash901226

yes you may. its simple really. but why do you want to do that?

vini_i

what i'm working on is a sumo bot. (two robots go into a a round ring and try to push each other out, the robots must be fully autonomous). i want to make the code with as few lines as possible to allow for the greatest speed. they way i'm designing my code is that when the bot detects an object it will drive at it full speed. as soon as no object is detected it will kick on the brakes because it is very easy to drive out of the ring. then all that needs done is one of the motors switched into reverse and to turn the brakes off the cause the robot to spin locating the target. then another quick tap of the breaks and switch the one motor back into forward and off we go after the opponent. in this scenario the motors are always at full speed and i don't constantly have to command the PWM up or down.

does this sound reasonable?

ash901226

actually in your sequence that can easily be implement with port manipulation.
see page
Code: [Select]
http://www.arduino.cc/en/Reference/PortManipulation

well basically you dot have to use a pwm to give instruction to go full speed. just a simple digitalWrite High will do the trick. or if you decide to use port manipulation then for ArduinoMotorShieldR3 u just need to very the port B use as in the link i provided.

Go Up