ES100 no throttle

PTbig
Posts: 2
Joined: Fri Mar 27, 2020 11:37 pm

ES100 no throttle

Postby PTbig Fri Mar 27, 2020 11:51 pm

Good night.
I'm trying to use an okai F350 (ES100) scooter, with an Arduino I got the display and lights to work. If you rotate the engine on the display, the speed will appear. But the engine does not respond to the accelerator. The code I am using on Arduino is as follows:

Code: Select all

#include <Arduino.h> int PIN_SWITCH_1 = 13; int powerPin = LED_BUILTIN; byte messageOff[] = {0xA6, 0x12, 0x02, 0x90, 0x01, 0x42}; //If the scooter is on turn it off. byte messageA[] = {0xA6, 0x12, 0x02, 0x10, 0x14, 0xCF}; // MAKES HEADLIGHT BLINK CODE BEFORE STARTUP byte messageC[] = {0xA6, 0x00, 0x00, 0xF5, 0xFF, 0xFC}; // LIGHT ON & ESC ON & KPH & MAX SPEED & BLINK OFF & TURBO ON & FAST GAZ void setup() { Serial.begin(9600); pinMode (PIN_SWITCH_1, OUTPUT); pinMode(powerPin, OUTPUT); digitalWrite(powerPin, HIGH); Serial.write(messageOff, sizeof(messageOff)); delay(500); Serial.write(messageC, sizeof(messageC)); } void loop() { delay(500); Serial.write(messageC, sizeof(messageC)); }
How can I get the throttle to work?
Is it possible to put the firmware of another scotter in this, by JTAG? Example (Ninebot, xiaomi)

Best regards
PTbig
Posts: 2
Joined: Fri Mar 27, 2020 11:37 pm

Re: ES100 no throttle

Postby PTbig Wed Apr 22, 2020 8:42 pm

I finally got the accelerator to work :D


The Code I used is:
{0xA6, 0x12, 0x02, 0x35, 0x14, 0xF1}; // Speed Limit
{0xA6, 0x12, 0x02, 0x35, 0xFF, 0x38}; // Maximum Speed


In the first day I did 12km without any problem.
On the 2nd day I did 8 km without any problem.
Today after a long descent, and stopping to keep up the speed the ESC burned. :'(

Anyone with an extra ESC?

Best Regards
eliottt
Posts: 2
Joined: Sat Jul 24, 2021 10:24 am

Re: ES100 no throttle

Postby eliottt Sat Jul 24, 2021 10:31 am

Hello,

byte 4 and 5 are usfull.

BYTE 4:

bit0: Bird ON (fill speed)
bit 1: Blink light
bit 2: ??
bit 3: Light ON
bit 4: ??
bit 5: Limit to 28 km/h
bit 6: Limit to 25 km/h
bit 7: Limit to 18 km/h
bit 8: ??

BYTE 5:

bit 0: Display: km/h

For example:

ON: {0xA6, 0x12, 0x02, 0x01, 0x01, CRC}
ON & LIGHT: {0xA6, 0x12, 0x02, 0x05, 0x01, CRC}
ON & LIGHT & SPEED LIMIT: {0xA6, 0x12, 0x02, 0x15, 0x01, CRC}

C code example with CRC calculation:

unsigned char dallas_crc8(char * data, const unsigned int size)
{
unsigned char crc = 0;
for ( unsigned int i = 0; i < size; ++i )
{
unsigned char inbyte = data;
for ( unsigned char j = 0; j < 8; ++j )
{
unsigned char mix = (crc ^ inbyte) & 0x01;
crc >>= 1;
if ( mix ) crc ^= 0x8C;
inbyte >>= 1;
}
}
return crc;
}

void message(uint8_t byte3)
{
char buf[] = {0xA6, 18, 2, byte3, 0xFF, 0x00};
char crc = dallas_crc8(buf, 5); //CRC-8 MAXIM Check Sum Calculator
buf[5] = crc;
WRITE_UART(buf,6);
}

void on(void)
{
message(0x01);
}

void off(void)
{
message(0x00);
}

But ES100 (YL-ES100-0926) doesn't stay powered on for more than one minute, this code is not enought.

Return to “Okai / Electisan”

Who is online

Users browsing this forum: No registered users and 10 guests