How to add a throttle to a Carrera Vengeance E Spec

CdRsKuLL

Pedelecer
May 13, 2018
34
26
Bolton
lazylegs.co.uk
UPDATED v1.1 code (30/05/2018)
Improved the pulse conversion from the throttle
Improved the pulse replication from the pedal

So, with the kind help from Tony at Wooshbikes.co.uk I've been able to complete this little project. :) He supplied a thumb throttle and a replacement DH Sensor which is the 12 magnet type on these Carrera bikes. The original PAS DH sensor on my bike was faulty which is why I needed a replacement. You can just use the original if it's working.

If I were to do it again I would most likely go for a throttle grip rather than a thumb one, as it would be easier to fit. If you are going to use a thumb throttle then you can only fit one of the left side as the right you have the gears and they get in the way.

To complete this little project I used

Arudino Nano v3 (eBay etc.. )
Thumb accelerator (Wooshbikes.co.uk)
Replacement PAS - pedal assist sensor (Wooshbikes.co.uk) only require as my original one was broken

Below is the diagram for wiring it all up.

Carrera-throttle-Diagram.png

All the above does is generate a pulse which would normally come from the pedals. I've coded it so you can still use the pedals if the throttle isn't being used.

Please test before adding power from your controller... I tested mine in the Arduino serial monitor and it should output as..

No output when nothing is happening.
On low throttle you should see around 550.
On full throttle you should see around 80.
No throttle but moving pedals - see text pedal round..

carrera monitor.JPG

If you see any other values you may need to adjust the range. This is done in the following lines....

pulseoff = (510 - (val / 1.4))+220;

This seems to output a range of 70 - 580.. 580 is when the throttle is off, anything above 560 is ignored. (works in reverse).

Code:
// Wrote by CdRsKuLL  30th May 2018 v.1.1
// Updated pedal code to match input when throttle not being used.
// Updated range as it was stalling the motor at to fast.
// Please have fun but always test the output before connecting it the the bike.. safety first!!
// http://diyrc.co.uk  http://wooshbikes.co.uk
int throttlePin = 0;
int pulseoff = 600;
int pulseon = 0;
int val = 0;
bool pulse = false;
bool throttle = false;
int pedalin = 2;
unsigned long startMillis;
unsigned long currentMillis;
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(pedalin, INPUT);
  digitalWrite(LED_BUILTIN, LOW);
  attachInterrupt(digitalPinToInterrupt(pedalin), pedalon, CHANGE);
  startMillis = millis();
  Serial.begin(9600);
}
void loop() {
  currentMillis = millis();
  val = analogRead(throttlePin);
  pulseoff = (600 - (val / 1.7)) + 120;
  pulseon = int(pulseoff / 3);
  if (pulse == false) {
    if (pulseoff < 550) {
      if (throttle == false) { //removes the halfsecond possible delay on first start up.
        digitalWrite(LED_BUILTIN, HIGH);
        throttle = true;
        pulse = true;
      } else {
        if (currentMillis > (startMillis + pulseoff)) { //send pulse
          digitalWrite(LED_BUILTIN, HIGH);
          Serial.println(pulseoff);
          pulse = true;
          startMillis = millis();
          throttle = true;
        }
      }
    } else {
      throttle = false;
    }
  } else {
    if (currentMillis > (startMillis + pulseon)) {
      pulse = false;
      digitalWrite(LED_BUILTIN, LOW);
    }
  }
}
void pedalon()    //Called when pedal is moved
{
  if (throttle == false) { //Only passes signal if throttle is not being used, otherwise ignored.
    if (digitalRead(2) == HIGH) {
      digitalWrite(LED_BUILTIN, HIGH);
    } else {
      digitalWrite(LED_BUILTIN, LOW);
    }
    Serial.println("pedal round..");
  }
}
Any questions please ask away :)

Hope this comes in handy for others.

Video below was before I recieved the throttle from wooshbikes.. just a proof of concept.

arduino 1.jpg

arduno2.jpg

3D printed Arduino Nano temp case

arduino3.jpg

arduino5.jpg

arduino4.jpg

Steve
 
Last edited:

Woosh

Trade Member
May 19, 2012
20,222
16,819
Southend on Sea
wooshbikes.co.uk
great job :)
 

wheeliepete

Esteemed Pedelecer
Feb 28, 2016
2,047
757
61
Devon
Could never dream of doing the coding bit:confused:, but the rest is really straight forward-nice one and thanks for sharing it:)
 

CdRsKuLL

Pedelecer
May 13, 2018
34
26
Bolton
lazylegs.co.uk
Thanks guy,

Just been out as it stopped raining and I've improved the code a little (updated above), very happy with the outcome now. did a couple of miles without any problems.. well besides not burning any calories!

Just waiting for my Arduino nanos to arrive without soldered pins so I can insert it into the frame and get it out of the way.

I do have a Carrera Vulcan E Spec which is my main ebike, the vengeance was just a cheap project bike that was broken when I purchased it. I might look at modding that too, which would be the same as the crossfire (same electronics) but I feel like its cheating.. lol I'm guessing it would be the same process as the above.

Steve
 
  • Like
Reactions: peter.c

peter.c

Esteemed Pedelecer
Apr 24, 2018
1,612
493
thurrock essex
Great project I think if you made this as a kit you could be on to a winner :)
perhaps you could use your talent on the bafang bbso1 250watt controller;)
 
  • Like
Reactions: CdRsKuLL

CdRsKuLL

Pedelecer
May 13, 2018
34
26
Bolton
lazylegs.co.uk
Can't you already add a throttle to that? If that's a centre motor then as well as a throttle you should be able to also increase the speed :)
 

peter.c

Esteemed Pedelecer
Apr 24, 2018
1,612
493
thurrock essex
yes already has a throttle but programme is limited to 15 amps in the controller firmware hidden menu on bafang software, it gives controller fault code as soon as you try to adjust the 350 watt is set to 18 amps
 

Woosh

Trade Member
May 19, 2012
20,222
16,819
Southend on Sea
wooshbikes.co.uk
Great project I think if you made this as a kit you could be on to a winner :)
perhaps you could use your talent on the bafang bbso1 250watt controller;)
shush... don't tell him that he could invent something for the BBS01, that would spoil his next bank holiday...
 
  • Like
Reactions: CdRsKuLL

CdRsKuLL

Pedelecer
May 13, 2018
34
26
Bolton
lazylegs.co.uk
Need to be careful when upping the amps, that's +15% increase which is quite a bit. Would need to look at the wiring / cooling etc.. so it's more power you're after :) I've been trying to convince the wife I need a full suspension ebike.. it's not happening sadly.
 

CdRsKuLL

Pedelecer
May 13, 2018
34
26
Bolton
lazylegs.co.uk
Happy to report I've just done 10 miles on throttle only... it coasts along at 15mph.. slows to about 10-11 on hills and freewheels up to 20mph on the course I just went. :) Battery is about 20-30% left I think. It's hard to tell on the vengeance as its only got 4 leds that don't help much. Also the battery is 8.8ah where my Vulcan is 11.6ah.. so I might try that battery and see if there's a difference. I still need to tweak the code a little but I'm making enquiries into turning this into a commercial plug n play product. :)
 
  • Informative
  • Useful
Reactions: LeighPing and Woosh

peter.c

Esteemed Pedelecer
Apr 24, 2018
1,612
493
thurrock essex
if you can produce this to work 0n the Carrera bikes there is a market
but the main question you will get asked is about the speed limiter ;)
 

CdRsKuLL

Pedelecer
May 13, 2018
34
26
Bolton
lazylegs.co.uk
No problem :) I've decided to turn this into a commercial product.

Just waiting for the components to arrive and finalise the design. I'm hoping to be able to provide a throttle upgrade for most of the Carrera range. Website will be http://LazyLegs.co.uk .. I'm currently working on getting it finished whilst I'm waiting for the bits to arrive. I will be doing a run of 20 Vengeance Throttle kits to start with. Will offer a v.nice and extra discount to forum members too.
logo.jpg
Hoping to have the first kits ready in the next 4 weeks. Just finished conducting tests on potting resin for the electronics for protection.

Exciting times.. :)

Steve
 

Gaurav Suri

Finding my (electric) wheels
Jun 27, 2018
16
0
Steve,
Any chance of getting a throttle kit for carerra valcun and crossfire?

Also can this also de-restrict the bike?
Regards,
Gaurav
 

danielrlee

Esteemed Pedelecer
May 27, 2012
1,391
719
Westbury, Wiltshire
torquetech.co.uk
Good job! Can you please clarify the end result? Is the throttle output fully variable, or is it single speed, regulated by the current PAS level selection?

EDIT: Having re-read the thread and watched your video, it looks like you've achieved variable motor speed using the throttle output, but I'm struggling to figure out how. Isn't the controller PAS input just an on/off affair? If you're just varying the pulse timing on the PAS input, is the motor movement somewhat jerky as the continuous pulse signal is enabled/disabled?
 
Last edited:
  • Agree
Reactions: Needtogofaster

CdRsKuLL

Pedelecer
May 13, 2018
34
26
Bolton
lazylegs.co.uk
Steve,
Any chance of getting a throttle kit for carerra valcun and crossfire?

Also can this also de-restrict the bike?
Regards,
Gaurav
Hi, still in testing stages at the moment on the Vulcan. This one uses two opto sensors triggered every 10th degree. The codes been wrote but we are waiting on the 4 pin connectors at the moment. Should be ready in a few weeks time. :) will need a few testers so will be offering a great discount to start with. Will keep you updated.
 

CdRsKuLL

Pedelecer
May 13, 2018
34
26
Bolton
lazylegs.co.uk
Good job! Can you please clarify the end result? Is the throttle output fully variable, or is it single speed, regulated by the current PAS level selection?

EDIT: Having re-read the thread and watched your video, it looks like you've achieved variable motor speed using the throttle output, but I'm struggling to figure out how. Isn't the controller PAS input just an on/off affair? If you're just varying the pulse timing on the PAS input, is the motor movement somewhat jerky as the continuous pulse signal is enabled/disabled?
Yep, it's a variable speed output. On the vengeance depending what assistance mode you're in defines the top speed. The high pushes it to 15mhp on the flat, about 10mph up hill. I've adding some smoothing so it doesn't jump off at the start to, incase you are creeping behind cars at lights etc..

You are correct, we are altering the pulse rate depending on your speed required, so half speed.. half throttle. On testing its just a continuous power rather than on / off jerk like when pedalling. I did find it unusal in the fact I didn't have anywhere to put my feet, didn't feel right just resting them on the pedals.. I did stick them out at one point wondering what it would be like putting stunt pegs on the front wheel and riding it chopper style. :)

I'll be doing a few more videos soon showing how it's all working and what people can expect.

Thanks

Steve
 

Advertisers