May 30, 20187 yr 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. 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.. 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). // 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. 3D printed Arduino Nano temp case Steve Edited May 30, 20187 yr by CdRsKuLL
May 30, 20187 yr Could never dream of doing the coding bit:confused:, but the rest is really straight forward-nice one and thanks for sharing it:)
May 30, 20187 yr Author 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
May 30, 20187 yr 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;)
May 30, 20187 yr Author 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
May 30, 20187 yr 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
May 30, 20187 yr 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...
May 30, 20187 yr Author 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.
May 30, 20187 yr I have the 250 on my road bike and had the 350 on my off road bike the controller appears the same neither get hot
June 1, 20187 yr Author 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.
June 1, 20187 yr 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
June 4, 20187 yr Thanks for sharing this code and info. You must have read my mind. Now to see my son about the code.
June 24, 20187 yr Author 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. 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
June 27, 20187 yr Steve, Any chance of getting a throttle kit for carerra valcun and crossfire? Also can this also de-restrict the bike? Regards, Gaurav
June 27, 20187 yr 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? Edited June 27, 20187 yr by danielrlee
June 27, 20187 yr Author 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.
June 27, 20187 yr Author 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
June 27, 20187 yr Author Superb job, good luck with business venture. Thanks :-) much appreciated. It's never going to make millions but hopefully will get me some beer tokens.. Steve
June 27, 20187 yr You are correct, we are altering the pulse rate depending on your speed required, so half speed.. half throttle. Thanks for your reply. So, just to confirm, does the standard (unmodified) PAS behavior on the Carrera Vengeance vary the motor power with pedal cadence?
June 27, 20187 yr Will this (or any other kit you are working on) derestrict the Crossfire-e ? I'm not interested in using a throttle but would like to get another 3-4 mph top speed. If you could do that, then you would sell hundreds of them
June 27, 20187 yr Author Thanks for your reply. So, just to confirm, does the standard (unmodified) PAS behavior on the Carrera Vengeance vary the motor power with pedal cadence? Yes, I think it does. It all depends on how fast you pedal it seems. I'm outputting pulses from 600ms to 40ms which seems to cover the full range.. The Vulcan / Crossfire will require a double pulse which will be slightly faster due to the opto(s) vs hall sensor arrangement. Steve
June 27, 20187 yr Author Will this (or any other kit you are working on) derestrict the Crossfire-e ? I'm not interested in using a throttle but would like to get another 3-4 mph top speed. If you could do that, then you would sell hundreds of them At the moment it does not derestrict it, this is because of the direct drive which will either require something to sit in between the motor wires OR developing a different replacement controller, which may be a possibility. (derestrict/throttle) but that's a bit in the future at the moment. Thanks, Steve
June 28, 20187 yr Yes, I think it does. It all depends on how fast you pedal it seems. I'm outputting pulses from 600ms to 40ms which seems to cover the full range.. The Vulcan / Crossfire will require a double pulse which will be slightly faster due to the opto(s) vs hall sensor arrangement. SteveOkaaaaay, that makes way more sense. I assumed that it was a standard cadence PAS behaviour where the pedal cadence does not affect the motor output and couldn't figure out the mechanism you were using to send a variable signal to the controller. Double kudos to you in that case and the best of luck for the project in the future.
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.