Free Agent 2 stage rc mid drive

pendragon8000

100 kW
Joined
Sep 28, 2012
Messages
1,767
Location
Adelaide, Australia
10373715_10204300700386816_2413294708541575314_n.jpg
Update:
39265780_462828687458924_82631657491791872_o.jpg

https://www.facebook.com/MakeTechPTYLTD
Hi all. Ive made 2 DD hub motor ebikes and decided I'd have a go at RC mid drive. I ummed and erred about it but then i saw the electricbike write up about it and was inspired when i saw this pic:
JackshaftGwhy.jpg

As i hade a couple head sets/stems spare already I droped into CBC bearings near my place and grabed some high rpm rated sealed Japan made bearings $7 each and put them in to see how it looks, then made a shim and cut the head set so I could mount it on the frame.

OK, how about i just continue with a YT vid...

[youtube]dGuGCo7Zg_Q[/youtube]

*Turningy SK3 6374 149kv
*sentilon controler
*Arduino Nano to drive throttle signal to controller (input-throttle, rpm, thermistor , accelerometor and battery voltage)

xl timming belt 10mm wide 20t-50t
219 chain 9t-64t
top speed expected 30kph with relitevely high acceleration around 10-15 kph considering the total mass.

arduino code to go here:
---------
variables
throttle_min=10
throttle_max=170
current_0=readpin(current_pin)
current_lim=4
regen=0
upramp= 8 // degrees per 10mS


do
pin(throttle_out_pin) = throttle_out
if ebrake = 1 then throttle_out = regen
if ebrake = 0 then throttle_out = 0

if throttle_in<throttle_out then
throttle_out=throttle_in
end if

if current_in>current_lim then
throttle_out=throttle_out-int(sqrt(current_in-current_lim))-1
loop
end if

if milliseconds()=>10 then
fast_ramp=0
if speed/6000-.2 > throttle_in/180 then fast_ramp=18
if throttle_out>throttle_in then throttle_out=throttle_out+upramp+fast_ramp
t=time
end if

loop

------- (need to convert from basic to arduino, easy)

that obvoisly need work, I just thre that together just now of the top.
 
this is the tread that the picture of the headstem came from, for ref : http://endless-sphere.com/forums/viewtopic.php?f=28&t=22245&hilit=new+old+build

here is a link to a thread for a RC esc arduino throttle interface ( you may /may not find useful ) http://endless-sphere.com/forums/viewtopic.php?f=2&t=61407
 
gwhy! said:
this is the tread that the picture of the headstem came from, for ref : http://endless-sphere.com/forums/viewtopic.php?f=28&t=22245&hilit=new+old+build

here is a link to a thread for a RC esc arduino throttle interface ( you may /may not find useful ) http://endless-sphere.com/forums/viewtopic.php?f=2&t=61407
Excellent. I'll have a good look at those threads.

Yawstick , yeah do it :)

YouTube video added to first post.
 
cool.. making some progress... one suggestion ... put a pull down resistor on the analog input of the throttle, its not a good idea to have the input floating should the throttle become detached in anyway.. a 10k resistor is good enough..
 
gwhy! said:
cool.. making some progress... one suggestion ... put a pull down resistor on the analog input of the throttle, its not a good idea to have the input floating should the throttle become detached in anyway.. a 10k resistor is good enough..
Yes, excellent suggestion. I'll do that.
Between neg and signal as close to the board as practically possible I guess.
I really need a high tensile 8mm bolt for the jack shaft. The one I have is plain steel and there's a noticeable wobble. Its minimal and I could get away with it for a while but it will wear the belt and chain quicker.
 
The top part of the chain is under high tension when the motor is pulling and will have a lot of friction against a nylon block. It will cause power loss, noise and wear.
Consider using a sturdily mounted roller or pulley instead of a nylon block if you can't change the motor position to change the chainline and avoid the problem.

Avner.
 
heres the moded code ive got so far. the ramp takes about 1.5 seconds to go to full speed.
turns out the cord i was using was dodge FML so yeah i cound the proper cord my mate gave me rather than the one i used to use for my camera and now im back in business. rocking ubunu ftw

Code:
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott> 

#include <Servo.h> 

Servo myservo;  // create servo object to control a servo 

int potpin = 0;  // analog pin used to connect the potentiometer
int val;   // variable to read the value from the analog pin 
int phase=1;
int ramp=2;
int thr_i=0;
int thr_o=5;

void setup() 
{ 
  myservo.attach(3);  // attaches the servo on pin 3 to the servo object 
  pinMode(13,OUTPUT);
} 

void loop() 
{ 
  thr_i = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023) 
  if (thr_o <thr_i) thr_o=thr_o+ramp;
  if (thr_o >thr_i) thr_o=thr_i;
  val = map(thr_o, 50, 850, 0, 179);     // scale it to use it with the servo (value between 0 and 180) 
  myservo.write(val);                  // sets the servo position according to the scaled value 
  val=val/phase;
  if (val >= 16) digitalWrite(13, HIGH);
  if (val < 16) digitalWrite(13, LOW);
  phase = phase + 1;
  if (phase > 10) phase=1;
  delay(5);                           // waits for the servo to get there 
}
 
gwhy! said:
you dont need the 5ms delay for the servo to get there as it dont need to physically get there :D
Yeah. Its acting as a time frame for the ramp.
I could or should do :

If ( T+5>=time milliseconds){
.......
thr_o=thr_o+ramp
........
T=time Milli seconds
}
 
I hadn't been following this and I'm more of a hacker (modifying existing code) than a programmer but if if this is your first arduino project I would just get motor control part working before adding delay and such. I have used the sentillion ESC quite a bit and I cant remember if I calibrated the throttle to the controller or not. But I think you'll find that you can control this ESC with the servo output mapped to somewhere in the 45 to 130 range instead of 0 to 180. This will save you a lot of deadband below and above 45 to 130. I recently learned that the car type ESC almost require something closer to 0 to 180 if you have forward and reverse or 90 to 180 if you don't have reverse. Its also handy to have some serial print of your values so you can use the serial monitor to see what values you are sending to your controller and where it actually starts running and what value gives you full speed.
 
Oh ok, my bad... good job... I've had good service from that drive. My trike probably on the heavy side but easily pull 75 - 80 amps on 44 volts when accelerating before I added current limiting. You can current limit pretty well just by being gentle on the throttle. Sometimes easier said than done.
 
More progress soon.
Working full time again I can get some LiPo.
2 x 6s heavy duty 60c
Its a fun little bike. Looking forward to sorting it out.
I need a chain breaker for the 219 chain I think, so I can bring the axle forward, as it well help a little with the chain line and tension.
 
My new big short term goal is arduino Bluetooth Android app.
Hopefully look something like this....
maxresdefault.jpg

Probably not with all the GPS bizzo.
But on the arduino I will implement (at least attempt) a wheelie assist mode using a 3 axis giro I just ordered.

Edit
Oh yeah. Funny story.. My first phone app was using the giro sensors, when all are approximate zero it says in computer voice "I'm falling" , because zero g on every axis. So there I am after a few beers having made my ffirst app throwing my phone in the air laughing like a... Drunk programmer...? Yeah
 
Also I put the new pedal chain on and it is slightly better but still needs a tensioner. I like the idea of a tensioner bringing the chain in toward the bottom bracket from underneath. Chain slap on the frame may be more of an issue but it will engage more teeth on the rear than pulling the chain away from the rear axle, and should give a cleaner look.
 
http://i.imgur.com/xznqWF0.jpg
xznqWF0.jpg
I found a group called
"hacker space Adelaide"
I took my bmx and worked on it. i got a powered low speed ride around the room after I moded the controller settings and my arduino code.
controller was programed for fast start and arduino was slowed down quite a bit for safety for now.
only running 6s today. soon upto 12s (50v) . need to make some encolsures and chain guides and its basicaly useable. I think bluetooth phone app HUD is definately a goal for the near future.
 
progress, a few more parts to print. bit of wiring. Also Ive decided to add a idler chain guide to move the chain line around the seat stay, ill use some nylon on the chain stay. should be a simple welding of 10mm nut to frame and lathe down a skate board wheel. the chain line is sort of ok, but over time it will become an issue.
bmx_box1.jpg
 
sn0wchyld said:
pendragon8000 said:
more progress on the enclosure
View attachment 1

looks bloody awesome mate... but how long did that take to print?!?!

Thanks, 16hrs for the main piece. Other parts about 2hrs and lid was 4 hrs i think. I just ordered some carbon Kevlar for the sides.
 
Back
Top