Parameters

P1 Motor Characteristic Parameter Setting


The transmission ratio for motors with a reduction gear. This is important in order to calculate the correct speed as the motor and the wheel rotate at different speeds. The value is a ratio between 1-255.


P2 Wheel Speed Pulse Signal Setting

the frequency of the hall sensor signal per revolution, important for determining the speed and position of the motor. The most common values are 1 and 6, 0 disables sensor reading.


P3 Power Assist Control Setting

the relationship between the throttle and the level of cranking assistance. At 0, the crank assist level determines how much the bike accelerates when the throttle is pressed. Setting to 1 makes the throttle switch work regardless of crank assist level.


P4 Throttle Start-Up Setting

by setting the value to 0, it is possible to start from the spot only by pressing the throttle. With a value of 1, the controller only allows the throttle to be used if the motor is already activated (by cranking or moving).


P5 Power Monitoring Setting

determines the way the current capacity of the battery is displayed (discharge curve).


C1 Throttle Start-Up Setting

crank assist setup, depending on the sensor and the magnets attached to the crank, it is necessary to find the right combination that is compatible with your sensor.

C2 Motor Phase Classification Coding Mode

 determines how the motor phases are wound, if the wheel vibrates and does not rotate

 


C3 Power Assist Ratio Gear Initialization

determines the level of cranking assistance selected by default when the bike is turned on. 1 is the weakest and 5 is the most powerful.


C4 Handlebar Function Setting

the function depends on what value you set for parameter P4


C5 Handlebar Function Setting

sets the maximum power output for the controller. For example, a 30 amp controller with a C5 value of 3 will only operate at 15 amps.

.


C6 Handlebar Function Setting

LCD backlight strenght 1 – 6

C7 Cruise Function Setting

value 1 enables cruise control, 0 disables this option. To use the cruise control, drive with the throttle at a speed of about + 15km/h, keep the throttle active in one position and at the same time press and hold the up arrow. After a few seconds, the letter C or the yellow text Cruise will appear on the screen. The cruise control is automatically disengaged when you crank a few revolutions, momentarily press down on the throttle, or press down on the brake lever equipped with a brake switch.


C8 Motor Operating Temperature Display Setting

value 1 turns on the engine temperature display.


C9 Startup Password Setting

password setting. 1 turns on the use of the password, after saving the value, the user is asked for the password number 0 – 999. NB!!! In case you forget the password, to unlock the device you have to use the same type of display that can be used to delete or replace the password, all other parameters will also be replaced.


C10 Restore Default Setting

restores the default settings, the controller may not work correctly with components after that.


C11 Meter Attribute Setting

defines the communication protocol used between the controller and display, modification of this parameter should be avoided.


C12 Controller Minimal Voltage Setting

determines the minimum allowable voltage. If the battery voltage falls below this value, even for a moment, the motor switches off.


C13 ABS Brakes and Anti-Charge Control Setting

motor braking and charging. A relatively risky parameter. With a value of 0, there is no motor braking. A value of 1 is the weakest and most effective way to regain energy. NB! On long descents, there have been several cases where various components (mainly the controller or the battery) have overheated and been damaged due to heavy loads

.
C14 Power Assist Tuning Setting

cranking assist power. 1 – weak, 2 – medium, 3 – strong

 

var dimension = 20;
var maxspeed = 60 - 10;
var P1 = 86;
var P2 = 0;
var P3 = 1;
var P4 = 0;
var P5 = 1;
var C1 = 6;
var C2 = 0;
var C3 = 5;
var C4 = 4;
var C5 = 4;
var C7 = 1;
var C12 = 2;
var C13 = 1;
var C14 = 2;
var percent = 50;
var hb_speed = 50; //handle bar max speed
var cadence = 12;           


var p2 = "0x" + (P2.toString(16)).toUpperCase();
        var p3 = "0x" + (P3.toString(16)).toUpperCase();
        var p4 = "0x" + (P4.toString(16)).toUpperCase();          
      

arrayData = new Array(13    );
    function b2b4(dimension, p2, p3, p4, maxspeed) {
       
        var dimension;
        var _dimension;
        var dimensionHex;
        var code;
        if (dimension < 10) {
            code = 0;
            dimensionHex = "0x" + (dimension.toString(16)).toUpperCase();
            dimension = dimensionHex;
        }
        else {
            code = 1;
            _dimension = dimension - 10;
            dimensionHex = "0x" + (_dimension.toString(16)).toUpperCase();
            dimension = dimensionHex;
        };    
        var limitSpeed;
        if (maxspeed <= 31) {
            limitSpeed = 0x0;
            var speed = maxspeed;
            var speedHexStr = "0x" + (speed.toString(16)).toUpperCase();
            var speedHex = void 0;
            speedHex = speedHexStr << 3;
            arrayData[2] = speedHex + dimension * 1; //限速+轮径
            if (dimension.code == 1) {
                var expand = 0x80;
                arrayData[4] = (p2 * 1) + (p3 << 3) + (p4 << 4) + limitSpeed + expand; // p2+p3+p4+限速+轮径拓展
            }
            else {
                var expand = 0x0;
                arrayData[4] = (p2 * 1) + (p3 << 3) + (p4 << 4) + limitSpeed + expand; // p2+p3+p4+限速+轮径拓展
            }
            // code = 0 轮径不需要扩展  code = 1 需要扩展
            // SETTINGS_MAX_SPEED < 31 限速不需要扩展
            //this.arrayData[4] = 0x28;
        }
        if (maxspeed >= 32 && maxspeed <= 63) {
            limitSpeed = 0x20;
            var speed = maxspeed - 32;
            if (speed == 0) {
                arrayData[2] = 0x5; //限速+轮径
            }
            else {
                var speedHexStr = "0x" + (speed.toString(16)).toUpperCase();
                var speedHex = void 0;
                speedHex = speedHexStr << 3;
                arrayData[2] = speedHex + dimension * 1; //限速+轮径
                if (dimension.code == 1) {
                    var expand = 0x80;
                    arrayData[4] = (p2 * 1) + (p3 << 3) + (p4 << 4) + limitSpeed + expand; // p2+p3+p4+限速+轮径拓展
                }
                else {
                    var expand = 0x0;
                    arrayData[4] = (p2 * 1) + (p3 << 3) + (p4 << 4) + limitSpeed + expand; // p2+p3+p4+限速+轮径拓展
                }
                // code = 0 轮径不需要扩展
                // SETTINGS_MAX_SPEED < 31 限速不需要扩展
            }
        }
       
    };

    function p1() {
        if (P1) {
            var p1HexStr = P1.toString(16).toUpperCase();
            var p1Hex = p1HexStr * 1;
            arrayData[3] = p1Hex;
           
        }
    };
   
    function p5() {
        if (P5) {
            var p5HexStr = P5.toString(16).toUpperCase();
            var p5Hex = p5HexStr * 1;
            arrayData[0] = p5Hex;
           
        }
    };
   
    function c1c2() {
            var c1HexStr = C1.toString(16).toUpperCase();
            var c1Hex = c1HexStr * 1;
            var c2HexStr = C2.toString(16).toUpperCase();
            var c2Hex = c2HexStr * 1;
            arrayData[6] = (c1Hex << 3) + (c2Hex);
    };

    function c3() {
       
        if (C3) {
            C3 = C3 * 1;
            if (C3 <= 5) {
                switch (C3) {
                    case 1:
                        arrayData[1] = gear = 0x01;
                        break;
                    case 2:
                        arrayData[1] = gear = 0x02;
                        break;
                    case 3:
                        arrayData[1] = gear = 0x03;
                        break;
                    case 4:
                        arrayData[1] = gear = 0x04;
                        break;
                    case 5:
                        arrayData[1] = gear = 0x05;
                        break;
                    default:
                        arrayData[1] = gear = 0x05;
                        break;
                }
            }
            }
         
    };
   
    function c5c14() {
        if (C5 && C14) {
            var c5HexStr = C5.toString(16).toUpperCase();
            var c5Hex = c5HexStr * 1;
            var c14HexStr = C14.toString(16).toUpperCase();
            var c14Hex = c14HexStr * 1;
            arrayData[7] = (c14Hex << 5) + (c5Hex);
           
        }
    };
   
    function c4c7c12() {
        if (C4 && C7 && C12) {
            var c4HexStr = C4.toString(16).toUpperCase();
            var c4Hex = c4HexStr * 1;
            var c7HexStr = C7.toString(16).toUpperCase();
            var c7Hex = c7HexStr * 1;
            var c12HexStr = C12.toString(16).toUpperCase();
            var c12Hex = c12HexStr * 1;
            arrayData[8] = (c4Hex << 5) + (c7Hex << 3) + c12Hex;
           
        }
    };
   
    function perc() {
        if (percent) {
            var percentHexStr = percent.toString(16).toUpperCase();
            var percentHex = percentHexStr * 1;
            arrayData[11] = percentHex;
           
        }
    };
   
    function handlebar() {
        if (hb_speed) {
            var HexStr = hb_speed.toString(16).toUpperCase();
            var Hex = HexStr * 1;
            arrayData[9] = Hex;
        }
    };
   
   function c13() {
        if (C13) {
            var c13HexStr = C13.toString(16).toUpperCase();
            var c13Hex = c13HexStr * 1;
            arrayData[10] = c13Hex << 2;
        }
    };

    b2b4(dimension, p2, p3, p4, maxspeed);
    p1();
    p5();
    c1c2();
    c3();
    c5c14();
    c4c7c12();
    perc();
    handlebar();
    c13();
    arrayData[5] = arrayData[1] ^ arrayData[2] ^ arrayData[3] ^ arrayData[4] ^ arrayData[6] ^ arrayData[7] ^ arrayData[8] ^ arrayData[9] ^ arrayData[10] ^ arrayData[11];
    console.log(arrayData.toString(16))

 

(arrayData.toString(16))