Pages: 1 [2] 3   Go Down
Author Topic: how to make brakes for RC car ? [SOLVED]  (Read 3061 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Tesla Member
***
Karma: 124
Posts: 7154
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok this is what i am to know, how to make this happen as an independent brake pedal ?
for the reverse the same pedal used to go forward will be the throttle for going backward but the condition for that is that the reverse button should be clicked on

This is a software issue, not a hardware issue. What happens to the signals to the h-bridge when you select reverse and press the accelerator? Make the same thing happen (though not as strongly) when you press the brake.

...R
Logged

Lebanon
Offline Offline
God Member
*****
Karma: 0
Posts: 754
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok this is what i am to know, how to make this happen as an independent brake pedal ?
for the reverse the same pedal used to go forward will be the throttle for going backward but the condition for that is that the reverse button should be clicked on

This is a software issue, not a hardware issue. What happens to the signals to the h-bridge when you select reverse and press the accelerator? Make the same thing happen (though not as strongly) when you press the brake.

...R

ohh great problem solved !! but can both pedals work if pressed together ? and can i make it like the real brakes i mean if i press a little it will slow down, if i press more it will press more and full brake will stop the car ?
Logged

Aiming for the unreachable !

UK
Offline Offline
Tesla Member
***
Karma: 124
Posts: 7154
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Time for a little thought ...

You seem to know how to make your motor go forwards and backwards.

Can you describe how your code will cause the h-bridge to make the motor move in reverse at different speeds?

If you can write that down clearly I'm sure you will also see how to make your brake "pedal" work.

...R
Logged

Lebanon
Offline Offline
God Member
*****
Karma: 0
Posts: 754
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Time for a little thought ...

You seem to know how to make your motor go forwards and backwards.

Can you describe how your code will cause the h-bridge to make the motor move in reverse at different speeds?

If you can write that down clearly I'm sure you will also see how to make your brake "pedal" work.

...R

ok i understand then i must take a brake for now untill the supplier, from where i buy my components, bring me the IC for reverse control
but i guess i understand your point, for the record the code i am using or the code i took a look at are those from Adafruit but for the reverse mission still did not try it because reverse ICs are missing for now. I will describe what i can understand from those code and please tell me if i am right : I can see here an analog read from a pot so what i have to do is make a map() and tell it to convert the value from 0 to whatever into for example 50 and so on untill 255 which will be the full braking when i hit the braking pedal which mean braking pin = HIGH (Am i right or not ?).
 If you have a tutorial about the method your talking about for the analogue current it would be great because till now i couldn't find any and still looking and thanks for all your help and time smiley :

/*
Adafruit Arduino - Lesson 15. Bi-directional Motor
*/
int enablePin = 11;
int in1Pin = 10;
int in2Pin = 9;
int switchPin = 7;
int potPin = 0;
void setup()
{
pinMode(in1Pin, OUTPUT);
pinMode(in2Pin, OUTPUT);
pinMode(enablePin, OUTPUT);
pinMode(switchPin, INPUT_PULLUP);
}
void loop()
{
int speed = analogRead(potPin) / 4;
boolean reverse = digitalRead(switchPin);
setMotor(speed, reverse);
}
void setMotor(int speed, boolean reverse)
{
analogWrite(enablePin, speed);
digitalWrite(in1Pin, ! reverse);
digitalWrite(in2Pin, reverse);
}
« Last Edit: July 06, 2013, 11:42:34 am by firashelou » Logged

Aiming for the unreachable !

UK
Offline Offline
Tesla Member
***
Karma: 124
Posts: 7154
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Think what this piece of your code does

Code:
void setMotor(int speed, boolean reverse)
{
analogWrite(enablePin, speed);
digitalWrite(in1Pin, ! reverse);
digitalWrite(in2Pin, reverse);
}

The direction depends on whether 'reverse' is true or false and the motor will move at the speed determined by 'speed'.

First you need to know what your motor does when forward direction and 0 speed is selected. I assume you started this Topic because the motor keeps turning due to the momentum of the car - but if you have not yet built the car you will have to wait and see. Anyway, assume the car keeps moving and slowing, but not as quickly as you would like. What do you think would happen if you applied a small reverse current to the motor? Again you will have to do some experiments to see what actually happens. Do you think the smoke might escape somewhere if you apply a large reverse current? I don't know.

How would you get this electric brake to work while the car is moving backwards?

...R
Logged

Lebanon
Offline Offline
God Member
*****
Karma: 0
Posts: 754
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Think what this piece of your code does

Code:
void setMotor(int speed, boolean reverse)
{
analogWrite(enablePin, speed);
digitalWrite(in1Pin, ! reverse);
digitalWrite(in2Pin, reverse);
}

The direction depends on whether 'reverse' is true or false and the motor will move at the speed determined by 'speed'.

First you need to know what your motor does when forward direction and 0 speed is selected. I assume you started this Topic because the motor keeps turning due to the momentum of the car - but if you have not yet built the car you will have to wait and see. Anyway, assume the car keeps moving and slowing, but not as quickly as you would like. What do you think would happen if you applied a small reverse current to the motor? Again you will have to do some experiments to see what actually happens. Do you think the smoke might escape somewhere if you apply a large reverse current? I don't know.

How would you get this electric brake to work while the car is moving backwards?

...R


i guess i must make both directions on but on with same current to make it stop completely ?
Logged

Aiming for the unreachable !

UK
Offline Offline
Tesla Member
***
Karma: 124
Posts: 7154
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hopefully it is not possible to have both directions ON at the same time - that almost certainly would let the smoke out.

Surely it is sufficient, once the car is no longer moving, to stop all power to the motor? Don't look for complicated solutions.

Also, it seems to me that you are mentally skipping past the problem of slowing the car to the separate question of whether a parking brake is needed. Make sure you fully understand the slowing process before you bother with a parking brake. And you will need to do some experiments to figure out what works best.

If you really do need a parking brake why not mount a small servo so it's arm presses on one of the tyres.

...R
Logged

Lebanon
Offline Offline
God Member
*****
Karma: 0
Posts: 754
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hopefully it is not possible to have both directions ON at the same time - that almost certainly would let the smoke out.

Surely it is sufficient, once the car is no longer moving, to stop all power to the motor? Don't look for complicated solutions.

Also, it seems to me that you are mentally skipping past the problem of slowing the car to the separate question of whether a parking brake is needed. Make sure you fully understand the slowing process before you bother with a parking brake. And you will need to do some experiments to figure out what works best.

If you really do need a parking brake why not mount a small servo so it's arm presses on one of the tyres.

...R

aha the last part you said, mechanical brake, i was actully thinking about making a small mechanism for that but i found out it won't work !!
but you are suggesting to make the servo's arm directly press on the tyre well wouldn't that damage the arm or the tyre ?

and about the first part of your post yes your right i will get the answer when i make experiments and if not then i will ask about the problem i get into.
Logged

Aiming for the unreachable !

UK
Offline Offline
Tesla Member
***
Karma: 124
Posts: 7154
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I fear you and I are thinking on very different wavelengths and I worry that what I say may be seriously misinterpreted.

I don't understand, based on what I said earlier, how you can think that a servo arm pressing on a stationary tyre with just sufficient force to stop the wheel moving could damage either the tyre or the servo.

I think it would be helpful if you explain your thinking in case you are having similar misunderstandings about other things I have said.

...R
Logged

Lebanon
Offline Offline
God Member
*****
Karma: 0
Posts: 754
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I fear you and I are thinking on very different wavelengths and I worry that what I say may be seriously misinterpreted.

I don't understand, based on what I said earlier, how you can think that a servo arm pressing on a stationary tyre with just sufficient force to stop the wheel moving could damage either the tyre or the servo.

I think it would be helpful if you explain your thinking in case you are having similar misunderstandings about other things I have said.

...R

ah ok well i understood that your idea is to put a servo with its arm close to the tyre and when hitting the brake the servo will turn and make a pressure on the rotating wheel and act like a brake to make it stop ?
Logged

Aiming for the unreachable !

UK
Offline Offline
Tesla Member
***
Karma: 124
Posts: 7154
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, that is NOT what I said, and that's why I wanted you to explain what you thought I was saying.

I only suggested using the servo as a parking brake - meaning it would only be used AFTER the wheel had stopped turning (just to stop the car rolling down a hill).

I think it would be useful to read all the previous posts very carefully to make sure you have not made any similar erroneous assumptions. If you are unsure of anything please ask.

...R
Logged

Lebanon
Offline Offline
God Member
*****
Karma: 0
Posts: 754
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, that is NOT what I said, and that's why I wanted you to explain what you thought I was saying.

I only suggested using the servo as a parking brake - meaning it would only be used AFTER the wheel had stopped turning (just to stop the car rolling down a hill).

I think it would be useful to read all the previous posts very carefully to make sure you have not made any similar erroneous assumptions. If you are unsure of anything please ask.

...R

ohh i am sorry for my misunderstanding :S
but thanks for that idea it can be used in other applications but not in this one smiley because i don't need to make a park button, what i need is : a reverse button, a burnout button, neutral and a speed limiter, all is solved except the reverse one which i know how to do but still waiting for the IC to be in my hands (the suppliers fault smiley-sad ), so the reverse must be clicked on so when i hit the throttle, the car will go backward and when i hit the brakes it should be braking probably like a real car (that's my goal to make it function similarly to a real car but electrically ),
if you know any good tutorials about something similar on the braking issue it would be great smiley ?
Logged

Aiming for the unreachable !

UK
Offline Offline
Tesla Member
***
Karma: 124
Posts: 7154
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have already described how I would try to make braking work if it were my car. I can't think of anything else to add.

...R
Logged

Lebanon
Offline Offline
God Member
*****
Karma: 0
Posts: 754
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have already described how I would try to make braking work if it were my car. I can't think of anything else to add.

...R

ok thanks a lot will read it again and again to make it works smiley
Logged

Aiming for the unreachable !

Darlington, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 125
Shaamo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It would help if you could give a picture of the car setup.

Personally I would code the brake to remove throttle up to the point in which the brake is mor than the throttle, then actuated a servo with some form of friction device on the driven axle.  That way limiting the amount of additional components required.

Presume you're using some form of pot for the accelerator and brake... So if throttle is on full, apply half brake arduino supplies half throttle, simple really.  If throttle is on half, apply full brake, servo actuated to ram on the friction. Simple really.
Logged

Pages: 1 [2] 3   Go Up
Jump to: