I have previously written about my RepRap build, now its starting to come together. The last part I need before i can make my first print is the hotend that I’ve ordered from www.hotends.com
I use a RAMPS 1.4 board that, I ordered from 3D Gadgets, to control the stepper motors. RAMPS is an Arduino based RepRap controller that you can flash with several different firmwares. My first try was Marlin which seems to work fine. Since I dont have any hotend and temperature sensor I had to make some firmware hacks to get the thing moving. But I did!
And some picture of how it looks right now.
My RepRap including motors and RAMPS controller. It’s just put together to see if it works.
The steppers are pretty small but I got them very cheap. Let’s hope the have enough power not to loose steps while printing. A worst case solution could be to crank up the current and put heatsinks on them, or just buy bigger ones.
The RAMPS (RepRap Arduino Mega Pololu Shield) 1.4 controller loaded with Marlin firmware.
RAMPS 1.4 have 5 Pololu stepper drivers to be able to control X, Y, Z, E0 & E1.I only use one extruder and the Z axis have two motors connected in paralell on one of the driver. Maybe I’ll change the firmware so I can use one driver for each motor instead, but I don’t think that is necessary right now since the load on the Z-axis is very low.
One of the stepper motors controlling the Z-axis
The motor controlling the Y-axis
The carriage and extruder moving in the X-axis
Each axis have a mechanical microswitch for endstop.
Right now I only have 3 endstops which is enough for the controller to find the home position (coordinate 0, 0, 0). It’s probably safer to have 6 endstops, one for each end of each axis, maybe I’ll add 3 more in the future.
The extruder which push the plastic filament through the hotend
Top view of the extruder, you could see the hobbed bolt inside which grips the filament
Lego Technic is perfect for creating quick prototypes of pretty much anything, combine this with RC stuff and you can create really fun stuff. One simple example is the robot i describe in this post: Sunday afternoon robot
My old Lego is usually stuffed away in a box in the basement, but when we have kids visiting we usually bring it up to the apartment. I suspect I’m the one enjoying it most and this time I built a RC lego car
From the side
The motor and propeller us used as a pusher
The battery, ESC and receiver is secured with a rubber band
I use a HXT900 servo to steer
After a few testruns I added a propeller protection bar to minimize the risk of running into something with the propeller.
Runs great, I’ll probably update this post with a video when I’ve recorded one.
A little while since the last post, this is maybe old information if you have read my posts on Endless Sphere or the Swedish Electronics Forum. We played around for the whole weekend with the moped until the motor got enough. My guess is that several hard accelerations during a short period of time heated the stator enough for the insulation to melt.
The black insides of a BLDC motor
Not pretty! I’m afraid I’ll have to torment my hands with another rewind. A member on SEF is good enough to donate a large roll of 1,5 x 2,5 mm flat copper wire to me which I will use for the rewind. I have three different actions to prevent this from happening again.
Increase the gear ratio. Less torque on the motor means less current.
Increase kv, one less turn of copper wire will increase kv to match the higher gear ration and reduce the resistance. It will also leave more room for air to flow through the motor
Forced cooling, I’ll put a fan in one end of the motor to force more air through.
I’ve also ordered a spare motor from china. The 80-100 is very hard to get nowdays, but I found a 80-85 motor with the same mounting profile and axle. But i’ll keep a close watch on the stock of the 80-100 motor.
As I’ve written before I had problems getting the Turnigy motor to run in sensored mode using the modified cheap-o eBay controller. Just to se if It’s the controller that is the problem I’ve tried the motor with my e-bike controller.
It works perfect! Turns slow and have lots of starting torque. I didn’t try more than 15%-20% throttle and the battery was empty in my current meter so I could’t measure the current. I will try full throttle and measure the current as soon as I’ve got a new battery.
The motor looks much neater with the internal sensors than the external I think I’ll paint it black to match the black moped when I’ve epoxied the stator and not going to take it apart again.
The motor looks much better with the sensors mounted internally
This is a picture of the rewound stator. As described un the previous post the stator is now wound for ~90 rpm/V using double 1.5 mm copper wire. To hold the windings in place I use some dabs of low temperature heat glue. This will most certainly melt if I would put 3 kW of power through the motor, but I will replace the heat glue with high-temp epoxy when I know that everything works.
The stator has been rewound with double strands of 1.5 mm copper . The heat glue is just to hold the windings in place while testing. Before using the motor under heavy load, the heat glue will be replaced by epoxy.
The motor is wound as an Distributed LRK (DLRK) and terminated in Y-mode. Using the notation from the picture below, S1, S2 and S3 are connected to the motor controller and E1, E2 and E3 are soldered together inside the motor.
The DLRK winding scheme. I've connected E1, E2 and E3 together and use S1, S2 and S3 as phase wires for a Y-termination. The sensors are mounted between 1 & 2, 5 & 6 and 9 & 10.
In the previous post I used ATS177 sensord mounted in a bracket outside the motor. This didn’t work very well with the modified controller. This itme I will try SS441A hall sensors, which are more expensive but thats the sensor that is usually recommended on the Endless Sphere Forum. I will also try to mount the sensors inside the motor which I hope will be more robust and better looking. The sensors are mounted between slot 1 & 2, 5 & 6 and 9 & 10. Which gives them 120° spacing. To hold them in place before applying epoxy I use the same low-temp heat glue and a little kapton tape.
The sensors is mounted between two teeth of the same phase on the motor, all three sensors are 120° apart. To hold them in place I applied a small dab of hot glue and some kapton tape (the brownish tape in the image)
When I tried this setup with the modified controller it still didn’t run in sensored mode which leads me to suspect that there may be something wrong with this controller. I didn’t have time to do any thorough investigations why but my next step will be to inspect the sensor signals on the oscilloscope and try the motor on my other controller which doesn’t run at all without sensors.
The original phase wires (wires between the motor and controller) on my E-bike are way to thin for the currents they are handling. When I got the motor was equipped with 2 m long 1,5 mm² cables. In low-speed-high-torque situations for example steep hills or starts from a standstill the currents in the phase cable can be several times the battery current. My controller limits the battery current to 27 A but the phase current could sometimes approach 100 A. Doing some calculations with the resistivity ρ=1.68•10-8 Ωm giving the original cables a resistance of
Judging by the color I’m not really sure that the original cables are made of copper. They could just as well be made of some other metal which would result in even higher resistance. With the 2 m cables the current path to/from the motor is 4 m and the resistance (excluding the motor resistance) is about
This may seem pretty low but when constantly running 100 A through this cable the voltage drop on the cables will be ~4,5 V and the losses will be about 450W. This would of course instantly cook the cables and luckily enough the current to the motor is not constant and this current levels will only appear for short periods of time at very low speeds.
Anyways, I decided to replace these cables for the thickest I could fit into the axle where the cables are fed into the motor, as well as shortening these cables as much as possible. What I’ve read is that 12 AWG cables (3.31 mm²) is the thickest you could get through the axle without stripping the insulation and adding something thinner. The original cables have a PTFE insulation which I think is a good idea since PTFE cables generally have thin insulation and is very resistant to heat and mechanical wear. I ordered a couple of meters of 12 AWG PTFE cable from Apex Jr which was tho only place I could find that sold this dimension of wires online in small quantities. This cables are definitely made of tin plated copper which can be seen on the cut surfaces.
Comparison of original and new phase wires
Doing the same calculations with the new shorter and thicker cables
This will result in a voltage drop of 0.5 V and 50 W losses at 100A which is much more manageable. I guess this will give me some additional efficiency but its probably unnecessary with the current performance of my controller. Later this summer there will probably be a post about re-programming current limits and eventually upgrading the MOSFETs of my controller.
Taking the motor apart was easy, I first removed the side cover on the cable-side by removing the nine hex screws and then used a knife to cut the glue and pry the cover off. Before I did this I made a mark on both the cover and the hub so I can put it back exactly the same way. I’m not sure what tolerances are used when manufacturing these but I don’t want to risk a wobbly wheel.
This is what the motor looked like when one of the covers was removed.
Getting the wires through the axle was hard work and took me more than an hour, the method that worked for me was to put a thin wire through and the used it to pull through the phase and hall wires all at once. It helped a lot to grease the wires with soap to get them through. I kept the original hall sensor wires.
After installing sensors in the Turnigy 80-100 motor I needed a high current sensored BLDC controller. Since I’ve decided to use a 12 S LiPo battery the maximum voltage of the newly charged battery is 50,4 V with a nominal voltage of 44,4 V. Most high power e-bike controllers are designed to operate on >72 V and are quite large.
When i find the time I will build my own controller but for now, I want to modify a small 48 V 350 W controller, that I bought for $25 from eBay, into something that is a lot more powerful. The key to increase power handling capability is to decrease the heat losses under high power. As a side effect, more of the energy in the battery will be used to move the bike and less to heat the controller.
the modification is done in a couple of steps described below.
The controller originally contained six STP75NF75 MOSFET which can handle a voltage of 75 V and (according to the datasheet) 75 A. The typical resistance when turned on is 10 mΩ which is quite high. Realistically I think six of these is capable of handling ~15 A continuously with decent cooling. I’m not even sure if they are genuine and 48 V 350 W will be ~7 A so the original controller isn’t really pushing them.
Close up shot of controller motherboard. You could see that I've replaced the MOSFETs with IRFB3006 and that a STM8 processor powers the controller. SOMETHING WENT TERRIBLY WRONG WITH THIS IMAGE! I WILL FIX THIS.
Instead i will use six IRFB3006 which can handle 60 V and up to 195 A (again, according to the datasheet). The silicon could actually handle up to 270 A but the wire bonds between the silicon and the case limits this to 195 A. The typical on-resistnance on these are 2 mΩ, five times lower than the original FETs! Another popular transistor to use when modding e-bike controllers is the IRFB4110 which is capable of handling 100 V but not as much current as the IRFB3006.
The original high current PCB traces of the controller had some extra solder on them to increase the current capabilities. To increase this even further i added 3×1.5 mm copper wire to these traces. Compared to copper, solder is a pretty bad conductor so this will decrease losses and heating under high currents considerably.
The PCB traces carrying high current are upgraded with 3 x 1.5 mm copper wire.
There was one problem with this, copper and PCB laminate have different Coefficients of Linear Thermal Expansion, a view from the side reveals that the board got a little curved when soldering. I hope this doesn’t break anything.
The copper wires shrink when they cool down after soldering
The wimpy phase and battery wires on the original controller is replaced with 6 mm² wire instead to handle he increased current. And a lot of the special function wires on the controller are removed. I only need the throttle and brake inputs.
Modify the current shunt
When I ordered this controller I was pretty sure that it were based on the Infineon XC846 ship as most china-made e-bike controllers are. These controllers can have the current limit and many other properties changed in software by connecting your computer ti the controller. Instead this controller is based on a STM8 microcontroller, maybe this is programmable but I haven’t found any information on how.
Instead of programming I can increase the current limit by decreasing the resistance of the current shunt. The processor measures the voltage drop across a short bit of wire with a known resistance to determine how much current the motor uses. If I for example decrease the resistance of this wire to half, the current will be twice of what the processor thinks.
The ordinary current shunt (the curved silver wire) are paralleled with a thicker and shorter copper wire to decrease resistance.
Today I recorded two videos running the motor. The first one is just running the motor in sensorless mode. I actually got it running once in sensored mode but as soon as I started adjusting the sensor angle the controller fell back into sensorless mode. The throttle in this video is a tired 10k trimpot hence the uneven throttle signal.
I also made a small load test just holding the motor. In this video the motor is run on the lowest speed possible in sensorless mode. The battery used in this clip had a voltage of 46 V. Since the currentmeter maxes out at 5,5 A the load power I created is somewhere around 250 W
The Turnigy 80-100 is a electric motor sold by Hobby King to replace gas engines in large RC aircrafts. To use this motor in my application two things have to be modified. Installing hall-sensors and re-winding the motor for lower speed. This motor is a BrushLess Direct Current (BLDC) outrunner. This means a couple of things:
The motor does not have brushes like an ordinary DC motor. Instead the commutation (switching the current direction the motor windings) is done electronically with high power semiconductors (most commonly MOSFETs)
It runs on DC power which is a little confusing since the motor actually is a 3-phase AC motor. But the motor+controller runs on DC.
Outrunner means that the motor shell is rotating while the center is static. The center of the motor contains the windings and stator core while the outer bell with permanent magnets are rotating.
Since the commutation is done electronically the motor controller must know when to switch direction of the current. This is done in one of two ways:
The motor is fitted with 3 hall-sensors which sense changes in the magnetic field of the rotor
Since only 2 of 3 phases of the motor are energized the motor back-emf can be measured on the third terminal to determine rotor position.
This motor is intended to be used with a sensorless controller and has no hall-sensors. A sensorless controller need to spin the motor up to ~10% of maximum rpm in synchronous mode before the back-emf is large enough to measure. Below this speed the torque isn’t very high which works fine for a propeller drive but not on a moped where full torque is required from 0 rpm.
In general BLDC motors and controllers intended for RC toys are sensorless and use sensorless controllers while motors and controllers for E-bikes are sensored. There are exceptions from this but it’s good to know since a sensored controller will not work with a sensorless motor, the other way around could work but the low-speed performance will probably be bad and there is a risk of damaging the motor and/or controller.
To get good starting torque and be able to use an ordinary e-bike controller I mounted hall sensors on my motor. This process is well described in a thread on the Endless Sphere forum:
To summarize the +20 pages thread there are two ways of doing this
Internal sensors are mounted between the stator teeth at 120° spacing
External sensors are mounted on a bracket outside of the bell, this uses the magnetic flux leakage to sense the magnets on the other side of the bell.
Another problem with using the motor in it’s original configuration is the Kv value. This is the constant that determines the motor maximum speed based on the input voltage. For example a Kv value of 1000 rpm/V will result in a maximum speed of 12000 rpm with a 12 V battery. This value depend on several properties on the motor but you can say that it represents the coupling between the current and the magnets. More turns of wire around the stator and/or stronger magnets will reduce the Kv value. The Kv value is also dependent on if the motor is terminated in wye or delta. The same motor have a Kv that is sqrt(3) = ~1,73 times higher if it’s connected in delta than if it is connected in wye.
When I bought this motor it had a Kv of 180 rpm/V and I want it to be ~90 rpm/V. Each stator tooth had 6 turns of copper wire around and the motor where coupled in delta mode. By rewinding the motor with 7 turns on each stator pole and couple the motor in wye instead the resulting Kv is somewhere around
This is not an exact calculation since it depends on flux density, magnetic saturation of the stator iron and so forth but it will giva a hint. As i calculated in a previous post, this is enough for ~60 km/h using the same 44.4 V battery as I use on my E-MTB.
There is a thread on Endless Sphere about rewinding this motor as well Re-wind of a Turnigy 80/100
Rewinding a motor is a tough job but the original winding is done with many parallel thin wires and in a pretty sloppy way. Instead, I used two parallel strands of 1.5 mm copper and it ended up almost as sloppy as before. I seem to have misplaced the photo of the stator with windings before the re-wind but it looked very similar to the pictures in the first post of the thread above. This is how it looked when i were done.
[Will replace with photo next time i disassemble the motor]
When mounting the sensors I choose the method of mounting them externaly. I used a CAD program to draw this mounting bracket.
Drawing of sensor bracket
Mounting the sensors 17,14° apart instead of 120° works because the motor have 14 magnet poles.
A nice guy on a The Swedish electronics forum helped me print two brackets on his 3D-printer and they turned out great!
Plastic sensor brackets printed on 3D Printer
With wires mounted on the sensors and the sensors temporarily glued in with heat glue (I’ll use epoxy when i know that it works).
Sensors mounted in bracket
In the pictures above the motor is mounted on a plate that i made to test this way of mounting the sensors. Just to get it running I used a Hobbyking SS Series 190-200A ESC after the rewind this controller had a tough time getting this motor running. Using a 3S LiPo battery it managed to get the motor into closed loop back-emf sensing mod about one time out of ten. With a 6S LiPo it worked perfect and had loads of power! The no-load current consumption was slightly over 1 A, which is great but mostly dependent on that I didn’t re-install the skirt bearing. This motor have been reported to have a no-load current of ~9 A with the skirt bearing and coupled in delta. I also measured the Kv constant to ~89 rpm/V exactly as calculated.
My next post on this project will be about my modified eBay cheapo e-bike controller and hopefully a video of the motor running in sensored mode.