"Mini" Longboard - Little Board

Lightweight / Folding / Portable EVs - seats optional
Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

"Mini" Longboard - Little Board

Post by Pedrodemio » Jun 30 2015 9:11pm

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

Image

Cheers

User avatar
Nobuo   10 kW

10 kW
Posts: 839
Joined: Nov 21 2014 3:38am
Location: Madrid

Re: "Mini" Longboard - Little Board

Post by Nobuo » Jun 30 2015 10:48pm

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?
* Lithium + Air = Fire * <-----> ** Lithium + Chemical-Additives + Air = ZERO Fire **
<Battery and EV works>
https://facebook.com/evmadrid1
<Battery building resources>
http://www.endless-sphere.com/forums/vi ... 14&t=68005

torqueboards   100 MW

100 MW
Posts: 2940
Joined: May 27 2013 10:02pm
Location: San Francisco, CA
Contact:

Re: "Mini" Longboard - Little Board

Post by torqueboards » Jun 30 2015 11:25pm

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.
DIYElectricSkateboard.com Electric Skateboard Kits

User avatar
psychotiller   10 kW

10 kW
Posts: 949
Joined: Jan 01 2014 7:11pm
Location: Orange County, Ca USA
Contact:

Re: "Mini" Longboard - Little Board

Post by psychotiller » Jun 30 2015 11:34pm

Love it. The render looks awesome.
www.psychotiller.com

builds:
XT Wheels/Custom Hub & mount on Randal 180's/Drop Throughhttp://endless-sphere.com/forums/viewto ... 35&t=59259
6" Pneumatic Tire Drop Down/Drop Through http://endless-sphere.com/forums/viewto ... 35&t=60449
"Have you ever heard of Plato? Aristotle? Socrates? Morons!"-Vizzini

User avatar
onloop   10 kW

10 kW
Posts: 600
Joined: Jun 24 2013 5:24am
Location: Australia
Contact:

Re: "Mini" Longboard - Little Board

Post by onloop » Jun 30 2015 11:59pm

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 $$

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: "Mini" Longboard - Little Board

Post by Pedrodemio » Jul 01 2015 12:11am

psychotiller wrote:Love it. The render looks awesome.
Thanks

torqueboards wrote: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 ... cle#/story

Maybe it will be too small and unstable, but since i'm doing the deck with spare plywood, no problem testing
Nobuo wrote: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 wrote: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/stor ... 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

torqueboards   100 MW

100 MW
Posts: 2940
Joined: May 27 2013 10:02pm
Location: San Francisco, CA
Contact:

Re: "Mini" Longboard - Little Board

Post by torqueboards » Jul 01 2015 1:12am

You might want more torque out of your setup. 320kv is a bit higher and those motors aren't normally recommended.

The bolt only went 14mph because it has higher torque to climb uphill.
DIYElectricSkateboard.com Electric Skateboard Kits

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: "Mini" Longboard - Little Board

Post by Pedrodemio » Jul 01 2015 11:24am

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)

User avatar
bandaro   10 kW

10 kW
Posts: 526
Joined: Jun 01 2010 2:17am
Location: Canberra, Australia

Re: "Mini" Longboard - Little Board

Post by bandaro » Jul 02 2015 7:13am

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!

User avatar
PracticalProjects   10 W

10 W
Posts: 96
Joined: Aug 04 2013 3:47pm
Location: UK
Contact:

Re: "Mini" Longboard - Little Board

Post by PracticalProjects » Jul 06 2015 5:04am

Looks like it might be cool but I think it may be rather interesting to try and ride

777arc   10 W

10 W
Posts: 97
Joined: Nov 04 2014 8:57pm
Location: Blacksburg, VA, USA

Re: "Mini" Longboard - Little Board

Post by 777arc » Jul 06 2015 9:27am

You are using an arduino as the motor controller?

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: "Mini" Longboard - Little Board

Post by Pedrodemio » Jul 23 2015 3:17pm

777arc wrote: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

Image

Image

Image

Image

Image
Last edited by Pedrodemio on Sep 05 2015 11:52am, edited 2 times in total.

Hummina Shadeeba   1 MW

1 MW
Posts: 1608
Joined: Apr 25 2014 10:26pm

Re: "Mini" Longboard - Little Board

Post by Hummina Shadeeba » Jul 23 2015 3:43pm

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.

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: "Mini" Longboard - Little Board

Post by Pedrodemio » Aug 20 2015 12:20pm

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: Select all

#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:

Image

Image

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

Image

And testing interference with the truck and deck

Image

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: "Mini" Longboard - Little Board

Post by Pedrodemio » Aug 21 2015 11:11pm

New version of the wheel-pulley mount, any sugestions?

Image

torqueboards   100 MW

100 MW
Posts: 2940
Joined: May 27 2013 10:02pm
Location: San Francisco, CA
Contact:

Re: "Mini" Longboard - Little Board

Post by torqueboards » Aug 21 2015 11:30pm

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 :)
DIYElectricSkateboard.com Electric Skateboard Kits

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: "Mini" Longboard - Little Board

Post by Pedrodemio » Aug 22 2015 1:28pm

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?

Image

torqueboards   100 MW

100 MW
Posts: 2940
Joined: May 27 2013 10:02pm
Location: San Francisco, CA
Contact:

Re: "Mini" Longboard - Little Board

Post by torqueboards » Aug 22 2015 1:42pm

Yes, it is below so the c clip won't be in contact with the mount.
DIYElectricSkateboard.com Electric Skateboard Kits

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: "Mini" Longboard - Little Board

Post by Pedrodemio » Sep 03 2015 8:01pm

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 :? :?

torqueboards   100 MW

100 MW
Posts: 2940
Joined: May 27 2013 10:02pm
Location: San Francisco, CA
Contact:

Re: "Mini" Longboard - Little Board

Post by torqueboards » Sep 03 2015 8:48pm

Hi Pedro,

Red +5V positive
White Temp
Blue A
Yellow C
Green B
Black GND positive

Email me for the image file :)
DIYElectricSkateboard.com Electric Skateboard Kits

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: "Mini" Longboard - Little Board

Post by Pedrodemio » Sep 03 2015 10:01pm

Straight conection to vesc, maybe change the connector, thanks

What i have so far:

Image

User avatar
maxchilton   10 W

10 W
Posts: 92
Joined: Jul 15 2015 10:30am

Re: "Mini" Longboard - Little Board

Post by maxchilton » Sep 04 2015 2:16pm

resize your pics dude.
.









das it mane.

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: "Mini" Longboard - Little Board

Post by Pedrodemio » Sep 04 2015 8:29pm

Image

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: "Mini" Longboard - Little Board

Post by Pedrodemio » Sep 11 2015 11:35pm

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

Image

Image

Image

Image

torqueboards   100 MW

100 MW
Posts: 2940
Joined: May 27 2013 10:02pm
Location: San Francisco, CA
Contact:

Re: "Mini" Longboard - Little Board

Post by torqueboards » Sep 12 2015 4:53am

Nice CAD :)
DIYElectricSkateboard.com Electric Skateboard Kits

Post Reply