Pages: [1] 2 3   Go Down
Author Topic: Getting starte: My first project: Cruise control for ebike  (Read 4334 times)
0 Members and 1 Guest are viewing this topic.
Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I'm an absolute beginner trying to make my first project something useful.
The first thing I'd ask of you, is a shopping list, of what to buy to get started.

Here's the plan: I want to make a cruise control for my ebike.
The throttle works as a signal 0-5V.
At the push of a button I want the throttle signal to stay at the level it was at the moment I pushed the button.
When I push the button again I want the throttle to disengage.
Also, when I pull the brake lever (Reed switch with either an opener or closer attached) should kill the throttle and disengage the cruise control so it does not reengage, when the brake is released.

This is all I want to accomplish in a first step.

Later on, I would read out different sensors and display them on and Android phone... but that isfor a later time. If I can save money buying a set that will include things for the second project, I'd be up for that. Value for money above all ;-)

Thanks, guys.

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can potentially kill your self with any Arduino. Reading a switch state is easy. Using a PWM pin to output a psuedo 0 to 5V value is easy.

Whether the low current of that 0 to 5V value, and the choppiness of it, will be a problem is impossible to tell without knowing anything about your ebike.

The choppiness can be dealt with with a low pass filter. The low current can be dealt with with a transistor.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12528
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To me, cruise control means controlling the speed, not just maintaining constant throttle.

If constant throttle is all you want, you just need a potentiometer that stays where you put it, with some sort of latching relay to enable you to cut it in and out as you describe.

More useful I'd have thought was something that measured the road speed and applied power/braking to maintain it.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't worry, Paul, the kill switch is not essential. Other bikes don't have it at all and the brakes are strong enough to stop the bike even at full throttle.
The throttle will cut out about a second after you stop pedalling anyways because the signal from the crank'S PAS sensor is missing.
But I want a smoother solution to only pull on the brakes for a moment and kill the motor that way, also to just keep pedalling alone without the motor.

Yes, Peter, you are 100% correct. A readout of the speed and then cranking the throttle up slowly until that speed is reached would be perfect, but the problem is, how to control that. Because the controller would have to understand not only the current speed, but also the acceleration, so it accelerates at a more or less constant rate up to the target speed.

I would love to have readouts on an LCD or preferably my android device on about everything
- battery temp
- motor temp
- speed
- crank rpm
- current
- voltage
- power
- ambient temp

and switch controls from either setting a current (like with the poti) or a target speed (true cruise control)
with a display for target current and target speed.

2 reasons why, I don't want to go the poti route:
1. I don't know how to make the motor stay off, after the brake as been engaged
2. I would like to learn how to program an Arduino and play with electronics

I can build PCs and maintain networks but have no idea of programming and very limited soldering experience. I have a 7 year old, and I want to be able to teach him more in that area than my father could teach me (which is zilch)

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I would love to have readouts on an LCD or preferably my android device on about everything
Your phone belongs in your pocket, not your hand, when riding. Having information displayed in your pocket seems silly.
Logged

Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My phone serves as a speedo on my bike, and it's mounted to the handle bar.
I'm - as a matter of course - not using it for calls or texting while riding.

After all, why carry an additional display, when I already have a perfectly good one.
If you can recommend a nice weather proof display, maybe with some buttons that I could use with the Arduino, I'd be all up for that.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
After all, why carry an additional display, when I already have a perfectly good one.
OK. That's fine. I presume, then, since you are using it as a speedometer that you know how to get data into the phone, and how to manipulate that data to produce the visual effects that you want. Adding more data, and more manipulation to produce more effects, should be trivial.

Quote
If you can recommend a nice weather proof display,
Is your phone weatherproof?
Logged

Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
After all, why carry an additional display, when I already have a perfectly good one.
OK. That's fine. I presume, then, since you are using it as a speedometer that you know how to get data into the phone, and how to manipulate that data to produce the visual effects that you want. Adding more data, and more manipulation to produce more effects, should be trivial.

It's not that simple. I have an app that can do those things. It uses the GPS signal and calculates those values. So unfortunately I cannot take credit for that.

Quote
If you can recommend a nice weather proof display,
Is your phone weatherproof?

No, it isn't, but I don't leave my phone mounted to my bike, wherever I go. Whereas if I had a dedicated display I would mount that to the handlebar permanently.
And yes, when it starts to rain, I'll put my phone in my bag so it doesn't get wet.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12528
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A readout of the speed and then cranking the throttle up slowly until that speed is reached would be perfect, but the problem is, how to control that. Because the controller would have to understand not only the current speed, but also the acceleration, so it accelerates at a more or less constant rate up to the target speed.

That's easy enough to do, if your Arduino knows the current speed. Do you have any way of knowing the speed?
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
A readout of the speed and then cranking the throttle up slowly until that speed is reached would be perfect, but the problem is, how to control that.

Many ways to do that. PID would be an approach for example.

The key, seems to me, would be to find a way to interface with your bike: read off speed, and change throttle, at the minimum.
Logged

Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I can install a magnet in one of the spoks and maybe get a hal-sensor on the fork, hell, I could install multiple magnets in the spokes to make the readout more accurate.
Multiply the amount of peaks per minute with the circumference of the wheel, and we have the current speed.
That should be easy enough, if I know what sensor to buy.
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Knowing the bike's speed is only half the equation. How do you effect the throttle?
Logged

Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The throttle is a 0V-5V signal, which I can input either with a twist grip or a thumb throttle.
Logged

Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's a link to technical info for the controller

http://www.avdweb.nl/solar-bike/electronics/ku63-motor-controller.html
Logged

Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, where do I start guys to get the first bit working.
Let's start with the most simple function and take it from there.
Logged

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