Canada
Offline
Sr. Member
Karma: 0
Posts: 319
Sometimes teaching, always learning,
|
 |
« Reply #15 on: February 23, 2012, 11:37:32 am » |
Sweet! Keep us posted on your progress 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 24
Posts: 1477
Now, More Than Ever
|
 |
« Reply #16 on: May 06, 2012, 06:20:49 pm » |
I have been at work. I'm still trying to find another gear in place of the stock 9-tooth. Undeterred, I have been busily engaged at fabricating the deck for the motor to sit on. Maybe this'll chuck a wobbly at motor trial, unanticipated torsional forces wreaking havoc. I'll have to wait till then. Seems sturdy, but what do I know. You can see three pictures of what I've wrought so far ─ www.photobucket.com/e-chopper
|
|
|
|
« Last Edit: May 06, 2012, 07:16:41 pm by Runaway Pancake »
|
Logged
|
Don't React -- Read!
|
|
|
|
Offline
Edison Member
Karma: 24
Posts: 1477
Now, More Than Ever
|
 |
« Reply #17 on: May 12, 2012, 03:28:22 pm » |
So, if I just go for broke in order to get this show on the road and go with the stock sprocket (9t on the motor sprocket and 20t on the wheel sprocket)...
I won't have a controller as such, I'm figuring on just hitting it with the battery voltage, leaded out to a terminal, I guess, fat-wire in hand, touching on/off, as needed.
Would that be awful? Inappropriate?
* * * Dumb? * * * Remember, it's the "1/2 hp" 24V
|
|
|
|
« Last Edit: May 12, 2012, 03:30:43 pm by Runaway Pancake »
|
Logged
|
Don't React -- Read!
|
|
|
|
Canada
Offline
Sr. Member
Karma: 0
Posts: 319
Sometimes teaching, always learning,
|
 |
« Reply #18 on: May 12, 2012, 05:43:06 pm » |
Nice progress  I know a guy who just used a on/off toggle switch to control his e-bike. If he wanted to go slow, he just did a manual PWM. I don't know the voltage or power of the motor, but I do know he had to beef up the bike wheel because going instantly from full stop to max torque tended to bend the spokes.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 24
Posts: 1477
Now, More Than Ever
|
 |
« Reply #19 on: May 12, 2012, 08:19:44 pm » |
Thanks, John_S. That's something I did not anticipate. I'm going to slap together something rudimentary for control, and keep things arduinofied, which shouldn't be a big deal esp. since I don't have to go power backwards with it and it'll be better having it to go slow with to rough in the motor/sprocket alignments.
I have a length of new chain and a new chain tool, too. This should be interesting.
|
|
|
|
« Last Edit: May 12, 2012, 08:22:12 pm by Runaway Pancake »
|
Logged
|
Don't React -- Read!
|
|
|
|
Finland
Offline
Sr. Member
Karma: 0
Posts: 270
Arduino rocks
|
 |
« Reply #20 on: May 14, 2012, 05:34:25 am » |
If you don't want to implement a speed controller from scratch, you may want to try a Chinese eScooter ESC like one of these: http://www.ebay.co.uk/itm/ws/eBayISAPI.dll?ViewItem&item=220606285127. I bought two of these for my RC lawn mower project. They are quite cheap and easy to use. You can buy a throttle handle that works with the controller. The control voltage is 1-4V so they are easy to use with the Arduino also. I drive mine from the Arduino's analog out. I put a low pass filter between the analog out pin and the controller because I assumed that the controller expects clean control voltage and Arduino's analog out is really PWM. I'll guess you can find similar ESCs also from the US ebay.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 24
Posts: 1477
Now, More Than Ever
|
 |
« Reply #21 on: May 19, 2012, 02:39:00 pm » |
OK, I have a preliminary test version of a motor controller. Two MOSFETs in parallel (on the perfboard). First time through it was OK with 12V, when I switched over to 24V it biffed right way [Poof!] Drain to Gate short x 2. But, I didn't use a clamping (commutation) diode. When I re-built it I did use one and it's performing well. So, as far as I am concerned, that MOSFET zener-equivalent diode is not suitable as a clamping diode. Next step - mount it on the deck with the chain on, get some load on it. * And, yes,.. I'll have to buy some better spec'd FETs or parallel more of these (2, 3?).
|
|
|
|
« Last Edit: May 19, 2012, 04:41:39 pm by Runaway Pancake »
|
Logged
|
Don't React -- Read!
|
|
|
|
Offline
Edison Member
Karma: 24
Posts: 1477
Now, More Than Ever
|
 |
« Reply #22 on: May 22, 2012, 01:34:35 pm » |
This coming Monday is our Memorial Day holiday, so I'm taking off Friday and the following Tuesday to work on this more.
|
|
|
|
|
Logged
|
Don't React -- Read!
|
|
|
|
United Kingdom
Offline
Faraday Member
Karma: 144
Posts: 4882
|
 |
« Reply #23 on: May 22, 2012, 02:11:48 pm » |
So, as far as I am concerned, that MOSFET zener-equivalent diode is not suitable as a clamping diode.
Power mosfets typically have avalanche energy ratings, which are given on the datasheet. The avalanche energy rating is much lower than you will get from a 350W motor. Maybe OK for a relay. Also, absorbing the back emf as avalanche energy is less efficient than using a commutating diode because of the higher voltage, which will cause the current to drop faster, increasing the power consumption (the extra power ends up as heat in the mosfet). So you should always use a commutating diode (preferably a Schottky one) when using a mosfet to PWM a motor or other inductive load.
|
|
|
|
|
Logged
|
Formal verification of safety-critical software, software development, and electronic design and prototyping. http://www.eschertech.com
|
|
|
|
Sweden
Offline
Newbie
Karma: 0
Posts: 23
|
 |
« Reply #24 on: May 24, 2012, 11:40:57 pm » |
Dear Mr Pancake!
I am doing almost the same project, but with a 36v 800W motor, for my sons gocart. If you could draw up a diagram of how you wired it and what components you used, I'd be very grateful! I already ordered some suitable mosfets and diodes that were recommended in another thread, just not sure how to wire them up...
Thanks in advance,
Magnus, Sweden
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 24
Posts: 1477
Now, More Than Ever
|
 |
« Reply #25 on: May 25, 2012, 07:45:52 am » |
OK. Here is the circuit as used in the demo (previous)  Those FETs are under-rated, as I posted. That's why I used two; as long as my draw stays under 20A life is good. I have ordered better rated FETs and driver ICs, so the circuit will stay the same but for the addition of the driver IC between the gates and the PWM pin. The demo just ramps up through several levels, good enough for my test purpose. I have a manual step up/down programme still under test. Anyway, that's what I have so far.
|
|
|
|
|
Logged
|
Don't React -- Read!
|
|
|
|
Sweden
Offline
Newbie
Karma: 0
Posts: 23
|
 |
« Reply #26 on: May 25, 2012, 07:56:19 am » |
Thank you very much!
I will be using dual 600v 50Amp mosfets, only expecting to need a total of 30Amps.
KR Magnus
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 24
Posts: 1477
Now, More Than Ever
|
 |
« Reply #27 on: May 26, 2012, 02:38:21 pm » |
OK, I have mounted the motor to the deck and I have the chain on.  I did a test with my new button circuit and the mechanicals all seem good, but my circuit and/or 'sketch' is not 100% +.  Each button goes to hardware debouncing (4093s) and then to respective input pins. The debounced outputs also get diode-OR'd into the hardware interrupt pin. I suppose I ought to wring it out better on the bench with an LED. It's like it's not hitting with each button click. The X button works without fail, but the Accel and Decel skip sometimes or don't register. Maybe it's my buttons. It's my first time with an Interrupt. My 'sketch' follows, feel free to make constructive criticism. byte speed_idx = 0; // byte currentLevel = 0; // comparison byte newLevel = 0; // comparison byte Accel_Btn = 4; // alias - Accelerate btn byte Decel_Btn = 5; // alias - Decelerate btn byte Zeropwr = 6; // alias - "kill" button byte motorpin = 11; // pin alias, PWM to gate/MOT byte Level [6] = {0,20,40,100,175,250}; boolean Detect = false; // Interrupt Note
void setup() { pinMode(motorpin, OUTPUT); pinMode(Zeropwr, INPUT); pinMode(Accel_Btn, INPUT); pinMode(Decel_Btn, INPUT); //Serial.begin(9600); attachInterrupt(0,Activity,RISING); // Ext_Int on D2 }
void loop() { if (Detect == true) { Decode(); } if (currentLevel != newLevel) { analogWrite(motorpin,Level[speed_idx]); currentLevel = newLevel; } }
void Activity() // this is the Interrupt ! { Detect = true; }
void Decode() { Detect = false; // clear out "Detect" if (digitalRead(Zeropwr) == HIGH) { speed_idx = 0; newLevel = 0; //Serial.print((newLevel),DEC); } else if (digitalRead(Accel_Btn) == HIGH) { Accelerate(); } else // Activity detected wasn't Zeropwr or Accel_Btn { Decelerate(); // default = (A' & Z') } }
void Accelerate() { if (speed_idx < 5) { speed_idx ++; } newLevel = Level[speed_idx]; //Serial.print((newLevel),DEC); }
void Decelerate() { if (speed_idx >= 1) { speed_idx --; } newLevel = Level[speed_idx]; //Serial.print((newLevel),DEC); }

|
|
|
|
|
Logged
|
Don't React -- Read!
|
|
|
|
Offline
Edison Member
Karma: 24
Posts: 1477
Now, More Than Ever
|
 |
« Reply #28 on: May 26, 2012, 11:21:37 pm » |
Got it! It was in my void Decode ()Whereas I had if (digitalRead(Zeropwr) == HIGH) { speed_idx = 0; newLevel = 0; } else if (digitalRead(Accel_Btn) == HIGH) { Accelerate(); } else { Decelerate(); }
that last else needed to be an else if (too) if (digitalRead(Zeropwr) == HIGH) { speed_idx = 0; newLevel = 0; } else if (digitalRead(Accel_Btn) == HIGH) { Accelerate(); } else if (digitalReal(Decel_Btn) == HIGH) { Decelerate(); }
Much better - no skipping. I started looking at Keypad.h[/i], but that takes up 7 pins.
|
|
|
|
|
Logged
|
Don't React -- Read!
|
|
|
|
Offline
Edison Member
Karma: 24
Posts: 1477
Now, More Than Ever
|
 |
« Reply #29 on: June 10, 2012, 02:14:28 pm » |
It Works !! It Works !! It's hard to tell from the video, but I have the batteries and the electronics box in an insulated lunch-bag hung around my neck. I was running with those IRLZ14's, but they smoked ("breathe deep the gathering gloom, watch lights fade from every room...") when I tried taking off from a dead-stop. I forgot to put in the 220Ω resistors. As the FETs' failure mode was, once again, Drain-to-Gate short ("You cannot be serious!"), with naught between it and 24V...good ol' D11 went to "Pin Heaven". I replaced those Z14's with some STP40NF10L's. I didn't try accelerating from a dead-stop because I really wanted to go for a ride - which I did (thank you very much.) I can look into that stall current stuff later.  
|
|
|
|
|
Logged
|
Don't React -- Read!
|
|
|
|
|