Cov txheej txheem:

Yooj Yim Tshaj Plaws Arduino VESC Saib: 4 Kauj Ruam
Yooj Yim Tshaj Plaws Arduino VESC Saib: 4 Kauj Ruam

Video: Yooj Yim Tshaj Plaws Arduino VESC Saib: 4 Kauj Ruam

Video: Yooj Yim Tshaj Plaws Arduino VESC Saib: 4 Kauj Ruam
Video: qhia siv progame update driver 2024, Kaum ib hlis
Anonim
Yooj Yim Tshaj Plaws Arduino VESC Monitor
Yooj Yim Tshaj Plaws Arduino VESC Monitor

Nyob zoo, hauv txoj haujlwm no peb yuav ua tus saib xyuas VESC yooj yim. Qhov no yuav muaj txiaj ntsig thaum koj xav tshuaj xyuas koj qhov kub thiab nrhiav teeb meem zoo li kuv tau nrog kuv lub Vesc overheating (uas kuv pom tawm tsuas yog nrog lub ntsuas no) lossis koj tuaj yeem siv nws yooj yim rau txuas cov zaub rau koj lub rooj tsavxwm lossis tus tuav tes thiab saib koj qhov nrawm, mais, roj teeb feem pua thiab ntau ntxiv. Yog li cia peb mus rau hauv tsev!

Kauj Ruam 1: Qhov Chaw

Qhov
Qhov
Qhov
Qhov

1. - Arduino (Kuv tab tom siv UNO tab sis koj tseem tuaj yeem siv lwm lub rooj tsavxwm suav nrog esp8266 lossis esp32)

2. - qee qhov txuas rau txuas (sim nrhiav qhov txuas rau koj tus txuas rau vesc vim tias nws yuav yooj yim dua rau tshem tawm 1 qhov txuas loj vs. ntau ntawm cov kab me me)

3. - zaub (Kuv siv 124 x 32 Oled tab sis koj tuaj yeem siv lwm yam los ntawm kev hloov lub tsev qiv ntawv)

4. - xaiv tau - lub thawv ntawv (qhov no yog rau cov neeg uas tsis xav tau cov laug los yog rau cov uas xav ua nws ib ntus)

5. - USB cable rau koj arduino

Kauj Ruam 2: Txuas Qhov Chaw Ua Ke

Txuas Txuas Ua Ke
Txuas Txuas Ua Ke
Txuas Txuas Ua Ke
Txuas Txuas Ua Ke
Txuas Txuas Ua Ke
Txuas Txuas Ua Ke

zaub: Vcc rau 3.3V

Gnd rau Gnd

Sck (lossis scl) rau A5

S4 to AW

VESC: 5V los ntawm Vesc rau Vin ntawm Arduino

Gnd rau Gnd

RX ntawm VESC rau TX ntawm Arduino

TX ntawm VESC rau RX ntawm Arduino

Kauj Ruam 3: Tshaj Tawm thiab Hloov Kho Txoj Cai rau Qhov Koj Nyiam

CODE:

/** 2020 tus lej los ntawm Lukas Janky VESC saib nrog Oled zaub Yog tias koj xav tau nug kuv dab tsi, hu rau kuv ntawm [email protected] lossis ntawm kuv cov lus qhia. Kuv vam tias qhov no yuav pab koj.

*/

#include #include #include #include #include #include #include #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 #define OLED_RESET 4 Adafruit_SSD1306 zaub (SCREEN_WIDTH, SCREEN_HEIGHT, & Hlau, OLED_RESET);

VescUart UART;

ib rpm;. ntab voltage; ntab tam sim no; int zog; ntab amphour; ntab ntab; ntab nrug; ntab tshaj tawm; float koj; ntab batpercentage;

SimpleKalmanFilter Filter1 (2, 2, 0.01);

void teeb tsa () {

Serial.begin (115200); display.begin (SSD1306_SWITCHCAPVCC, 0x3C); display.fillScreen (0); display.display ();

/ ** Teeb UART chaw nres nkoj (Serial1 ntawm Atmega32u4)*/ // Serial1.begin (19200); thaum (! Serial) {;}

/ ** Txhais qhov chaw nres nkoj twg los siv ua UART*/ UART.setSerialPort (& Serial);

}

void voj () {

////////// Nyeem qhov tseem ceeb ////////// yog (UART.getVescValues ()) {

rpm = (UART.data.rpm)/7; // Tus '7' yog tus naj npawb ntawm tus ncej nyob hauv lub cav. Cov motors feem ntau muaj 14 tus ncej, yog li ntawd 7 tus ncej khub voltage = (UART.data.inpVoltage); tam sim no = (UART.data.avgInputCurrent); hwj chim = voltage*tam sim no; amphour = (UART.data.ampHours); watthour = amphour*qhov hluav taws xob; tach = (UART.data.tachometerAbs)/42; // Tus '42' yog tus naj npawb ntawm lub cev muaj zog ncej sib npaug 3 nrug = tach*3.142*(1/1609)*0.72*(16/185); // Motor RPM x Pi x (1/ meters in a mile or km) x Log diameter x (motor pulley/ wheelpulley) nrawm = rpm*3.142*(60/1609)*0.72*(16/185); // Tsav RPM x Pi x (vib nas this hauv ib feeb / meters hauv ib mais) x Log txoj kab x (lub cev muaj zog rub / lub log log) batpercentage = ((voltage-38.4) / 12)*100; // ((Roj teeb hluav taws xob - qhov tsawg kawg nkaus voltage) / tus naj npawb ntawm cov cell) x 100

}

////////// Lim ////////// // xam tus nqi kwv yees nrog Kalman Lim ntab powerfiltered = Filter1.updateEstimate (lub zog);

display.fillScreen (0); display.setCursor (10, 5); display.setTextColor (1); display.setTextSize (1); display.print (qhov hluav taws xob);

display.setCursor (10, 20); display.setTextColor (1); display.setTextSize (1); display.print (hwj chim);

display.setCursor (10, 40); display.setTextColor (1); display.setTextSize (1); display.print (rpm);

display.setCursor (10, 55); display.setTextColor (1); display.setTextSize (1); display.print (tam sim no); display.display ();

ncua (50);

}

Koj tuaj yeem hloov kho thiab tso tawm ib qho txiaj ntsig los ntawm cov cai uas koj xav tau

Kauj Ruam 4: Txheeb Xyuas Yog Nws Ua Haujlwm

Kuaj Yog Nws Ua Haujlwm
Kuaj Yog Nws Ua Haujlwm
Kuaj Yog Nws Ua Haujlwm
Kuaj Yog Nws Ua Haujlwm
Kuaj Yog Nws Ua Haujlwm
Kuaj Yog Nws Ua Haujlwm

Tam sim no thaum koj txheeb xyuas seb nws puas ua haujlwm yog lub sijhawm rau siv nws thiab ntxiv cov ntawv lo rau koj qhov txiaj ntsig zoo li Volts lossis Amps. Solder nws ntawm arduino nano yog li nws yuav me dua lossis koj tseem tuaj yeem xa nws nrog lwm cov arduino rau koj lub chaw taws teeb tswj. tab sis rau qhov ntawd muaj ntau lwm yam kev qhia (tshawb nrhiav qhov tseem ceeb nrog arduino). Kuv vam tias qhov no tau pab koj daws koj cov teeb meem lossis ua kom zoo me me vesc telemetry.

Pom zoo: