Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
Preliminary Doc
Hi everyone
Here is the text of my first cut at a manual .. of sorts ... for Paul's AC controller.
Take a read if you have some time. Looking for some constructive criticism to make it better .. along with a location to post the version after i get some pictures and perhaps video added.
Can you put pictures and video in a WIKI? Maybe as part of the GitHub repository?
----------------------------------------------------------------------------------
Introduction
This scope of this document covers power up of a tested AC Controller, cable locations, general wiring, using a computer to configure the AC Controller, and tuning of the controller to work with a specific motor at a specific voltage.
The description is not step-by-step. There are likely things further in the description that would be nice to know before you start. So I recommend reading through the whole document before you start. The AC Controller is quite robust, but it does not protect itself from all mistakes.
This document will be updated by many authors. Keep in mind that everyone interprets things differently, and that what made perfect sense to the person describing what was done ... may not make perfect sense to you.
The AC Controller
The contoller board that I am using is shown below
PICTURE OF AC CONTROLLER BOARD
The various connectors that interface outside the controller are labeled.
With nothing else connected (throttle, Battery pack, contactors) apply 12V from a battery or a power supply to the DC/DC converter. This supplies 24V to the controller board and the IGBT drivers. I have a 5A fuse on the 24V output of the DC/DC converter and a 10A self-resetting breaker on the 12V input to the DC/DC converter.
When you power up the 12V, you should hear a click from the pre-charge relay. About 5 seconds later the main contactor relay should click on and the pre-charge relay should click off. This is your first milestone.
If you have trouble getting any click at all, check the appendix for troubleshooting.
Turn off the AC Controller
Computer Interface
After the relays are working, it is time to connect your computer to the controller. This is not absolutely required. You can skip this part and still get everything running. But you can' change anything without the computer. If your controller is already set up, the serial output is still useful to point out what is not running.
Power down the AC Controller
Power up your computer. Connected to the controller with a serial cable. If you are suing a 9 pin serial connector, the cable wiring is shown below
This works for an expernal USB to serial converter as well.
Using whichever terminal program you choose, connect to the serial port at 115,200 baud, no parity, 8 data bits, 1 stop bit
I use hyperterm. My USB to serial converter is at COM7. And I use the VT100 emulator built into hyperterm. These are just selections when you open a connection in hyperterminal.
When your terminal program is connected, power up the controller. The relays click for precharge and main contactor. Then you should see this on your terminal
AC Controller version 1.0
It should also show an error for the throttle, that it is lower than minimum, and ask if it is connected. But it is not, not yet.
This is your second milestone.
If you have trouble getting anything to display, check the appendix for troubleshooting.
you should be able to type in commands. config and return will show you how your controller is configured right now. there are a lot of settings, but the defaults are all reasonable and you don't need to even know what they are for unless you need to change them.
my controller looks like this
Turn off the controller.
Now it's time to connect your throttle. My board is set for 0 - 5K ohms input, 0 = stop and 5K = max speed. I have one end of the throttle connected to 5V, the other to 0V and the wiper connected to the throttle input. These are all on the 3 pin header as labeled.
With an ohm-meter, you should be able to figure out which way your throttle works. We are not using the relay contacts on the throttle if you have them.
Power up your controller. You should hear the clicks, see the AC Controller version 1.0 message, and there should not be a throttle error.
Now we are going to check out the throttle signal. type in these commands, one line at a time, with an ENTER after each one
After the last one, lines will start to scroll on your terminal and will look something like this
We are looking at the raw throttle signal, a number from 0 - 1023 that represents 0V - 5.0V and the scaled throttle signal, which is a number from -16000 to +16000 which is sent to the controller algorithm, which converts that to the pulses sent out to the motor.
When you change your throttle, the numbers change. It is a good idea to write down what the raw throttle signal is when the throttle is released and when it is at maximum. This value will change a little bit with temperature, and over time. So we don't use that number EXACTLY.
Here are my numbers. I set up my throttle for single direction (the motor won't go reverse at all) which is good for a manual transmission that has a reverse gear.
Minimum 121
Maximum 968
So with these numbers, I changed the settings below
Fault
Max rev
Min rev
Min fwd
Max fwd
So of the throttle signal is below fault, the controller shuts off and the motor coasts
Between Fault and Max rev it runs at maximum reverse. I don't want reverse, so I put Max rev below Fault
Min rev is also below Fault
Anything between Fault and Min Fwd does nothing. It is coast
And between Min Fwd and Max Fwd is a linear increase in torque (NOT SPEED) for the motor. You can go over your max speed if you are going downhill. This is kind of important to remember
SAVE
The changes in the configuration are now saved.
If you want to check the output of the controller, you can put your voltmeter, on the AC range that you have that is safe for 24VAC (I use 200VAC range on mine) and connect it on the posts of one IGBT as circled below
When you press the throttle it should change from 0V to some higher voltage. The value is not really important, but it should change for a couple of seconds when you press the throttle.
This is your third milestone. The controller is putting out control signals.
If you have trouble getting any voltage output, check the appendix for troubleshooting.
Turn off the controller
Now we connect your battery pack. It needs to be at least 24V DC, even for testing. It can be up to 400V DC. The IGBTs are rated for 600V, but there are fast voltage changes that use up that extra voltage. It is best to keep the battery voltage at 400V or below.
We don't need to connect the motor yet.
You should be using a pre-charge contactor with a resistor that charges up the big capacitor within a couple of seconds and a main contactor that does not use any resistor at all. The basics are shown below. But you can add extra fusing, contactors, etc as you wish.
Set your throttle to minimum and power up the controller. You are familiar with what you will see and hear by now.
Connect your voltmeter between U and V terminals, with the setting for AC voltage and as high as your battery pack is - say 200VAC.
Press the throttle and you should see the voltage rise from 0V to some other number. It does not continue to rise since you have no encoder signal. It will only try to run the motor for a short time without an encoder signal. Some versions of the firmware will continue to run at a very slow speed with no encoder signal to show that the controller is working, but the encoder has failed.
This is your fourth milestone. The controller is putting out power signals.
If you have trouble getting any voltage output, check the appendix for troubleshooting.
Turn off the controller
It is time to connect your encoder. Not the motor, just the encoder.
Wire up the A, B, GND as shown on the controller board. The output of the board is 5V. And it expects that the return signal is 5V or under. I have had to power up encoders with higher voltage and then step down the voltage on the signal to under 5V. It just takes some extra time. Having a 5V signal is best.
When the encoder is connected, turn on the controller.
Type in these commands to see the encoder signal
It will look something like this on your computer
Turn the motor shaft by hand and it should change, like this.
If it doesn't change, check the voltage to your encoder is good, and that you are getting a changing signal from your encoder. 24VAC setting on your meter, between terminals A and GND, or B and GND,
If got to here, write down the encoder number, then turn the motor on e revolution or as close as you can get. Write down the encoder number again. This is your pulses per revolution. Actually, it is 4 times your pulses per revolution. Divide that number by 4 and put into this setting
pulse-per-revolution=
SAVE
Now the controller knows how many pulses to expect each time the motor turns once.
This is your fourth milestone. The controller is putting out power signals.
If you have trouble getting any encoder signal, check the appendix for troubleshooting.
Turn off the controller
Time to check how your motor is wired.
At the motor, the 3 terminals should show about the same resistance from U to V, V to W and W to U. This is good.
There should be very high resistance between each of the terminals and the metal outside of the motor. This is good.
If the resistances are not about the same, or there is under 1000K ohms between a motor terminal and the metal outside the motor, do not connect this motor to your controller. It could damage the controller.
It is finally time to connect your motor to the output of the controller.
Connect U, V and W to your motor leads. If the motor leads are not labeled, choose which wires go where to make it easy to wire up, with no wires crossing if you can. Then label the motor wires.
When all is tight and you are ready to go, power up the controller
After the controller is powered up and ready, press the throttle a bit. The motor should hum or turn. It won't be smooth, but you should see or hear something.
If the controller faults, the motor may not be internally wired the way the controller expects it to be.
This is your fifth milestone. The controller does something with the motor connected.
If you have trouble getting any sound or motion from the motor, check the appendix for troubleshooting.
Turn off the controller
Tuning the controller
You have your motor connected to U, V and W terminals, the encoder is connected, the throttle is connected, and your computer is connected and running your terminal software.
Power up the controller and see the firmware version
There should be no throttle fault
Type in the following command, as shown
KP=1000
KI=20
RUN-PI-TEST2
There should be a very brief hum, and the output from the screen should look something like this
We are running a short test with the settings we have chosen, to determine if the output 'converges' to 0. If you take the output, copy and paste to excel, then generate a graph with the values on the Y axis and the line numbers on the X axis, you will see a graph like this
What you are trying to come up with are settings that make the graph fall to 0 as quickly as possible but go negative as little as possible. Here are some examples from my motor and my controller
These include Kp and KI too low
Kp and KI too high
KP an KI about right
For simplicity, we are using simple division on KP to get KI. When you get about right, you can increase or decrease the numbers individually to get slightly less negative, or drop the time just a bit. KP / 50 seems to work for most motors that have been tested.
remember to SAVE when you are done!
When you change your pack voltage, like changing from 24V for testing to 144V in your vehicle ... you need to run the tune again. The numbers that you saved will run, but different numbers will give less overshoot (negative) or a shorter time to 0V (convergence)
This is your sixth milestone. The controller does the basics - drive your motor smoothly.
If you have trouble getting convergence on your motor, check the appendix for troubleshooting.
Fine tuning of the controler
This section is a bit larger, involves more settings, and is very subjective. You are making the controller YOURS. It will decelerate how YOU want it to. You can configure it for one-pedal driving, where letting off on the throttle gets you mild to aggressive regenerative braking. You can change how responsive the vehicle is for the throttle, the time it takes to go from no torque to maximum torque. Careful with that one - you can wreck gearboxes, CV axles, drive shafts, clutches ... with too much torque too fast.
.. to be continued ...
__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!
|