"Mini" Longboard - Little Board

Pedrodemio

100 W
Joined
Jun 30, 2015
Messages
115
Location
Brazil
Hello guys,

first i would like to thank you all members, i've spend my last months here reading a lot, started with the project of a e-bike, ordered all pieces for it but then discovered the electric skates, equally fun to a normal bike in the weekends i a lot less prone to robbery since for commuting in week days i can take it inside the classes

i'm in the process of building my first e board, more the details in the coming days, just a render for now, i already have most of the parts, the deck is almost ready, in the moment i'm programming the arduinos that will control (hopefully) everything, and i also pretend still in this week cut the motor mount and take it to be welded

b4c5s2.png


Cheers
 
Cool man, should be fun to ride.

So It looks like your motor is mounted from the back, Boosted boards did this originally, then they changed it, So maybe there was an issue with mounting it backwards?

Maybe do some testing on the reverse mount variation before you commit too many $$
 
psychotiller said:
Love it. The render looks awesome.

Thanks


torqueboards said:
Nice setup! How big is the board going to be? I still want to make a real small deck.

Would be perfect to go to the gym with something like a 29" or 30" at most.

It will be 60cm/23,5", very small compared to most boards, took my inspiration from here https://www.indiegogo.com/projects/bolt-the-world-s-most-portable-electric-vehicle#/story

Maybe it will be too small and unstable, but since i'm doing the deck with spare plywood, no problem testing

Nobuo said:
Nice design!

Which program did you use to render? Also each piece is done separately by yourself, or there are some kind a database of each piece?

I use SolidWorks to draw and render, each component is draw isolated and then i join them, very handy when testing lots of possibilities

onloop said:
Cool man, should be fun to ride.

So It looks like your motor is mounted from the back, Boosted boards did this originally, then they changed it, So maybe there was an issue with mounting it backwards?

Maybe do some testing on the reverse mount variation before you commit too many $$

I hope so :)

I thought of that only after i ordered the motor, its only possible to mount from the back, probably will be to much stress from moment on the bearings and they will wear faster, but since its a low power setup maybe i can get away with it

http://www.hobbyking.com/hobbyking/store/__41621__4014_320KV_Turnigy_Multistar_22_Pole_Brushless_Multi_Rotor_Motor_With_Extra_Long_Leads.html

My main limitation is battery, it is a 6s4p Panasonic's NCR18650-B, only 2C, so at most i can pull 26A from it, 570W at 22.2V

That's the main function of the arduino, limit it in a soft way so i don't get throw when i hit the limit
 
Agreed, but since i have no experience skating, for now i'm fine with a low top speed, i ordered 2 sets of pulleys 12/50 and 18/50, with the top speed of 20km/h and 29km/h

If my calculations are correct with the 12/50 i can do 10% grade in top speed

This board is kind of a test, i'm waiting for vesc, and then i will swap the 18650 cell's for ones with better discharge and new motor(s)
 
I would go the 20km/h gearing range. I had a 6354 (about twice as wide and 50% bigger diameter) so was easily 2 of those guys, and I burnt it out at a 32km gearing. Given this, pretty sure the 29km will burn out yours. 570 watts should be right to get 20km, maybe... build it and let us know!
 
777arc said:
You are using an arduino as the motor controller?

Not motor controller, but as current limiting, i didn't test the latest version of my code, but it includes a PID current control


Sorry for absence, i'm kind of lazy when it comes to documenting things, but made a good progress in this time. Now i have a skate (non E), pulley attached to the wheel, arduino remote working, motor support ready to be welded and aluminum and POM for the battery case ordered

29fr1pl.jpg


wsr5p2.jpg


2uyt1fq.jpg


24ne7np.jpg


35jkw77.jpg
 
I don't get what you are saying about your mount being on the back, looks like the normal underneath spot to me.

what teeth profile are you using? looks super small.

are you just going to weld it in that one spot? looks like it. wonder if that's enough.

did you solder all the batteries together? that's a lot of solder.

that motor looks small.
 
I mean that the shaft in not on the face that you use to mount the motor, that complicated things a lot

The tooth profile is HTD 3M, and yes every battery soldered, not the best idea but the worst part in that in every weld there is a rectangular pcb piece, a lot of pcb pieces, cutting then took a lot of time

So a update, changed everything:

-The motor is strong enough, the weld is strong enough but... the aluminum is not :cry: , i even made a reinforcement, but didn't work unfortunately

-The belt mesh is small and i need a lot of pre tension on the belt, more than my mount can support without flexing and more than the wheel can take without flexing, and i could make it work only once for about 500m

-This ESC is crap for out use, even push kicking it's hard to get sync, and braking or not make no difference, but the worst part in that if you are cruising with no throttle and try to get the motor started again it's a no go

-the only thing that working is my arduino code, and worked beautifully, current control and current limiting, and very smooth operation, with the current limit set to 26A i got a max of 25,5A, perfect!

And the changes:

-VESC on the next enertion batch

-torqueboards 170kv sensored motor

-7075 or 6061 T6 cnc milled motor mount

the sad part is that all the code of arduino is not going to be used, if anyone want's it, its bellow, you need an arduino nano, NRF24l01, and a ACS712 current sensor

Code:
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include <Servo.h>



//Variáveis relacionadas ao controle do ESC

int joystick_y = 1;                                     //Define que o eixo y do analógico está no pino A1                                       
int neutro = 1550;                                      //Define leitura do ponto neutro(ms)
double corrente_desejada;                               //Define a corrente desejada na bateria
double corrente_bat_max = 26;                           //Define a corrente máxima suportada pela bateria
double erro;                                            //Erro entre a corrente desejada e a corrente atual
long lastProcess;                                       //Armazena o tempo (ms) do ciclo anterior
double kP = 8;                                          //Coeficiente proporcional
double kI = 4;                                          //Coeficiente integral
double kD = 0;                                          //Coeficiente diferencial
double lastSample;                                      //Armazena o valor da corrente no ciclo anteiror
double P, I, D;                                         //Armazena o valor de cada correção
int pwm_ESC = 1550;                                     //Cria a variável que ira controlar o esc e o posiciona no neutro(ms)
double corrente_fase_max = 26;                          //Define a corrente máxima suportada pelo motor
double erro_fase;                                       //Erro entre a corrente máxima suportada pelo motor e a corrente de fase atual
double P_fase, I_fase;                                  //Correção de fase
double kP_fase = kP * 2;                                //Coeficiente proporcional da fase
double kI_fase = kI * 2;                                //Coeficiente integral da fase

//Variaveis relacionadas à leitura e cálculo da corrente na bateria e nas fases do motor

int dutycycle = 0;                                      //Cria a variável que sera armazenada a porcentagem do pwm
int amppin = 2;                                         //Define que o sensor de corrente esta no pino A2
double corrente = 0;                                    //Cria a variável que sera armazenada a corrente a cada ciclo
double leitura_corrente = 0;                            //Cria a variàvel que sera armazenada a saida do sensor de corrente a cada ciclo
int mVperAmp = 88;                                      //Define a relação entre saida do sensor e corrente
int ACSoffset = 2276;                                   //Define o desvio em relação ao terra da saida do sensor
double tensao_sensor = 0;                               //Cria a variável que sera armazenada a tensão de saida do sensor
double corrente_fase = 0;                               //Cria a variável que sera armazenada a corrente da fase
double correntemedia = 0;                               //Cria a variável que sera armazenada a corrente média
double medicoes[10];
int i;

//nRF24L01+ CE and CSN pins
RF24 radio(9, 10);

// Single radio pipe address for the 2 nodes to communicate.
const uint64_t pipe = 0xe7e7e7e7e7LL;//0xE8E8F0F0E1LL;


static uint32_t message_count = 1;

//#define USE_SERIAL


Servo ESC;

void setup()
{
#ifdef  USE_SERIAL
  Serial.begin(115200);   // First open the serial connection via the USB
  //  while (!Serial) {}
  Serial.println("Started!");
#endif


  radio.begin();

  // We will be using the Ack Payload feature, so please enable it
  radio.enableAckPayload();
  radio.enableDynamicPayloads();
  radio.writeAckPayload( 1, &message_count, sizeof(message_count) );

  ESC.attach(6);
  ESC.writeMicroseconds(neutro);

  radio.openReadingPipe(1, pipe);

  radio.startListening();

#ifdef USE_SERIAL
  radio.printDetails();
#endif//USE_SERIAL


}

int threshold = 3;

const int min_payload_size = 4;
const int max_payload_size = 32;
const int payload_size_increments_by = 2;
int next_payload_size = min_payload_size;

unsigned char receive_payload[max_payload_size + 1]; // +1 to allow room for a terminating NULL char

unsigned long bla;
struct MyStatus
{
  int message_count;
  char potValueA;
  char potValueB;
  char unused1;
  char unused2;


};

int timeout = 0;
int targetValueA = 0;

void loop()
{
  timeout++;

  if (timeout > 100)
  {
    ESC.writeMicroseconds(neutro);
#ifdef USE_SERIAL
    Serial.println("Timeout!");
#endif
  }


  {

    // if there is data ready
    if ( radio.available() )
    {
      // printf("radio available\n");
      // Dump the payloads until we've gotten everything
      static unsigned long got_time;
      bool done = false;

      bool dynamicPayload = true;
      if (dynamicPayload)
      {
        while (!done)
        {
          // Fetch the payload, and see if this was the last one.
          int len = radio.getDynamicPayloadSize();
          done = radio.read( receive_payload, len );
          // 	done = radio.read( &bla, len );

          // Put a zero at the end for easy printing
          receive_payload[len] = 0;

          //some simple 'checksum'
          if (receive_payload[0] == 238)
          {

            targetValueA = map(receive_payload[1], 0, 255, 1300, 1810);
            
#ifdef USE_SERIAL
            Serial.print("receive=");
            Serial.println(receive_payload[1]);
            Serial.print("servo=");
            Serial.println(targetValueA);
#endif


            timeout = 0;
          }

          //Serial.println(targetValueA);
          // Spew it
#ifdef USE_SERIAL
          printf("Got dynamic payload size=%d:\n\r", len);
          for (int i = 0; i < len; i++)
          {
            int v = receive_payload[i];
            printf("value[%d]=%d\n", i, v);
          }
#endif //USE_SERIAL
        }
      } else
      {
        while (!done)
        {
          // Fetch the payload, and see if this was the last one.
          done = radio.read( &got_time, sizeof(unsigned long) );
#ifdef USE_SERIAL
          // Spew it
          printf("Spew Got payload %lu\n", got_time);
#endif//USE_SERIAL
        }
      }

      // Add an ack packet for the next time around.  This is a simple
      // packet counter
      MyStatus stat;
      stat.message_count = message_count;
      stat.potValueA = targetValueA;
      stat.potValueB = targetValueA;
      stat.unused1 = 2;
      stat.unused2 = sizeof(int);
      radio.writeAckPayload( 1, &stat, sizeof(MyStatus) );
      ++message_count;
    }
  }

  //Fim radio

  //Cálculos e leituras relacionadas à corrente

  for ( i = 0 ; i <= 10; i++ ) {
    leitura_corrente = analogRead(amppin);                //Lê a saida do sensor de corrente
    tensao_sensor = (leitura_corrente / 1023.0) * 4550;   //Converte a leitura em uma tensão equivalente
    medicoes[i] = ((tensao_sensor - ACSoffset) / mVperAmp);  //Cálcula a corrente equivalente
  }
  sort(medicoes, 10);
  correntemedia =  medicoes[5];       //Cálcula a corrente media dividindo o somatório do vetor pelo número de medições
  if (targetValueA < 1570)
    dutycycle = 0;
  else
    dutycycle = map(targetValueA, 1550, 1810, 0, 100);    //Mapeia a posição do analógico para -100 e 100
  if (dutycycle <= 0) {
    corrente_fase = 0;
  }
  else {
    corrente_fase = (correntemedia * 100) / dutycycle;    //Cálcula a corrente da fase
  }


  //Cálculos e leituras relacionados ao controle do ESC
                   //Le a posição do analógico

  //Caso o analógico esteja abaixo do neutro, ignora o PID e aplica o freio
  if (targetValueA <= 1570) {
    pwm_ESC = targetValueA;    //Mapeia para o pwm do ESC
    corrente_desejada = 0;
    I = 0;
  }
  else {

    //Aplica o PID com base no controle por corrente

    corrente_desejada = map( targetValueA, 1550, 1810, 0, corrente_bat_max);

    //implementação PID
    erro = corrente_desejada - correntemedia;       //corrente_fase;
    float deltaTempo = (millis() - lastProcess) / 1000.0;
    lastProcess = millis();

    //P
    P = erro * kP;

    //I
    I = I + (erro * kI) * deltaTempo;

    //D
    D = (lastSample - correntemedia) * kD / deltaTempo;


    //Limite Corrente Fase PI

    if (corrente_fase_max > 26) {
      erro_fase = corrente_fase_max - corrente_fase;

      P_fase = erro_fase * kP_fase;

      I_fase = I_fase + (erro_fase * kI_fase) * deltaTempo;
    }

    else {
      P_fase = 0;

      I_fase = 0;
    }


    //Soma PID
    pwm_ESC = P + I + D + P_fase + I_fase + neutro;

    if (pwm_ESC > 1810) {
      pwm_ESC = 1810;
      I = 1810 - neutro;
    }
  }

  ESC.writeMicroseconds(pwm_ESC);


  //Serial
  Serial.print('\n');
  Serial.print("duty cycle: ");
  Serial.print(dutycycle);
  Serial.print(" % ");
  Serial.print("Corrente: ");
  Serial.print(correntemedia, 2);
  Serial.print("A ");
  Serial.print("  Corrente Desejada: ");
  Serial.print(corrente_desejada);
  Serial.print("A");
  Serial.print(" Corrente Fase: ");
  Serial.print(corrente_fase, 2);
  Serial.print("A ");
  Serial.print(" Ms Esc: ");
  Serial.print(pwm_ESC);
  Serial.print("  Leitura Joystick ");
  Serial.print(targetValueA);


}

void sort(double a[], double size) {
  for (int i = 0; i < (size - 1); i++) {
    for (int o = 0; o < (size - (i + 1)); o++) {
      if (a[o] > a[o + 1]) {
        double t = a[o];
        a[o] = a[o + 1];
        a[o + 1] = t;
      }
    }
  }
}


EDIT:

New motor mount done

Testing pulley interference in max and min position:

anc7jr.jpg


302v2qa.jpg


Simulation with 7075-T6 aluminum (the previos one i used had a 100MPa UTS, wonder why it failed :lol: ) :

10s5hdj.jpg


And testing interference with the truck and deck

4tk1s7.jpg
 
The mount looks good. I suggest on the side where the drive wheel will be to create a counterbore in which you can weld into that way the weld does not stick out.

Depending on the motor you use certain c clips protrude from the motor case. A counterbore on the side of the motor mount part where the motor is will help to allow the c clip/cir clip to spin freely.

Just my 2 cents.

Pulley looks good :)
 
Good point on the weld, i will make a diagram to see if it will interfere with the pulley, CNC milling is pretty expensive around here, i'm trying to keep to a minimum, this wheel mount will cost a good amount for what is is, but since my first attempt didn't get well enough aligned i think it's worth

About the c clips, in your motor it stands below the plane of contact on the motor mount right?

Electric-Skateboard-Motor2-322x215.jpg
 
Received the motor, amazing piece, but i have two questions

1 - what is each pin on the hall connector? i'm assuming the folowing:
Red - Vcc
White - Temperature sensor?
Blue, yellow and green - Hall output
Black - Gnd

2- could you provide the image file of the sticker that goes around the motor? i'm modeling it in 3D and would be nice to incorporate that

Thanks

Now i need VESC and design and send to manufacture the new motor mount, unfortunately i bought a piece of 7075 T6 aluminum, but forgot it's not good to make welds using it :? :?
 
Updates

Received the new pulleys and belts and the electronics for the controller, also found a shop arround here that will do the new motor mount on reasonable price in 6061 aluminum, now the only thing remaining is the new batch of VESC's

qqviol.jpg


28jyxxt.jpg


2zgf620.jpg


167nh8y.jpg
 
Back
Top