Jump to content
DOSBODS
  • Welcome to DOSBODS

     

    DOSBODS is free of any advertising.

    Ads are annoying, and - increasingly - advertising companies limit free speech online. DOSBODS Forums are completely free to use. Please create a free account to be able to access all the features of the DOSBODS community. It only takes 20 seconds!

     

electronics ebikes etc


nirvana
 Share

Recommended Posts

I'm saving some stuff here cos then its acts as a knowledge base and it's ok if I lose the original pics or my phone breaks, so mix of funky stuff off tinternet and a few pics of my own

VESC with arduino and wiring connected to a thumb 'button' which acts as a throttle on/off

part of keplers friction drive, this is someone elses not mine, I'm trying to put mine together....got some bare 21700 lithium cells that I wanna hold in a drink bottle but I still need some way of holding 14 (i think) cells together, might be good old cable ties but not looking forward to soldering them or really could do with 'spot welding' em but zero experience of that

 

vesc_arduino.jpg

Edited by nirvana
Link to comment
Share on other sites

ok got arduino IDE 1.8.15 running on arch...you need to run it with sudo or else you can't write to the board

tested with 'blink'

need to find some code to get the button working

Link to comment
Share on other sites

You can get little spot welding boards and leads off Ebay and the nickel strip - practice with some old alkaline first maybe, think you should be able to run spot welder off car battery or similar.

Use a glue gun to stick the cells together (or something like silicone sealant whilst typing them temporarily together) in pretty much any arrangement you want then wrap the cells / balance wires /power cables together in duct tape. 

  • Cheers 1
Link to comment
Share on other sites

Iamcynical

This is the welder I use to make my own batteries:-

 

https://www.ebay.co.uk/itm/384014044163?_trkparms=amclksrc%3DITM%26aid%3D1110006%26algo%3DHOMESPLICE.SIM%26ao%3D1%26asc%3D20200818143132%26meid%3Daa95095536414e7a92ed66ec126b0b5d%26pid%3D101198%26rk%3D4%26rkt%3D12%26sd%3D233747733323%26itm%3D384014044163%26pmt%3D1%26noa%3D0%26pg%3D2047675%26algv%3DSimplAMLCvipPairwiseWebWithBBEV2bDemotion%26brand%3DUnbranded&_trksid=p2047675.c101198.m1985&amdata=cksum%3A384014044163aa95095536414e7a92ed66ec126b0b5d|enc%3AAQAGAAACEBzJ9gxg2Hjx704O2Hs3UIxmjCTzhFv9qFAvQ6ldDm5PTRe%2FbsMuJG3LwVV6Y57icbVVvEO13kbDGBKvkSE9m9Lwhpj1Q7hDpexayywwUMy7SvyPuhDqYfAoutzJEYTEt%2B3Ji1r8VyXiGew%2Bc9OdACWJQFquVBze9NBpG%2F6xxcL9x3pSdS1vb9Tk5f3bHb15nsdnVLtIyzx191cjprreGRIlIUTZvVrjwfq3TXyu8rPcCChucjQaYIl9TvBTKMWUA36VXRFz4JdH8dBu1sYqP1eHEtDbyp9Fk5DnNjQqf58gV%2FvksHncBDCAsclFkxhYdc1H9bqIc%2FwD%2Betd016PEW2uRIRkOTTMkTZk%2FnnpEoeKEmHeOvnucnQg%2F0%2FifeLhQhFcUrcRsdi9VKnL%2FS8r4M8%2BH5UCQqce871wulPHHkreuK3J%2BO5ZRYFmFSYdV3c%2F9Q348BZB9N7DDIYpLSqWfbDsiB4NR5FrSZo9FJTZrcnMp%2Be%2FsyLogdmBwiVHT7eyWUf0g%2BDL5NFlKIsJ1%2F4nz62WUAs9HFnZWh5WJzN9NgJid6OlukCb1vjoUGBHRtX5iIfjHYBKRlfXU0zFUg1rtBaIeieRmhAfpGZ7FK2wr%2BEA4LExdchVzTRZECv575KWCPh6kDMgOR6HjQERCsJMvQ40JuqcFq%2FXjNzaQwpHLCWpFDYO0o6h0OGGqydZ80lrIg%3D%3D|ampid%3APL_CLK|clp%3A2047675&epid=26040871804

Just get a small 12v car battery from a breakers yard or something.  Mine is 41ah.

Only do a few welds at a time using 6mm nickel strip.  You need to let the FET's cool down otherwise you'll destroy the welder.

I've used 20 18650 cells and put them in an aluminium tube about a water bottle diameter.

I'm currently using a chinese controller but would prefer to use my own board and s/w.  Any hint or tips gratefully received !

A hot glue gun will do the job for holding the batteries, once welded they aren't going anywhere anyway.  Use shrink wrap and a heat gun to complete the batteries when you've built them.

  • Informative 1
Link to comment
Share on other sites

46 minutes ago, Iamcynical said:

I'm currently using a chinese controller but would prefer to use my own board and s/w.  Any hint or tips gratefully received !

I think it depends what motor you're running? but I have it on good authority that those mini vesc boards are the DBs, mine is a 'mini FSESC4.20' from aliexpress ....lots of smart folks on endless sphere forum might be able to help

I like the idea of being able to put in an extra level of control with the arduino nano boards cos they cost like 2 bucks off aliexpress!

Link to comment
Share on other sites

Iamcynical
1 minute ago, nirvana said:

I think it depends what motor you're running? but I have it on good authority that those mini vesc boards are the DBs, mine is a 'mini FSESC4.20' from aliexpress ....lots of smart folks on endless sphere forum might be able to help

I like the idea of being able to put in an extra level of control with the arduino nano boards cos they cost like 2 bucks off aliexpress!

its a 3 phase brushless 36v 250w motor with hall effect sensors

Link to comment
Share on other sites

belfastchild

I tend not to use the spot welded variety but depending on numbers in a pack I go for the battery holders then put a quick change connector on them.

More expensive initially but if you have loads of wee projects that use 3 or four batteries and you dont use them concurrently you can have 2 spare battery packs that I can plug in interchangeably. You can also take the charging element out of every project you make, charge the packs separately.

I have RC cars and airsoft guns that have the same idea, I just stole that ;-)

Link to comment
Share on other sites

1 minute ago, Iamcynical said:

its a 3 phase brushless 36v 250w motor with hall effect sensors

you're getting quite techie for me now dude lol I'm a beginner ebiker and amateur electronicist 

this is what I've got but I'm sure I only paid about 30-40 bucks for mine, the prices of this stuff has rocketed due to all the chi-na shortages

https://www.aliexpress.com/item/32920220655.html

Link to comment
Share on other sites

I'm working towards getting the code for the arduino and then I should be able to test it all out

will I be able to test with a 12v car battery? it chucks out 60aH

so the plan with the button

1.5sec press=50% power

3sec press=100% power

quickpress=kill power

like this

 

Screenshot_2021-09-10_13-34-40.png

Link to comment
Share on other sites

6 minutes ago, belfastchild said:

go for the battery holders

what sort do you use? I looked for some for the 21700 ones I have but couldn't find much

Link to comment
Share on other sites

belfastchild
9 minutes ago, nirvana said:

what sort do you use? I looked for some for the 21700 ones I have but couldn't find much

banggood, aliexpress have loads of different types. I use the 4 square (with 3 tap off point as well as 4) and the 3/4 long thin ones (fit in handles better).
Couple of the 4 square ones is 8 etc etc. Its all about the wiring of your connectors on the project end and the space you have available.

  • Cheers 1
Link to comment
Share on other sites

belfastchild
15 minutes ago, nirvana said:

what sort do you use? I looked for some for the 21700 ones I have but couldn't find much

Meant to add, a lot of coil spring 18650 holders will fit (maybe ;-)

18x65 isnt much difference to 21x70. Then again it could be a whole lot ;-)

Link to comment
Share on other sites

30 minutes ago, belfastchild said:

Couple of the 4 square ones is 8 etc etc. Its all about the wiring of your connectors on the project end and the space you have available.

right I've dredged throw my folders and found this....so the rubber around the batteries, will that be heat shrink?

I need to wire my cells in series, I'll just go for 6 at first, one of my requirements is light weight, this is a road bike...

once successfully tested I will look for a Triban frame that can take gravel tyres and look for something more robust that can do trail type stuff......but road first :)

 

battery6s1p_a.jpg

Edited by nirvana
Link to comment
Share on other sites

6 minutes ago, nirvana said:

calling coders, anyone help with my arduino code? I have some code from visuino that apparently does it but I can't get visuino to run on arch and I can't see a way of getting the libraries into arduino IDE

@Boglet@Dave Bloke@dgul@unregistered_guest@Green Devil@spygirl

and @goldbug9999I know you're smart, do you do arduino at all?

Why do you need libraries?  All you're doing is polling an input and setting an output dependent on length of button press.  Or is there more to it?

Link to comment
Share on other sites

25 minutes ago, dgul said:

Why do you need libraries?  All you're doing is polling an input and setting an output dependent on length of button press.  Or is there more to it?

yeah that's it methinks!

I have this code but it fails at line 1 cos I haven't got the openwire.h file

ie it was written using some commercial crap called visuino but I'm using arduino 'naked'

ie these are the first lines of code

#define VISUINO_ARDUINO_NANO

#include <OpenWire.h>
#include <Mitov.h>
#include <Mitov_FormattedSerial.h>
#include <Mitov_LogicFlipFlops.h>
#include <Mitov_Converters.h>
#include <Mitov_RampToValue.h>
#ifndef VISUINO_ESP32
#include <Servo.h>
#endif // VISUINO_ESP32
#include <Mitov_Servo.h>
#include <Mitov_LogicGates.h>
#include <Mitov_Button.h>
#include <Mitov_Math.h>

so here's a hardware diagram

 

arduino wiring.png

Edited by nirvana
Link to comment
Share on other sites

3 minutes ago, nirvana said:

yeah that's it methinks!

I have this code but it fails at line 1 cos I haven't got the openwire.h file

ie it was written using some commercial crap called visuino but I'm using arduino 'naked'

ie these are the first lines of code

#define VISUINO_ARDUINO_NANO

#include <OpenWire.h>
#include <Mitov.h>
#include <Mitov_FormattedSerial.h>
#include <Mitov_LogicFlipFlops.h>
#include <Mitov_Converters.h>
#include <Mitov_RampToValue.h>
#ifndef VISUINO_ESP32
#include <Servo.h>
#endif // VISUINO_ESP32
#include <Mitov_Servo.h>
#include <Mitov_LogicGates.h>
#include <Mitov_Button.h>
#include <Mitov_Math.h>

so here's a hardware diagram

 

arduino wiring.png

What happens if you comment out the #include openwire?  Frankly, what happens if you comment out all the #includes.

Link to comment
Share on other sites

1 minute ago, Carl Fimble said:

£3200 for this bike, in kit form.

5000w motor and 60mph, it's got pedals foo

ok post a pic lol......if you go DIY you can probs easily get 1500w and 45mph and believe me that'll be fast enough on a push bike before you start crapping yourself lol

1 minute ago, dgul said:

What happens if you comment out the #include openwire?  Frankly, what happens if you comment out all the #includes.

probs won't work cos it's got a load of 'proprietary code' ie this is what follows

// Arduino Board Declarations

namespace BoardDeclarations
{
Mitov::TypedSerialPort<Mitov::SerialPort<SERIAL_TYPE, Serial>, SERIAL_TYPE, Serial> SerialPort0;
Mitov::ArduinoSerialInput<Mitov::TypedSerialPort<Mitov::SerialPort<SERIAL_TYPE, Serial>, SERIAL_TYPE, Serial>, SerialPort0, float> SerialPort0_InputFloat_1;
Mitov::ArduinoDigitalOutputChannel<3> ArduinoDigitalChannel_3( true, false );
Mitov::ArduinoDigitalChannel<5, false> ArduinoDigitalChannel_5( true, false, false, false, false, false, true );
Mitov::ArduinoDigitalChannel<9, false> ArduinoDigitalChannel_9( true, false, false, false, false, false, true );
} // BoardDeclarations

// Declarations

namespace Declarations
{
Mitov::TFlipFlop<Mitov::FlipFlop_Normal> TFlipFlop1;
Mitov::DigitalToTypeParams<float> DigitalToAnalog2 = Mitov::DigitalToTypeParams<float>( 1.0f, 0.0f );
Mitov::RampToValue RampToValue1;
Mitov::MitovServo<9, 820, 1950> Servo1;
Mitov::UnaryOperation<Mitov::BooleanInverter, bool> Inverter3;
Mitov::Button Button1;
Mitov::TFlipFlop<Mitov::FlipFlop_Normal> TFlipFlop4;
Mitov::DigitalToTypeParams<float> DigitalToAnalog4 = Mitov::DigitalToTypeParams<float>( 1.0f, 0.0f );
Mitov::MultiInputMathOperation<Mitov::Add<float>, float, 2> Add2;
Mitov::Button Button2;
Mitov::Button Button3;
} // Declarations

// Type Converters

namespace TypeConverters
{
Mitov::Convert_BinaryToClock Converter0;
Mitov::Convert_BinaryToClock Converter1;
Mitov::Convert_BinaryToClock Converter2;
} // TypeConverters

Link to comment
Share on other sites

yeah it errors with 'mitov' does not name a type....

I need a sheeple with a windows pc and compile it on that methinks lol

Link to comment
Share on other sites

This is the problem with visual programming -- you get a load of crap joining in for the ride whether you like it or not.

This would be code for a simple three phase motor control (which I think is what you've got) without invoking libraries:

int inputPin = a;                  // select the input pin for your button
int phase1 = x;                 // the output
int phase2 = y;                 //  pins for each 
int phase3 = z;                 // motor phases
int speed = 0;                     //speed 0-255, 0 is fastest, 255 slowest

void setup() 
{
  pinMode(phase1, OUTPUT);        
  pinMode(phase2, OUTPUT);        //set the phase pins to output 
  pinMode(phase3, OUTPUT);        
                          }

void loop() 
{
 
  if (analogRead(inputPin)>128) speed=128;         // Read the button.  I don't know how you're doing this, but this is an analogue read
  else speed=255;

  //You'll need to sort out your own bits here to make the speed variable different dependent on length of button press.

 if (speed<255)
{
digitalWrite(phase1, HIGH);         //switch the phases on and off in the right order
  delay(speed);            		
digitalWrite(phase3, LOW);          
  delay(speed);             
digitalWrite(phase2, HIGH);           
  delay(speed);              
digitalWrite(phase1, LOW);           
  delay(speed);             
digitalWrite(phase3, HIGH);          
  delay(speed);             
digitalWrite(phase2, LOW);           
  delay(speed);             
}
      
else
{
digitalWrite(phase1, LOW);           // turn motor off
digitalWrite(phase2, LOW);
digitalWrite(phase3, LOW);

}
}

 

  • Cheers 1
Link to comment
Share on other sites

38 minutes ago, Carl Fimble said:

Less mad kits for existing bikes :

https://kirbebike.com/diy-conversion-kits.html

Andy Kirkby, yeah he's a cunt! lol

has a youtube channel and knows a guy in chi-na, who is about as reliable as Biden the pedalo apparently....

loads o folks ordered and had to wait feckin months or didn't bloody get anything!

I think I spoke to that chinky direct, he wanted about 4 grand for the bike and sounded like a cunt lol

yeah I like to call useless bullshitters 4 letter words in case you hadn't noticed xD

Edited by nirvana
Link to comment
Share on other sites

18 minutes ago, nirvana said:

cheap spot welder for lithium batteries https://www.aliexpress.com/item/1005001860515660.html

I went for the common Ebay ones as a bit more info about them online as it a common design, of which their are multiple variants, but one has specific markings "Wise Maple" and has supposedly had a lot of the fixes done vs other/earlier versions, it stills needs some mods but will see how that goes and report back.

  • Cheers 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...