2018年1月19日星期五

REV Dyno Project

This is my record of our dynamometer project. By saying "our" I mean REV (Rensselaer Electric Vehicle). Our mission is to design, build and race electric cars, and the goal for the racing is efficiency. Therefore, having a device that can measure the physical output of our vehicle is crucial for the development: you need to know how much your car outputs in order to know how efficient it is.

The device that measures the physical quantity (speed and torque) of our vehicle is called dynamometer. It's basically a treadmill for the car. Since our car is custom built, our dyno has to be custom built as well: normal car dyno is way too expensive and way above our needs, yet a bicycle roller trainer is too simple and fragile for our car.

So here comes the design specification: a two-roller dynamometer system that can handle up to 150kg axle weight, 400rpm wheel speed, and 80Nm torque. The system also needs to dissipate approximately 2000w heat produced by the vehicle's physical power output.

Eddy current brake system, after our selection process, is thought to be the most suitable design concept for our need: contactless resistance, adjustable resistance level, and nice heat dissipation.

For the frame, 2x6 wood will be used; these woods can support up to 1 ton of weight under our configuration; it should be good enough for our application.

Here is the frame design:
frame

Yeah I know it looks simple, but simplicity usually means strength and reliability. This wood frame, according to our calculation, can support 1 ton of weight, which is more than enough for what we need. 

Here is the real thing in our shop:
building in progress

finished frame (me on the right)

Even though the work for building the frame seems tiring and tedious, I actually found this part quite interesting. Personally, I love to hand drill holes and cut things (whether wood, plastic or metal) into appropriate shapes; it feels like you are infusing some form soul in the process of building, and the finished product is more than just the sum of its building blocks. 

The next part is the roller part. The rollers are the parts that directly contact the car's rear wheel, and it also serves the function of supporting the car's rear axle. Here is the design:
rollers on frame

As you can see, the rollers are short and thick, this is because we want it to be stable under high rotational speed (400+rpm). The roller material, currently, is stacked basswood plates (0.25 inch thick), since that's the most accessible material for us and it is very easy to manufacture (laser cut). The wood discs will be glued together and there will be 6 steel bolts (see the 6 half-inch holes on the plate) that go across them for extra support. Since the roller is made of stack wood discs, the surface for wheel contact is the outer edge of the discs. This configuration gives us an additional advantage such that we can customize the shape of the outer edge such that we can add extra texture to the surface of the roller, which provides us additional friction for better traction.  

Another suggestion from our mechanic team is using a single piece of the aluminum block -- machine this block down to the shape of a roller plus a shaft. This design will provide additional structural integrity. Personally, I think it is hard and difficult to machine a single piece of aluminum into a specific shape, but I think the mechanic folks have their expertise so I will see how it goes. 

Back to the original roller design. The shaft here is 1-inch steel shaft, which has a theoretical critical speed of 2400rpm under this configuration. At 400rpm wheel speed, the roller speed will be around 1600rpm, which stays safely under 2400rpm. 

The manufacture of this part is not yet done. The result will be posted in later blogs. 

Now let's talk about the eddy current breaking unit. This is the unit that actually produces resistance and eats the power from the vehicle. I will not discuss theory here, and let's jump right into design and manufacture. 

The frame of the unit is a pair of acrylic sheets, which hold all the magnets in place: 
assembly with one frame to show the inside

complete assembly

This is the unit that provides the magnetic flux. There are 12 electromagnets in the unit, each of which can produce up to 0.5T magnet field at 3mm distance. 

system assembly


Two 12 inch aluminum discs (or car brake disc, if we found an appropriate one) will be used as the rotor of this resistance unit; they are the actual handler of the load from the vehicle. The vehicle will drive the rollers, which spin and transfer the kinetic power to these metal discs through an adjustable chain system (not shown in the CAD, but is easy to build), and eddy currents will be induced in the spinning metal discs, which provides the resistance. 

The building of these parts is not yet done. Any progress on the development will be posted in the later blogs. I really want to see this thing running in our shop, testing our vehicles to their very limits. The electronics team and mechanic team will work together to push this project forward.  










2017年11月27日星期一

6-DOF Stewart Platform



It's time for me to document my Stewart Platforms. It's a cool little project that will make you interested in robotics. Actually I modified this project to be my Robotics course's project, and it turns out pretty good. Here is the presentation video, check it out!
[Robotics Project Vlog] Presentation Video

It started out as a personal project, with no particular reason -- I simply want to build something cool, and a Stewart Platform is something cool.

First let's talk about theories, basically the way this thing moves itself. The motion model of Stewart System is based on a concept
called inverse kinematics. The basic idea is that in order to achieve a particular pose, the actuators in the motion link need to be in a desired position. This is different from forward kinematics, which uses the position of actuators in the motion link to derive the pose.

As you can see, in case of Stewart Platform, what we want is to have the upper platform in a desired pose; to get that pose, we use inverse kinematics to calculate what the servo angles should be. This is a natural way of thinking. If we use forward kinematics, the problem will be rediculously hard: there are 6 two-joint-legs that forms 40+ equations for final pose and there are multiple solutions, from which we have to pick one. It's just too hard for somthing like an Arduino to do.

Now we can break the problem into two subproblems: 1. representing the pose of the platform in a way that computer can understand. 2. Calculate lengths of all six legs (and then servo angles) to reach that desired pose.

The first subproblem is relatively simple, it's just a 3D rotation matrix plus a translation vector. The 3D rotation matrix gives you the desired roll-pitch-yaw of the platform, and the translation vector tells you the relative position between the center of the base and the center of the upper moving platform.
Once the pose is fully repersented in matrix form, the next step is to calculate desired leg lengths and servo angle of the actuators (servos). Here I have to mention that this document from U3A Wokingham Math group:
Math of Stewart Platform V5
This document explains the angle calculation step by step, it's clear and straightforward. Be prepare to refresh your trignometry knowledge while reading this document.

Theory part over, let's talk about design. The design has two iterations, and the first one is actually hand drawn and hand made. Thanks to my woodworking skill that the final result is pretty neat.

Here are some pictures of manufacturing:
 ball joints

 rod assembly

assembly 1

assembly 2

assembly done

ball on plate

The first generation turned out to be a success -- it is able to perform 6-DOF (6 degress of freedom) motion as desired. Now the concept has been proved, it's time to do another iteration. 

The next generation has the same design concept, but the manufacture was brought to another level: fully designed in CAD with laser cutting technique for fabrication.  

Doing the CAD model for this thing really refreshed my skill in UGNX, especially the assembly part. 
you really have to build that universal joint and assemble them

full assembly

The assembly is verified in CAD; it looked better than I thought. The next step is to bring this thing to the cutting machine and make a real one. 


laser cut parts

not bad, huh?
Here is this thing doing some motion:

In order to get this thing to do some interesting stuff, I put a resistive touch pad on the top so that it can detect small objects placed on it.

The first idea that came to my mind is doing a PID control to keep a ball on plate. Since the resistive touchpad can detect the position of the ball, it wouldn't be hard to use the two rotation degrees of the system to keep it on the plate.
Here is the video:
[Robotics Project Vlog] PID test

After the PID, I see that there are a lot interesting stuff that I can do with this system, such as a gravity simulator, a flight system simulator, or a course equipment to teach students inverse kinematics. For now I haven't done any of them due time constraint, but I will definitely explore more about what I can do with this thing, and for sure I will build more interesting stuff. Stay tuned!

Here are a few links about similar stuff:
http://fullmotiondynamics.com/
Circular-Base-Stewart-Platform



BLDC Motor Control Road Map

The goal of this blog is to provide a basic roadmap for those who want to learn about BLDC/PMSM motor control theory. The readers are assumed to have basic knowledge about electronics.

The materials mentioned here are arranged from basics to advanced techniques. After finishing the material the reader should have a solid understanding of motor control theory such as commutation algorithm, PWM technique, PID controller, sensorless technique, field oriented control and flux observer.


I don't own any of these material, what I do here is to arrange the stuff in a progressive order so that you can learn smoothly.


For all the materials a rough study plan will be given according to author's learning experience.


Let's get started.


Sensored Commutation:

Brushless DC Motors & Control - How it Works (Part 1 of 2)
Brushless DC Motors & Control - How it Works (Part 2 of 2)
Suggested Learning time: 30 min
The "hello world" of motor control is Hall-sensor based 6 step commutation, and these two videos gives you a taste of how it works.


Sensorless Commutation:

Introduction to InstaSPIN™-BLDC Motor Control Solution
Suggested Learning time: 45 min
If you want to get rid of those sensors and build a more robust system, this video shows you exactly that; it's time to see how sensorless system play a role in motor control applications. 


Motor Control Tips & Guidelines:
The Ten Commandments of Digital Control (part 1)
The Ten Commandments of Digital Control (part 2)
The Ten Commandments of Digital Control (part 3)
The Ten Commandments of Digital Control (part 4)
The Ten Commandments of Digital Control (part 5)
Suggestd Learning time: 2 hrs
These blogs give you a guideline about digital control designs. Before moving to advanced techniques, it's important to refresh the building blocks.


PWM & H-bridge Basics:
So, Which PWM Technique is Best? (Part 1)
So, Which PWM Technique is Best? (Part 2)
So, Which PWM Technique is Best? (Part 3)
So, Which PWM Technique is Best? (Part 4)
So, Which PWM Technique is Best? (Part 5)
So, Which PWM Technique is Best? (Part 6)
So, Which PWM Technique is Best? (Part 7)
Suggested Learning time: 4 hrs
These blogs discussed in detail about PWM techniques for motor control application. PWM and ADC (Analog to Digital Converter) are two essenstial components for motor control, so it's important do know about them before moving to advanced techniques.


FOC (Field Oriented Control) Basics:
Field Oriented Control of Permanent Magnet Motors
Suggested Learning time: 2 hrs
FOC is a widely used motor control technique in industry. This video is a clear and straightforward explanation of field oriented control technique. Do your homework and fully understand this video; then you are in a good position to start learning FOC.


James Mevey's Master Thesis (The big paper for motor control):
SENSORLESS FIELD ORIENTED CONTROL OF BRUSHLESS PERMANENT MAGNET SYNCHRONOUS MOTORS 
Suggested Learning time: 100 hrs
Suggested Learning plan: Read this paper in parallel with motor control side projects or other materials.
This is a comprehensive discussion of FOC motor control technique from start to end. It is not easy to read, and I haven't finished it yet. From what I see, this paper connects all the dots in PMSM/BLDC motor control techniques in a very thoughful manner. If you want to fully understand motor control from the fundamental concepts such as law of physics, read this paper.


Sensorless FOC (Shane Colton's Paper):
Flux Observer-Based Sensorless Field-Oriented Control ofSurface Permanent Magnet Synchronous Motors (Gen. 1)
Suggested Learning time: unknown
First of all, here is Shane Colton's website:
http://scolton.blogspot.com/p/motor-controllers.html
This guy is good at making motor controllers, and by good I really mean GOOD. Check his website for MORE interesting stuff.
This paper discusses flux observer for sensorless FOC control; it's an advanced topic that I haven't done reading yet. What I can say is that the real challenge of FOC technique is its sensorless position estimation, not the FOC itself. If you want to make your theory level match the industry level, the sensorless technique is what you cannot avoid.



Besides the motor control roadmap, I want to mention some other sites that can help you understand or gain interest in motor control:
Teaching Your PI Controller To Behave
TI Motor Blog
VESC - Open Source ESC
ESC32 | AutoQuad
BLHeli32

Other resource links: (will be updated):
http://ww1.microchip.com/downloads/en/AppNotes/01078B.pdf

Have fun with motor controllers!  : )



2017年11月22日星期三

CNC Plotter -- Part 1

It has been a long time since I want to build my own CNC machine. I love to make things, and so I like making things that make things. School's laser cutter is a beefy workhouse, but I can only access it three days a week at specified hours, and that's definitely not enough. I want my own machine.

So here is the plan: build a small-scale 2D CNC routing system, with a third control channel that can do different jobs (laser, pen, spindle...).

After some search, here is one that caught my eye:
PCB Plotter

PCB plotting is a function that I really want to have on my system. Recently I have started doing PCB designs, and it would be nice to have a 30min-turnaround home made PCB prototyping platform.

The the capability of homemade CNC, especially with budget under $500, cannot compete with real commercial CNC machines. What I expect out of my machine is that it can draw lines and shapes on a paper/PCB bare board, can drill holes with acceptable accuracy and precision, and can do some light carving jobs.

Unlike the PCB Plotter shown above, I'm going to use a single-rigid body design for my machine, so that the stiffness is good enough to ensure fine line drawing. The chassis will be made out of 0.5 inch acrylic sheet, since that's the strongest material that I can cut shapes out of.

NEMA17 stepper motors will be used, and the transmission will be timing belt. The lead screw system is too slow for me and the extra force is just beyond the scope of this system.

The software used for this system will be GRBL; this is a nice open source CNC drive software that are perfect for homemade CNC and 3D printers.

This blog is mainly the general discussion of the system. Next part will be the dicussion of CAD design and assembly of this thing. The design is already done. For your curiosity, here is what it looks like in CAD:
model assembly




2017年11月21日星期二

REV BLDC MC V1.0 part 3

The boards comes in, let's check it out.
top

bottom

The board came out nice and clean. The manufacture did a good job on both PCB fab and assembly. Now it's time to take it to the shop for a spin since the software is already done (will be discussed in another blog). 

test day

Safety measure first : ). After that plywood shield is our prototype car for last year : ). And the order from left to right pretty much tells the degree of involvement when building this controller : ). 

The test went out great, actually it's too great. We got this thing spinned up within 20 minutes. Notice this is the first prototype of a PCB with 300+ pins and 100+ parts, with mixed signals, power stages, and communication stuff. It worked nearly right out of the box!!!

first spin up


 
throttle range test

It's been 9 months since our first idea of using DRV8301, and I'd say that the time and effort put into this controller is really what help our team grows.
This is the first time ever that our team designed our own brushless DC motor controller; actually it is the first motor controller that we built and WORKED.

More tests for this board will be performed, such as stress test and spinning different motors. The software will be fine tuned for the best performance. I'm very happy that this thing finally worked. One successful design opens up the door of a thousand more designs, and I'm on my way to get them captured in my work!





REV BLDC MC V1.0 part 2

It has been awhile since my last blog, and I decided to finish this series by the break. So let's do it.

In this blog I will discuss the PCB design of the controller, from schmatic to layout.

The primary component of this motor controller is a DRV8301 MOSFET gate driver. This chip is the connection between logic signal to power stage; what it does is that it takes in the control signal to the microcontroller (3.3/5v logic), and amplify this signal to drive the mosfets. The reason such a driver is required is because power mosfets has gate capacitance which can sink quite a bit of current for some time, plus it is usually 12v; a microcontroller cannot provide such signal power, especially at high frequency.

Besides the gate driving function, DRV8301 also include hardware/software support such as voltage/current protection, current shunt amplifier, mosfet hand shake,SPI communication, overtemperature protection. It also includes a 1.5A buch converter which can be used to power the MCU. (1.5A on such a small chip is quite beefy)

Here is the schematic and design:
Main Driver Circuit

Mosfet Bridge Circuit

The schematic is quite simple; TI (Texas Instruments) has planty of reference designs for this chip and its cousins. Here is a good example

Another source of support that must be mentioned is Duke Electric Vehicle. It is with their inspiration that we decided to use DRV8301 instead of other controllers, and it turns out that this choice is good for long term development.

 The second part, the tricker one, is the layout. 

top side

bottom side

The software used is Diptrace, which gave me a really smooth exprience while doing this design. DRV8301 is specified as a bridge between MCU and MOSFET bridges, so it also has a user friendly pinout: logic input pins on left side, power control pins on the other. As you can see from the top side layout, the traces are kept relatively clustered around IC; there are no long traces that cut across the ground fill. DRV8301 is on the top left corner, and it nicely spreads its traces from right to the power stage and its left pins going down to the MCU (from via throgh the bottom traces). 

On the power stage, it's the copper pours that does all the work. Copper pours are thick and large so that can handle large currents and more heat. Bulk capacitors are kept near the power inputs so the decoupling will be quick and effective. 

Here is a 3D view of the design:
3D model

Some of the components are not shown because the components don't have 3D model; however, this model gives a good idea about how it will look like. 

Part 3 coming soon for those of you who wants to see this thing in real. : )









2017年9月27日星期三

REV BLDC MC V1.0 part 1

This is the controller I designed for my school club Rensselaer Electric Vehicle. (REV) Despite my year-long instest in RC stuff, this is actually the first time I decided to really build some RC stuff. Anyway, this is the first brushless motor controller I designed and built (not yet), the first PCB design experience, the first do-some-embedded-programming since my embedded course, the first...  Ok I'm a CS student (am I?) and it's been a while since my last soldering/building session.

Spec first, our car weighs about 300lbs (driver included), and it requires something like a 500w ebike hub motor to push it, so this would be the design spec:

Voltage: 36v
Continuous Current: 20A
Peak Current (10s): 50A

During the component selection phase, I came accross duke electric vehichles (DEV) website and found their design really useful. Patrick G Grady, The guy who designed their motor controller, is really helpful and gave me some really good advice to start. So here is the major components:

MCU:       Teensy 3.2
Driver:     DRV8301
MOSFET: IPT007N06N (60V/0.75mOhm)

Yeah I know the components can do much more than 20~50A, but why not? I would really like to see this thing doing something 100A or even 200A (then explode) in the future.

Then there is software. Since it's the first design, I decided to use the basic sensored 6-step commutation algorithm. Here are two good videos about it:

Brushless DC Motors & Control - How it Works (Part 1 of 2)
Brushless DC Motors & Control - How it Works (Part 2 of 2)

Since this is for the club I will call it "REV BLDC MC", and this is V1.0. The next part would be PCB schematic and layout. More motor controller stuff comming up in the future.