"Mini" Longboard - Little Board

New belt design done, this week i will send the pulleys and wheel to a machining shop, from the previous attempt I've learned that if you don't have the appropriate equipment, don't try

jfx8oo.jpg
 
cmatson said:
Your CAD work is just so freaking awesome

Thanks, now i have teared apart the motor and made everything, including the windings


UPDATE:
I've finished the remote, but forgot to the take pictures :roll:

But i also did my first ride today, amazing, climbing hill is an incredible feeling. Since i'm still waiting for VESC i decided to give the HK boat esc one more try, since i didn't test it with the torqueboards motor and the new drive train, it works, cogs sometimes and has absolutely no brakes, but was fun

Another think i have t improve is my skating skills, that are zero, i lacked stability and balls to test the maximum speed, but the acceleration is more than i hoped

vs2cy0.jpg


vykzv5.jpg
 
You got a wireless tx/rx module and an Arduino at both ends?
Is there any documentation for making your own controllers like this? Thanks!
 
NyOliver said:
You got a wireless tx/rx module and an Arduino at both ends?
Is there any documentation for making your own controllers like this? Thanks!

Exactly.

The remote consists of:
-Arduino nano
-Wii nun-chuck case with lots of internal supports cut off
-Wii nun-chuck original buttons and joystick
-5V voltage booster
-300mAh lipo (7h autonomy)
-Lipo charger board
-Nrf24l01 module

I didn't make any tutorial, but as soon i have VESC and finish the code i plan to post it with the respective credits from each part i took from other code, the electrical wiring is pretty straight forward, and the layout you can see in the pictures, the radio module is under the analog button

9bf5oz.jpg


2yzj4hi.jpg



Today did another ride, this time had the courage to go to max speed, amazing, but having no breaks is kind of scary, rode for about 45 min with the results bellow, only 24.5Wh, less than 1/10 of my battery, the distance something of 3 to 4km but hard to say

The bad thing which i need help is that my wheel pulley keeps getting of center, all the pieces are shop machined, but no matter how i tighten the screws or try to center, after the ride all is lost, the problem is that one position the belt tension is good and another very loose, one time it slipped

Another problem is that my current limiting algorithm is not working properly, it should have limited it to 26A, but got 42A, i think it is not limiting at all, and over stressing my battery, but since VESC is round the corner i will leave it this way

es9onl.jpg


33mvixf.jpg
 
Hey man,
Great little build!
I especially loved the remote.
I would really appreciate it if you could share the details:

On the Board
what are the parts
what connects to what
whats the code uploaded

On the remote:
full parts
connections
code

This would really help me,
Thanks a lot!
 
razad7@gmail.com said:
Hey man,
Great little build!
I especially loved the remote.
I would really appreciate it if you could share the details:

On the Board
what are the parts
what connects to what
whats the code uploaded

On the remote:
full parts
connections
code

This would really help me,
Thanks a lot!

As soon i have time i can make an electrical diagram, but for now:

Remote:
The battery is directly connected to the charger board, from there there is a micro H-H switch that powers the 5V voltage booster, which powers the arduino. In it is connected the 2 axis from the joystick, 2 push buttons (C and Z of the nun chuck), a LED and the radio module

Board:
the arduino is powered by the internal BEC of the ESC, in it connects the radio module and a PWM signal that goes to the ESC input, and also a current sensor that is used on the current control algorithm

Board with VESC(future):
Almost the same, take out the current sensor and the pwm output, the communications with VESC will be via UART, this way i can take advantage of the already present cruise control in the nun chuck app and ready real time status and send it to be displayed on the controller, and since i will have the Wh used, the remote will show a pretty accurate battery charge status. Also i plan to connect to the arduino front and rear lighting and turn signal, controlled by the X axis of the remote



Today i was ridding and lost the radio, no, not the signal, literally the radio, the Nrf module fell of the board, almost crushed it with the wheels, but even without it stooped working properly, receives signal but all mixed up, a new one is on the way, should be here by Thursday
 
Hey,
Thanks for the quick answer!
I'm sorry to hear about your accident, at least your healthy :)

parts i already have
- 2Xarduino nanos
- batteries and voltage control for 5V
- 2 X NRF24L01+

i don't have any current sensor
is this what you mean:
http://www.ebay.com/itm/ACS712-20A-range-Current-Sensor-Module-Module-for-Arduino-Raspberry-pi-/391320298485?hash=item5b1c81e3f5:g:NS8AAOxy7nNTTd4J
http://www.ebay.com/itm/Hot-New-ACS712-30A-range-Current-Sensor-Module-Arduino-module-New-design-/171910058485?hash=item2806a351f5:g:szEAAOSwnDZT8sTw
is 20A/30A enough?

if you do have time some day, to post a short manual on parts and what connects to what + the code it would be awesome.
keep up the good work
thanks
 
razad7@gmail.com said:
Hey,
Thanks for the quick answer!
I'm sorry to hear about your accident, at least your healthy :)

parts i already have
- 2Xarduino nanos
- batteries and voltage control for 5V
- 2 X NRF24L01+

i don't have any current sensor
is this what you mean:
http://www.ebay.com/itm/ACS712-20A-range-Current-Sensor-Module-Module-for-Arduino-Raspberry-pi-/391320298485?hash=item5b1c81e3f5:g:NS8AAOxy7nNTTd4J
http://www.ebay.com/itm/Hot-New-ACS712-30A-range-Current-Sensor-Module-Arduino-module-New-design-/171910058485?hash=item2806a351f5:g:szEAAOSwnDZT8sTw
is 20A/30A enough?

if you do have time some day, to post a short manual on parts and what connects to what + the code it would be awesome.
keep up the good work
thanks

Actually you don't need the current sensor, i used it to make a current control, versus the normal duty cycle control, and to limit the current draw of my battery, but if you use a lipo with a high C rate, or a ESC with current limit built in you are good to go, and besides, since the code for it isn't working, it is just siting there
 
razad7@gmail.com said:
Alright, so it seems i have all the parts.
but i'm confused, what code did you use on the arduinos for the control?

This is the remote part, the board is a few posts behind, but again, it doesn't work as intended, i will make a new one to interface with VESC

It send the status of the two joysticks and 2 push buttons and display the remote battery capacity with the led as soon it powers on, 4 blinks (100-80%), 3 blinks (80-60%), 2 blinks (60-40%), 1 blink (40-20%), Also if in use, fading slow constantly (20-10%), fading fast (10-2%), blinking fast (<2%, means you have to shut down to avoid over discharging the battery)

Sorry, its not fully comment yet and most parts in Portuguese, but should be easy to understand

Code:
//Parametros leituras_botoes

int joystick_y, joystick_x;  //valores joystick
int joystick_y_pin = 2;      //pino joy y
int joystick_x_pin = 1;      //pino joy x
bool button_c, button_z;     //estados botoes
int button_c_pin = 8;        //pino bot c
int button_z_pin = 7;        //pino bot z

//Parametros estado_bateria

int n_medicoes = 30;
int fator_cor = 97.0;
int bat_mv;      //valores bateria
int bat_pct;                 //valores bateria
int bat_pin = 3;             //pino bateria
int bat_full = 4200;         //tensao cheia
int bat_empty = 3600;        //tensao vazio
int k;
bool estado_bateria1 = 0;
bool estado_bateria2 = 0;
bool estado_bateria3 = 0;

//Parametros LED

int led_pin = 6;              //pino led
int time = 0;
int periode20 = 2000;
int periode10 = 400;
int ledState = 0;
int previoustime = 0;
int power_on = 1;
int time_on = 600;

//Parametros radio

#include <SPI.h>
#include "RF24.h"

const uint64_t pipe = 0xE8E8F0F0E1LL;

RF24 radio(9, 10);

boolean sendOK = false;

struct remotePackage {
  int		valXJoy;
  int		valYJoy;
  boolean	valCbutton;
  boolean	valZbutton;
} ;

remotePackage remPack;

void setup() {

  //configura pinos dos botoes como input

  pinMode(button_c_pin, INPUT);
  pinMode(button_z_pin, INPUT);

  //ativa o resistor pull-up interno

  digitalWrite(button_c_pin, HIGH);
  digitalWrite(button_z_pin, HIGH);

  //Configura LED

  pinMode(led_pin, OUTPUT);

  //configura radio
  Serial.begin(115200);

  radio.begin();
  radio.enableAckPayload();
  radio.enableDynamicPayloads();
  radio.openWritingPipe(pipe);
}

void loop() {

  leituras_botoes();  //Chama a função de leitura dos botoes

  estado_bateria();   //Chama a função de estado da bateria

  controle_led();      //Chama a função de controle do led

  radio_controle();   //Chama a função de controle do rádio

  debug();            //Chama a função de debug
}

void leituras_botoes() {

  //realiza leitura do joy e but

  joystick_y = analogRead(joystick_y_pin);
  joystick_x = analogRead(joystick_x_pin);
  button_c = digitalRead(button_c_pin);
  button_z = digitalRead(button_z_pin);
}

void estado_bateria() {

  //Le a tensão da bateria e calcula a porcentagem equivalente

  bat_mv = 0;
  for ( k = 0 ; k <= n_medicoes; k++ ) {
    bat_mv = analogRead(bat_pin) + bat_mv;
  }

  bat_mv = (bat_mv / n_medicoes) * (5000.0 / 1023.0) * (fator_cor / 100.0);
  bat_pct = map(bat_mv, bat_empty, bat_full, 0, 100);
}

void controle_led() {

  if (power_on == 1) {
    time = millis();
    previoustime = time;
    while (ledState < 61) {
      time = millis();
      if (time - previoustime >= 10) {
        ledState = ledState + 1;
        previoustime = time;
      }
      analogWrite(led_pin, ledState);
    }
    delay(500);
    if (bat_pct >= 80 ) {
      time = millis();
      while (time < 5 * time_on) {
        time = millis();
        analogWrite(led_pin, 31 + 30 * cos(2 * PI / time_on * time));
      }
    }
    if (bat_pct < 80 && bat_pct >= 60 ) {
      time = millis();
      while (time < 4 * time_on) {
        time = millis();
        analogWrite(led_pin, 31 + 30 * cos(2 * PI / time_on * time));
      }
    }
    if (bat_pct < 60 && bat_pct >= 40 ) {
      time = millis();
      while (time < 3 * time_on) {
        time = millis();
        analogWrite(led_pin, 31 + 30 * cos(2 * PI / time_on * time));
      }
    }
    if (bat_pct < 40 && bat_pct >= 20 ) {
      time = millis();
      while (time < 2 * time_on) {
        time = millis();
        analogWrite(led_pin, 31 + 30 * cos(2 * PI / time_on * time));
      }
    }
    power_on = 0;
  }

  if (bat_pct < 20) {
    estado_bateria1 = 1;
  }
  if (bat_pct < 10) {
    estado_bateria2 = 1;
  }
  if (bat_pct < 2) {
    estado_bateria3 = 1;
  }
  if (bat_pct > 30) {
    estado_bateria1 = 0;
    estado_bateria2 = 0;
    estado_bateria3 = 0;
  }

  if (estado_bateria1 == 0) {
    analogWrite(led_pin, 61);
  }
  else if (estado_bateria3 == 1) {
    time = millis();
    if (time - previoustime >= periode10) {
      previoustime = time;
      if (ledState >= 61) {
        ledState = 0;
      } else {
        ledState >= 61;
      }
      previoustime = time;
    }
    analogWrite(led_pin, ledState);
  }
  else if (estado_bateria1 == 1 && estado_bateria2 == 1) {
    time = millis();
    analogWrite(led_pin, 31 + 30 * cos(2 * PI / periode10 * time));
  }
  else if (estado_bateria1 == 1 && estado_bateria2 == 0) {
    time = millis();
    analogWrite(led_pin, 31 + 30 * cos(2 * PI / periode20 * time));
  }
}

void radio_controle() {
  remPack.valXJoy = map(joystick_x, 0, 1023, 0, 255);
  remPack.valYJoy = map(joystick_y, 0, 1023, 0, 255);
  remPack.valCbutton = !button_c;
  remPack.valZbutton = !button_z;
  //send data via radio to RX
  sendOK = radio.write( &remPack, sizeof(remPack) );
}

void debug() {
  Serial.print("Tensão Bateria: ");
  Serial.print(bat_mv);
  Serial.print(" mV, Porcentagem Bateria: ");
  Serial.print(bat_pct);
  Serial.print(" %, Joystick X: ");
  Serial.print(joystick_x);
  Serial.print(", Joystick Y: ");
  Serial.print(joystick_y);
  Serial.print(", Botão C: ");
  Serial.print(button_c);
  Serial.print(", Botão Z: ");
  Serial.print(button_z);
  Serial.print(" ");
  Serial.print(estado_bateria1);
  Serial.print(" ");
  Serial.print(estado_bateria2);
  Serial.print(" ");
  Serial.print(estado_bateria3);
  Serial.print('\n');
}
 
Small Update

Problem: With the torque, the wheel deform and the belt slip, no matter how tight

Solution: Cut away 30 mm of the aluminum part of the truck, put 3 608 bearings inside the pulley and 9 washers to get the correct spacing

Problem solved :lol:

And by my calculations i'm getting 3.9wh/km, but i'm a bit suspicious of this number, this mean almost 60 km from my battery pack
 
Maybe you should also stick in OLED in the controller too. Just throwing it out there, I'm sure for a coder getting real time current and voltage plus mileage should be pretty easy out of a VESC.
 
NyOliver said:
Maybe you should also stick in OLED in the controller too. Just throwing it out there, I'm sure for a coder getting real time current and voltage plus mileage should be pretty easy out of a VESC.

That's in the plans :D

The problem is space and power consumption, the battery is pretty small and would considerably decrease the running time, for now i think i will in some way use the existing led to get info on the board battery, but using the Wh info from VESC to compute it, and maybe put a OLED under the board showing things like energy used, distance, total distance, total wh, running time, time since last betl change, etc

This decks ends here, i'm a few days away from holidays and will start building a new on with almost the same footprint, but evething hidden inside
 
Back
Top