Friday, July 6, 2012

KiwiAC driving Switch EV Induction motor … Part 2: Motor Control

Following on from our bench testing earlier in June, Switch EV have installed their motor into their test vehicle and undergone some driveway testing. Sorry no video or photos this time, just output logs turned into pretty graphs (go LibreOffice!)
At the most basic level we are controlling motor current. Our serial output is not fast enough to report every current measurement (two performed every 12kHz), but we can see if the current is behaving within the region we expect. First we can compare the requested current output magnitude, vs raw, directly sampled phase currents. The vertical axis is a signed internal scale, where 32700 is approximately 1000 Amps.
Here you can see that every reported current is within the magnitude requested. Because of stroboscopic effects, (sampling windows and AC sinusoidal waveforms etc) it is expected that we would see values less than requested current.

Delving into the Motor Model at the heart of Field Oriented Control, we can check that the two current vectors, (magnetic flux producing Id and torque producing Iq) are controlling:  

Here, the error between requested Id and Iq are plotted as DId and Diq. The error is around 1%, which equates to a output Torque error of about 0.01% (output Torque is proportional to motor flux times torque current).
At the moment, we are controlling Flux and Torque to equal throttle position (thick grey line). Flux (the green line) should always be positive however, (as two negative numbers would multiply to a positive torque). We have set the throttle zero position to produce regen torque, to approximate engine braking, but only while moving. You can see at 175 seconds when the vehicle was stopped that the torque and flux trending to zero, no longer following the throttle position. A small acceleration occurs from 184-193 seconds, and a much greater one at 205 seconds.

This final graph shows power in the controllers DC bus, versus the calculated mechanical motor power (estimated torque times motor speed) and an estimation of the inverter and motor AC conduction losses. At the time the car was traversing undulating terrain, so change in speed does not correspond that well to delivered power.
Finally, a big thanks to Lachlan for putting together the data extraction scripts that made these graphs possible and to Switch EV for building such a great EV!
Stay tuned, driving videos coming soon...

Sunday, June 10, 2012

KiwiAC driving Switch EV Induction motor

We have recently been helping to commission a new induction motor made be Switch EV (a NZ manufacturer).  We are pretty happy with the results so far and hope to be showing vehicle based dyno (dynamometer) results in the near future. For now though, here are some videos and images to whet your appetite.

The motor shown is being driven via a Gen 1 SKAI with a Greenstage KiwiAC control board and a 330V Lithium Iron Phosphate battery pack providing the energy.




As you can see the brake rotor on the dyno gets quite hot (hence the smoke!), it is absorbing the energy from the motor when we load it up to measure the torque.


Zero RPM torque tests showed we were achieving in excess of 600 Nm, which is "heaps" of torque and matching nicely with design goals.  Unfortunately the dyno didn't quite measure up and soon after we snapped the shear pin on the shaft.


Never mind, the dyno did its job and the Switch EV motor is ready for the next stage!  Stay tuned for more information...

Wednesday, April 11, 2012

Dyno Progress

For a while now we had the plan to build a dynamometer out of two Siemens made Ford Ranger AC motors. While no calibrated results could be made (through measuring the torque directly) the contraption would be very useful for comparative analysis of motor control regimes and settings.

The first steps (October last year) involved working out how to couple the two together. The motor shaft is hollow to allow a further shaft to run directly through the motor. The output end of the shaft has a helical gear directly machined into it, for a now unavailable planetary gear set. Others have suggested directly welding to the shaft, some have success using taper-lock devices directly on the gear.

In our situation, because of its non-critical nature (a failure is not likely to put anyone in a compromised situation), we decided to go with another untested route – developing a bush that works somewhat like an inside out double ended collet holder. Made of brass it may not be as strong as the rest of the equipment, but simple to make on the lathe, and not likely to damage the motors for future applications.

As previously mentioned Stephen designed and organised an adaptor plate for bolting the motors together. The motors are now coupled, and spinning just about as freely as individually so must be fairly close to aligned.

Due to the weight of the combined motors (over 130kg) we wanted to be able to wheel them around. We started to think about building a trolley but instead opted for far cheaper and easier option - a 200kg rated handcart.
Next came the job of hooking up the motor encoder and temperature sensors. Reportedly there isn't a plug available for the encoder connector on the motor, so a new arrangement is required. 
We made a stainless piece that reduces the hole to suit the M23 servo-motor style encoder connector used on standard Siemens motors.

 I don't think that the plastic connectors that the motors are delivered with were originally part of the plan. The tapped hole for the closest cover bolt breaks through into the hole for the connector. Worse still, an o-ring seal sits beyond where the bolt hole breaks through, which means the o-ring is damaged every time the fitting is removed or put back in. Not a clever design, but we will run with it for the mean time.

Tuesday, April 10, 2012

SolarNode web configuration

Matt has been improving the usability of the SolarNode and SolarNetwork software and as a result, SolarNodes now support web based configuration!  Check it out:



Friday, March 16, 2012

A little bit of fabrication

Over the last couple of months there have been a few changes to accommodate the new race battery pack in the GS750V and to brace the motor appropriately as we head towards full torque output.  Below you can see the new brackets that prevent the motor's aluminium body from carrying all the torque and they also provide a new mounting point for the the inverter just above the motor.

Multi purpose bracing brackets

In addition to that, we have put together our dual motor dyno ready for fine tuning of the motor control algorithms under development in the Tumanako project.

Dyno for motor tuning

Big thanks to Stephen for driving the details and making this happen and also to the Spaceships crew and PureAdvantage for the support along the way.  Thanks also to the fine Engineering work and support provided by Abel Metal Products, Primero Profiles, Tordeich Engineering and Ladarac.

We are now ready for the batteries!

Monday, February 13, 2012

Introductions, and expansion on minimalist Debian 6 SolarNode setup

This is my first post on the Greenstage blog, so a brief introduction is in order. I've been developing the SolarNetwork platform since meeting John Gorman in mid-2008. I was already interested in renewable energy, and a proponent of open source software, so SolarNetwork was a natural fit. John introduced me to Philip Court later that year, and eventually we joined forces formally as Greenstage Power, Ltd. with myself as CTO. SolarNetwork has already evolved considerably in many exciting ways over these past few years, and I look forward to seeing where the future takes it.

As for the original impetus for this post, I've expanded on Philip's previous post on setting up Debian 6 for a SolarNode on an eBox 3300 mini computer. Some of the improvements in this guide are:
  • Stock i386 Debian kernel used
  • OpenNTPD for time synchronization (instead of usual ntpd)
  • Monit for process monitoring
  • busybox-syslogd in-memory cyclic syslog
  • SolarNode platform uses a ramdisk for logging, temporary files, and the embedded database
These last two points greatly reduce the number of writes the system performs on disk, with the idea of reducing writes to the flash-based media used as the system's main filesystem.

The guide is available on the SolarNetwork Wiki. The entire system described by that guide is also available as a downloadable disk image that you can easily copy to a SD card or USB stick.

Sunday, January 15, 2012

Minimal Debian install on a Vortex86

For our SolarNode installations (part of the SolarNetwork) we use a minicomputer with a Vortex86.  This is a system on chip (SoC) x86 compatible CPU which has all the bells and whistles on one piece of silicon.

JrMX with Vortex86 inside
We had until recently been installing a standard Ubuntu distribution which was working very nicely.  Problem was this distribution was full of many unneeded software modules.

Over the break I finally got around to sorting out a bare bones installation that only contains what we need (no GUI required!).  Not only does this increase performance and reduce disk space requirements, but it enhances security by keeping deployed software to a minimum (less software equals less security updates).

Here is the process we have used to build a bare bones SD boot image with the latest native WiFi support (no ndiswrapper here) on a Norhtec JrMX.  Read on... 

First up: Find yourself an Ubuntu or Debian based PC to prepare your bootable SD card.  Make sure you have unetbootin or similar installed (usefull for creating a bootable SD or USB stick from an iso).

# sudo apt-get install unetbootin

Use unetbootin to create a bootable SD card (I used a 4GB) using this Debian squeeze mini iso.

Now boot the JrMX (with network cable connected) from the freshly made bootable SD card and complete the installation process (could take a while with lots of downloading).

Once finished, there will likely be some additional packages you will want to install e.g. ssh-server, ntp, wicd, wicd-curses etc.

# apt-get install ssh-server
# apt-get install ntp
# apt-get install wicd
# apt-get install wicd-curses

FYI: We use wicd-curses to configure WiFi from command line (instead of the NetworkManager GUI or similar).

Now, get Ready for the Kernel upgrade and WiFi driver install...

Squirt the stuff (Kernel and WiFi Driver) across to the JrMX from your desktop (connected using network cable at this point in time).
e.g.

$ scp linux-image-2.6.34.10-vortex86-sg_1.2_i386.zip  philipc@10.1.1.11:
$ scp RTL8188_8192SU_usb_linux_v2.6.6.0.20110401.zip philipc@10.1.1.11:


Now, on the JrMX box (ssh in or login using physical keyboard and monitor), install the new kernel and the kernel headers:

# unzip linux-image-2.6.34.10-vortex86-sg_1.2_i386.zip
# dpkg -i linux-image-2.6.34.10-vortex86-sg_1.2_i386.deb
# dpkg -i linux-headers-2.6.34.10-vortex86-sg_1.2_i386.deb


Now Install RTL8188SU Linux driver (for WiFi), but first we need to sort out the missing build link to the header source files:

# rmdir -–ignore-fail-on-non-empty /lib/modules/2.6.34.10-vortex86-sg/build
# ln -sf /usr/src/linux-headers-2.6.34.10-vortex86-sg /lib/modules/2.6.34.10-vortex86-sg/build

Download and unzip the latest RTL8188SU driver (which is actually the same as RTL8192SU driver).  The one I specifically used is here, or you can get it from the realtek site. 

#unzip RTL8188_8192SU_usb_linux_v2.6.6.0.20110401.zip

Note: This works great, but readme instructions from the older rtl8188_8192.zip (this one is from the robosavvy site) are much more informative.  Follow the readme instructions which are summarised below ('make' and 'make install' basically)...

Note: You will also need the following to build the drivers (if you want, remove with apt-get remove at the end):

# apt-get install build-essential

Extract, build and install WiFi drvier from unzipped source dir
:

# cd rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/driver
# tar -xzf rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401.tar.gz
# cd rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401
# make

  ...
  Building modules, stage 2.

  MODPOST 1 modules
  CC      /home/solar/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/8712u.mod.o
  LD [M]  /home/solar/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/8712u.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.34.10-vortex86-sg'


# make install
install -p -m 644 8712u.ko  /lib/modules/2.6.34.10-vortex86-sg/kernel/drivers/net/wireless/
/sbin/depmod -a 2.6.34.10-vortex86-sg


# shutdown -r now


NOW LETS GET THAT WiFi GOING!


Check a few things:

# ifconfig wlan0 up
# iwlist wlan0 scan
# iwconfig


Configure the WiFi connection (use wicd-curses, it's like NetworkManager, but a command line tool! Just follow your nose...)

#wicd-curses

Yea Ha!!!! It all works :)

You may want to turn off a few other things as well, but this is a great starting point for a minimal install.

Enjoy!

Note: Please make sure you see Matt's update on this post as well.