Pages: 1 [2] 3   Go Down
Author Topic: E-Chopper (ex. Expectations & Torque)  (Read 3744 times)
0 Members and 1 Guest are viewing this topic.
Canada
Offline Offline
Sr. Member
****
Karma: 0
Posts: 318
Sometimes teaching, always learning,
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sweet! Keep us posted on your progress smiley-grin
Logged


Offline Offline
Faraday Member
**
Karma: 65
Posts: 2509
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2509
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Canada
Offline Offline
Sr. Member
****
Karma: 0
Posts: 318
Sometimes teaching, always learning,
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice progress  smiley

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 Offline
Faraday Member
**
Karma: 65
Posts: 2509
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Finland
Offline Offline
Sr. Member
****
Karma: 1
Posts: 270
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Faraday Member
**
Karma: 65
Posts: 2509
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2509
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This coming Monday is our Memorial Day holiday, so I'm taking off Friday and the following Tuesday to work on this more.
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6614
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Sweden
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Faraday Member
**
Karma: 65
Posts: 2509
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Sweden
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you very much!

I will be using dual 600v 50Amp mosfets, only expecting to need a total of 30Amps.

KR
Magnus
Logged

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2509
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Code:
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

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2509
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Got it!
It was in my void Decode ()
Whereas I had
Code:
  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)

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

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2509
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Pages: 1 [2] 3   Go Up
Jump to: