Search results

  1. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    amended code: // Experimenting v6 // PAS Cadence Input Pin - D2 (Digital) // PAS Torque Input Pin - A3 (Analog) // Throttle Input Pin - A0 (Analog) // Controller Cadence Output Pin - D13 (Digital) // Controller Torque Output Pin - A5 (Analog)// Experimenting const byte ThrottlePin = A0...
  2. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    how to set pastorque to 3.5V if you stop pedalling: // Experimenting v5 // PAS Cadence Input Pin - A2 (Analog) // PAS Torque Input Pin - A3 (Analog) // Throttle Input Pin - A0 (Analog) // Controller Cadence Output Pin - D13 (Digital) // Controller Torque Output Pin - A5 (Analog) int pulseoff =...
  3. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    So to remove error 21, the controller expects to see 3.3V now and then when the motor isn't running. I'll post updated code a little later.
  4. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    yes, I think you are right on this. Let's test this line: analogWrite(A5, analogRead(A3)/4); change it to: analogWrite(A5, 75 + analogRead(A3)/4);
  5. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    that's good, we are nearly there. did you see any error? assuming there was no error, let's run this code to start the motor in pedal mode: analogWrite(A5, analogRead(A3)/4); // replicate torque input, analogRead 10-bit. analogWrite 8-bit. // Experimenting // PAS Cadence Input Pin - D2...
  6. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    thank you for that, can you amend A0 to A2 on this line: if (analogRead(A2) < 500) digitalWrite(LED_BUILTIN, LOW); // Experimenting // PAS Cadence Input Pin - D2 (Digital) // PAS Torque Input Pin - A3 (Analog) // Throttle Input Pin - A0 (Analog) // Controller Cadence Output Pin - D13...
  7. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    when the voltage on A2 is low (1,15V), is the arduino LED off? when the voltage on A2 is high (3,8V), is the arduino LED on?
  8. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    No blinking means the arduino does not see changes on pin A2. It should not matter that the LCD shows error 21, the cadence input should still shows that you turn the cranks. can you check with a multitester if the voltage on A2 cycles between 0V and 4V when you rotate the cranks very slowly?
  9. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    did the arduino LED blink when you turn the cranks?
  10. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    did you connect cadence input to A2?
  11. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    did your throttle work before error 21 shows up? also, could you run this test to help me figure out where the error comes from? note: connect cadence input to A2. The reason is we need to be sure we can debounce the signal if needed. // Experimenting // PAS Cadence Input Pin - D2 (Digital) //...
  12. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    can you post your wiring and code?
  13. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    yes, I think you are right on this. analogWrite(A5, analogRead(A3)); Change to: analogWrite(A5, analogRead(A3)/4); also: analogWrite(A5, torqueval); change to: analogWrite(A5, torqueval /4);
  14. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    yes, it can be removed by simply supressing the cadence: if (analogRead(A2) > cadence_threshold) digitalWrite(LED_BUILTIN, HIGH); else digitalWrite(LED_BUILTIN, LOW); change to: digitalWrite(LED_BUILTIN, LOW); could you let me know the test result?
  15. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    yes, there was one ) too many. I amended it and thank you for testing that code. Can you test the last working version but with lower cadence? int pulseoff = 150; // milliseconds when synthesised cadence is low int pulseon = 100; // pulse low - cadence reduced to 4Hz I try to figure out why...
  16. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    Raj, I reduced the frequency of the cadence from 6Hz to 4Hz to see if error 22 gets shifted to lower speed accordingly.
  17. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    not sure. Try changing the formula first. Error 22 may come from the fact that the controller knows the speed of the bike, your code doesn't, so you may have to add a procedure to gracefully exit the throttle. Can you test the new formula for me? Run this code: Code: // Experimenting // PAS...
  18. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    thank you for that. 1.5V = 1024*1.5/5=308 4.3V = 102 * 4.3/5 = 880 A5 needs to be set between those two values when the throttle is in use. Rajestailor experimentally determined that the throttle signal range is 290-577, to map this range to 309-880, Raj needs this formula: x = 308 + y *...
  19. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    can you remind me the output voltage range of the torque sensor? The arduino analog range value is 0-1023, 1023=5V so the maximum torqueval needs to be reduced not to cause error 22.
  20. Woosh

    How to add a throttle to a Carrera Vengeance E Spec

    you may need to add a procedure to your code to gracefully exit the throttle part and stop that error 22. Let's try this first: replace: torqueval = torqueval + torqueperc; with: torqueval = 76 + torqueperc; or use my formula.