Jump to content

Another DIY Build - Opinions on EBike Hub Motor and Drive


Jason

Recommended Posts

I'm about to pull the trigger on a DIY arduino-based EUC design, and I'd like your opinion before I do so. I'm going to build this off of an Arduino Mega and MPU 6050 IMU. I was considering using a 16" 1000W EBike hub motor and a 48V BLDC Motor Drive controlled through PWM from the arduino.

My questions are around the motor and drive/controller. Ebikes have the "coasting" ability, I'm wondering if this will mechanically prevent me from having control over the unicycle at all times. Are there any considerations I need to keep in mind before going this route?

Also, do any of you have any recommendation for the specific motor drive I should use in this case? I understand it needs to be 4-quadrant to support forward, reverse, and braking.

Thanks!

Link to comment
Share on other sites

3 hours ago, Jason said:

I'm about to pull the trigger on a DIY arduino-based EUC design, and I'd like your opinion before I do so. I'm going to build this off of an Arduino Mega and MPU 6050 IMU. I was considering using a 16" 1000W EBike hub motor and a 48V BLDC Motor Drive controlled through PWM from the arduino.

My questions are around the motor and drive/controller. Ebikes have the "coasting" ability, I'm wondering if this will mechanically prevent me from having control over the unicycle at all times. Are there any considerations I need to keep in mind before going this route?

Also, do any of you have any recommendation for the specific motor drive I should use in this case? I understand it needs to be 4-quadrant to support forward, reverse, and braking.

Thanks!

You might run into trouble with accurately controlling the motor, AFAIK, most if not all wheels use FOC (field-oriented control) to run the motor, which requires relatively many floating point operations, and if memory serves, the ATMegas don't have hardware FPU. This might cause trouble if you can't calculate the transformations fast enough (the 8-bit ATMegas in Arduinos typically run at 16MHz, the typical MCU used in the wheels, 32-bit ARM STM32F103 or something along those lines, runs at 72MHz).

Then again, if you're using a separate motor controller, and give it something like a "target" torque/acceleration/whatever fast enough, it might just work. I played around building a self-balancing robot using an Arduino, an MPU 6050 and a off-the-shelf crappy motor controller (LD293 based or something like that) couple years back, and got it to point where it could stand still with the PID tuned correctly, but kept running into problems with the controller overheating on stall current:

 

Also someone whose username I can't now remember worked on a single-wheel electric skateboard using an Arduino back years ago, but I don't know if he finished it ever. I think he was using some motor controller ending "claw"... Roboclaw?

 

When it comes to coasting, I don't think you'd want to do that on an EUC. I'd think they coast the motor by completely disconnecting the motor phases, ie. the motor's just spinning "freely", try standing on your EUC with the power off to get the idea...  ;)

Any way, good luck on your project! :)  I'd be interested to hear how it turns out, I actually have a 550W Firewheel motor laying around without any current use... :P

 

Link to comment
Share on other sites

Thanks Esaj. I do have access to some higher end controllers, including a 667 MHz ARM-Based SoC with Xilinx Z-7000 FPGA accelerator that I could write Verilog for and convert to Fixed-Point Arithmetic, but I'd like to start with a much less expensive and time consuming "proof of concept" before I do that. I've compiled a decent amount of open source code to probably get me to a similar point as you.

Do you think that there's any issue on using a standard front-hub motor from a ebike conversion? I'm curious how the back-emf from the "coasting" of the vehicle doesn't cause braking, and if there's any mechanical circuitry in there to prevent this. I'm thinking something like this:

https://www.amazon.com/AW-Electric-Bicycle-Front-470RPM/dp/B01C6QZ0IM/ref=pd_sbs_468_3?_encoding=UTF8&pd_rd_i=B01C6QZ0IM&pd_rd_r=0FA21RM24YQFMRZSA6WD&pd_rd_w=ZEUOL&pd_rd_wg=rVLJw&psc=1&refRID=0FA21RM24YQFMRZSA6WD

or

https://www.leafmotor.com/hub-motors/16f-electric-hub-motor.html

Also, for the motor controller, can you recommend any 3-phase, 4-quadrant BLDC motor drives with 48V, 30A, PWM, and hall sensor inputs? I know they use them in the ebike kits so they can't be all that expensive?

Thanks for your response!

 

 

Link to comment
Share on other sites

19 minutes ago, Jason said:

Thanks Esaj. I do have access to some higher end controllers, including a 667 MHz ARM-Based SoC with Xilinx Z-7000 FPGA accelerator that I could write Verilog for and convert to Fixed-Point Arithmetic, but I'd like to start with a much less expensive and time consuming "proof of concept" before I do that. I've compiled a decent amount of open source code to probably get me to a similar point as you.

Do you think that there's any issue on using a standard front-hub motor from a ebike conversion?

Not sure, but I'd think the motors aren't very much different from the EUC-motors, maybe less coils/magnets?

Quote

I'm curious how the back-emf from the "coasting" of the vehicle doesn't cause braking, and if there's any mechanical circuitry in there to prevent this.

If the high- and low-sides of all the half-bridges are open (not conducting), there's no current flowing, so the back-EMF does nothing at that point and the motor's coasting. If you close two or all three low-sides ("turn on"/allow them to conduct), the motor phases get shorted together, and you'll have very strong braking action. AFAIK, regenerative braking is done by alternating between the braking (shorting phases) and then opening one high-side, the high current during braking causes the magnetic field of the coils to grow, and then giving it a path to run through the battery, the inductive voltage should go high enough to charge the battery (for a very brief time, before fields collapse and the voltage drops again). Then you again short the phases to brake more and repeat. Do it fast and you have regenerative braking.

 

Quote

Can't say much about either motor, but could work?

 

Quote

Also, for the motor controller, can you recommend any 3-phase, 4-quadrant BLDC motor drives with 48V, 30A, PWM, and hall sensor inputs? I know they use them in the ebike kits so they can't be all that expensive?

@lizardmech has designed & built an entire custom board with high current motor drive bridges and MCU, I think he used som TI-chip and their InstaSPIN BLDC for running the motor with FOC. Last I remember, he was looking for someone to port the MPU-code for it, check here (it's a long thread though):

 

 

At some point he also suggested this motor controller from TI:  http://www.ti.com/tool/BOOSTXL-DRV8305EVM

I think he also made his own design available publicly somewhere, the part cost might have been around $100 or so...

Quote

Thanks for your response!

No problem, have fun!

Link to comment
Share on other sites

This is great. I found a guy that built his unicycle with the same components I was considering: https://sites.google.com/view/mega-hub-motor-e-unicycle/home

My critical parts are as follows:

1000W BLDC Front E-Bike Hub Motor

Kelly Controller KBS48xxx (Trapezoidal) for low cost or RoboteQ SBL for sinusoidal and FOC if necessary

Arduino Mega

MPU 6050

48V 15 Ah Battery Cell with BMS from E-Bike

+A few safety components (On Switch, Horn, Lights, Fuse).

 

I think this and some open source coding, along with my trustee scope and DMM will get me pretty far. I'm excited to get started!

Link to comment
Share on other sites

2 hours ago, Jason said:

1000W BLDC Front E-Bike Hub Motor

 Kelly Controller KBS48xxx (Trapezoidal) for low cost or RoboteQ SBL for sinusoidal and FOC if necessary

 Arduino Mega

 MPU 6050

 48V 15 Ah Battery Cell with BMS from E-Bike

The thing in your specifications that keeps sending me alarm bells is the 48V battery. There are good reasons that almost all EUC’s have 16 or 20 series cell batteries and I know of none below 15 series cells. 

Whilst, I suspect, the majority of EUC motors are nothing more than modified eBike motors, The big difference between an eBike and an EUC is the torque you need just to balance, something an eBike doesn’t need. As a result It’s going to be biased towards top speed so it’s motor will be wound for a higher Kv. Running on 48 Volts will lower that top speed and power even further (compared with 16 or more cells) so the kV will be even higher to compensate for that.

The torque constant Kt (i.e. how much torque per Amp) is inversely proportional to Kv so a higher Kv lowers the torque constant, requiring more current for the same torque (double the kV and you will need double the current for the same torque) This also lowers efficiency, I.e. under high torque scenarios the efficiency will be lower - those losses will manifest themselves as heat so the motor (and electronics due to the higher current) will get hotter. A 48V Battery, as opposed to a 60V one will also limit just how much current, and therefore torque, can be obtained.

To cut a long story short, using a 48V battery and 48V eBike motor is (IMHO) likely to leave you very low on torque to balance an average weight rider and you will need great care not to faceplant.

Link to comment
Share on other sites

Thanks for the response Keith and good points. Let me check my understanding:

A 1kW ebike bldc motor with a 25 A, 48V controller will comfortably sit at ~1200W at max RPM of 450 rpm. That translates to a torque of 18.7 ft-lb, with near 100% available at very low RPM.

The EUC DIY Guide from Microworks uses a 500W motor at 60V, driving 8.3+ A. If it hits that power at its max RPM (8.11 rotations/second, or 487 rpm), then that translates to a torque of 7.2 ft-lb.

Excuse my ignorance, but what am I missing? I assumed that lower voltage at higher power would mean dramatically more current and thus more torque?

Link to comment
Share on other sites

14 hours ago, Jason said:

This is great. I found a guy that built his unicycle with the same components I was considering: https://sites.google.com/view/mega-hub-motor-e-unicycle/home

My critical parts are as follows:

1000W BLDC Front E-Bike Hub Motor

Kelly Controller KBS48xxx (Trapezoidal) for low cost or RoboteQ SBL for sinusoidal and FOC if necessary

Arduino Mega

MPU 6050

48V 15 Ah Battery Cell with BMS from E-Bike

+A few safety components (On Switch, Horn, Lights, Fuse).

 

I think this and some open source coding, along with my trustee scope and DMM will get me pretty far. I'm excited to get started!

I have seen this guys videos. His unicycle seems to be very hard to ride. And I actually think it is because of the balancing algorithm or the motor torque.

Here you can see him falling out of nowhere.

Link to comment
Share on other sites

1 hour ago, andress said:

I have seen this guys videos. His unicycle seems to be very hard to ride. And I actually think it is because of the balancing algorithm or the motor torque.

Here you can see him falling out of nowhere.

Hard to tell from the video, but it looks like he's leaning back, and then the wheel loses power? Overvoltage protection on batteries triggering with braking causing too high voltage? Just guessing really...

Link to comment
Share on other sites

Please feel free to ignore me, but might I suggest you do something better than what is available today in the EUC market and probably save yourself a ton of trouble and expense. 

I don't know if you have heard of these things called drones? OK - I'm joking about that part, but the brains that fly modern multirotors can do really amazing things, and they use very modern electronics and cost very little thanks to popularity. Best of all there is opensource firmware on these that allow you to use the same brain to control anything from a single motor on up to, well I have not idea what the upper limit is and they can be used for ground or air vehicles and fully tune your PIDs and more to gain the levels of control needed. Some of the older brains can be had for under $15, newer and faster "flight controllers" can get more spendy. They can use PWM to feed your motor controller (electronic speed control, ESC), or better yet use one of the much faster methods of communication with the ESC. 

I'm no expert in this arena, but I think you would be able to achieve everything needed for minimal expense and trouble. The ESC will be your largest hurdle and power management. Her is a rough idea of the size and features of what these little brains pack:

https://alofthobbies.com/dys-f4-pro.html

There are tons of these available. The F4 boards are pretty amazing, but I think you would be fine with an old $15 board in all honesty. You will only be using a single axis from the built in gyro. The improvements on the F3 and F4 boards would not amount to much on an EUC application as I doubt you will find a fast enough ESC to control the hub motor anyhow. 

 

Anyhow, might be worth looking into.. There are many of these, and they can be tailored to many, many uses. P.S. the one I linked to is pretty large compared to some. The whole thing can be about the size of a dime if you like.

DYSF4.png

Link to comment
Share on other sites

  • 2 weeks later...

I got the "scale" self balancing robot up and running, and it balances (kinda). I'm going to spend some time to refine this before I scale to the EUC. Thanks for the help!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...