EcoModder.com

EcoModder.com (https://ecomodder.com/forum/)
-   Open ReVolt: open source DC motor controller (https://ecomodder.com/forum/open-revolt-open-source-dc-motor-controller.html)
-   -   ReVolt control parameters (https://ecomodder.com/forum/showthread.php/revolt-control-parameters-15909.html)

mora 01-25-2011 05:48 PM

ReVolt control parameters
 
Hello,

I thought I'd start this thread because I'm feeling a bit confused about some parameters you can set to ReVolt controller. When setting up/tuning the controller one would like to know what each of these codes do. There might be other ways to set parameters but I'm using RTD Explorer for that purpose.

Let's try explaining all the options available. These settings apply to Cougar controller using ATmega chip, revision 2C.



One important thing about throttle calculation (taken from wiki):

Throttle = throttle_input * t-pos-gain / 8 - PWM * t-pwm-gain / 8

throttle_input is raw throttle. t-pos-gain and t-pwm-gain are variables one can set. PWM is the actual PWM output ratio from the controller. Values range from 0 to 511. 0 is full off and 511 is full on.



Current parameters one can set using RTD Explorer:

kp - KP loop value
ki - KI loop value
possible values: 0-500
Default values: kp 2 and ki 160
adjust how quickly the motor current matches what you are inputting via the accelerator. Different values will affect the response and will cause oscillations and a feeling of jerkiness if they don't match the motor and system voltage. (taken from wiki pages)

t-max-rc - Throttle max count (pedal all the way up)
t-min-rc - Throttle min count (pedal all the way down)
Possible values: 0-1023
Default values: t-max-rc 683 and t-min-rc 413
These adjust the throttle position limits. You should set these so you always get zero throttle and full throttle when needed.

t-pos-gain -
t-pwm-gain -
Possible values: 0-128
Default values: t-pos-gain 8 and t-pwm-gain 0
Variables in throttle equation.

Increasing the value of t-pwm-gain will cause the throttle to decrease as the vehicle speeds up and has the effect of making the throttle less sensitive at higher speeds. This is useful for applications that require high amps at low speed and less sensitive throttle at higher speeds. Settings of 16 and 8 would make the throttle twice as sensitive at low speeds; the throttle will become less sensitive as the vehicle speed (and PWM) increase. If PWM were to go to its max, the throttle would return to normal sensitivity. A setting of 16 and 12 would have a similar effect, but the throttle would be at normal sensitivity at 66% PWM and only half sensitivity at 100% PWM. (taken from wiki)

t-fault-rc - Throttle fault raw counts
Possible values: 0-1023
Default value: 100
Raw ADC counts for throttle fault. Time window is 200ms, so these counts must accumulate within 200ms for throttle fault to latch.

c-rr - Current ramp rate (in amps per millisecond)
Possible values: 0-100
Default value: 6
Defines how quickly the throttle responds to controller input. Higher values create a more responsive feel while lower values are smoother and more gradual. (taken from wiki).

pwm-filter - PWM filter for t-pwm-gain
Possible values: 0-3
Default value: 0
There's a low pass filter for the value of PWM in the throttle equation. This sets the level (speed) of filtering. 0 is slowest and 3 is fastest. Most likely, the default value is fine.

motor-os-th - Motor overspeed threshold
Possible values: 0-9999
Default value: 0
RPM equation used in controller software is RPM = c*pwm_duty/current. C is a constant, which is different for each motor/voltage. So setting motor-os-th to 1000 doesn't mean RPM is limited to 1000. It is good idea to start experimenting with low values and gradually increase this value until satisfying RPM limit is reached. Motor load affects RPM limit, so under load RPM limit is a bit higher.

motor-os-ft - Motor overspeed fault time (ms)
Possible values: 0-9999
Default value: 1000
Time (in ms) for which the controller will cut out if it detects overspeed. Overspeed stuff works only on series-wound motors.

motor-os-dt - Motor overspeed detection time (in ms)
Possible values: 0-99
Default value: 10
Time (in ms) for which a fault has to be detected before causing a overspeed fault - prevents nuisance faults

motor-sc-amps - Motor speed calc amps
Possible values: 0-511
Default value: 0
Sets the motor amps limit below which overspeed sensing is disabled. There was a problem where it would trip if you released the pedal quickly and throttle would be lost for a quarter second or whatever the fault time is. This solved it. For a first guess at a value, place the car in neutral. Depress the pedal until the motor just starts to turn (just enough to overcome friction). Set motor-sc-amps to half the current required to get the motor to just start turning.

pwm-deadzone - How many PWM counts the mosfets begin to conduct
Possible values: 0-99
Default value: 5
The default should work for most people - this makes the overspeed trip more reliable. Value is estimate of the minimum PWM setting where the drivers start to turn on. It's only used in the overspeed calculation.

bat-amps-lim - Battery amp limit
Possible values: 0-511
Default value: 0
If you want to limit amp draw from your batteries you can set this parameter. Setting value to 0 means there is no limit for maximum battery amps drawn. However there is a hardware amp limiter on control board. This hardware limit controls max motor amps which can't be lower than battery amps. So it essentially limits battery amps too. Hardware amp limiter is adjustable but not via software. Hardware amp limit defaults at around 500A.

pc-time - Pre-charge delay time (1/10th second)
Possible values: 0-999
Default value: 0
Controller's pre-charge circuit starts outputting +12V to J1 connector pin #3 after this time passes. Setting this value to 20 will result in +12V coming out of pin #3 after 2 seconds. 30 means 3 seconds etc. Zero value means no +12V to pin #3 at all.

jyanof 01-31-2011 11:46 AM

Quote:

One important thing about throttle calculation (taken from wiki):

Throttle = throttle_input * t-pos-gain / 8 - PWM * t-pwm-gain / 8

throttle_input is raw throttle. t-pos-gain and t-pwm-gain are variables one can set. PWM is ?
PWM is the actual PWM output ratio from the controller as a value from 0-511. 0 is full off and 511 is full on.

the PWM ratio is analogous to the voltage that the controller is outputting. The output voltage is also roughly correlated to the rpms of the motor. So, if t-pwm-gain is greater than zero, the equation above will subtract more and more from the throttle input as the vehicle speeds up.

When testing the software, I was able to use this feature to make it easier to maintain a constant current draw from the batteries while accelerating. It'll probably vary widely on the motor/gearing selection though.

Quote:

pwm-filter -
Possible values: 0-3
There's a low pass filter for the value of PWM in the throttle equation above. This sets the level of filtering. Most likely, the default value is fine.

Quote:

t-max-rc - Throttle max count (pedal all the way up)
Possible values: 0-1023

t-min-rc - Throttle min count (pedal all the way down)
Possible values: 0-1023
These adjust the throttle position limits in case you have a weird pot that doesn't close or open all the way. Mine worked with the default settings...

Quote:

motor-os-ft - Motor overspeed fault time
Possible values: 0-9999

motor-os-dt - Motor overspeed detection time (in ms)
Possible values: 0-99

motor-sc-amps - Motor speed calc amps
Possible values: 0-??

pwm-deadzone - How many PWM counts the mosfets begin to conduct
Possible values: 0-99
motor-os-ft: the number of ms for which the controller will cut out if it detects overspeed. (all the overspeed stuff works only on series-wound motors, btw).

motor-os-dt: number of ms for which a fault has to be detected before the fault causes a shutdown - prevents nuisance faults

motor-sc-amps: sets the motor amps limit below which overspeed sensing is disabled. There was a problem where it would trip if you released the pedal quickly and throttle would be lost for a quarter second or whatever the fault time is. This solved it. For a first guess at a value, place the car in neutral. Depress the pedal until the motor just starts to turn (just enough to overcome friction). Set motor-sc-amps to half the current required to get the motor to just start turning.

pwm-deadzone: as decribed above - the default should work for most people - this makes the overspeed trip more reliable.

DJBecker 01-31-2011 12:50 PM

Hmmm, is there a wiki page for this yet? I've read the Cougar code pretty carefully and could likely add some useful info.

The comment about "a weird pot that doesn't close or open all the way" is a little off the mark.

The throttle input is deliberately set up to not span the full 0-5V range. This is so that the throttle "fails safe". With a good physical design, there is no wire or trace break that could result in a valid, non-zero throttle input. And no persistent short should result in a valid input. Part of the reason for HPL / High Pedal Lockout is that a internally shorted throttle position sensor (TPS) shouldn't result in half-throttle operation.

The controller typically has resistors to a 0-5V supply, so that a connected variable resistor (TPS or "pot box") ends up with a 1V-4V reference range. That way most breaks or shorts will report 0V or 5V (or even 12V) -- clearly outside the valid range. Further, the TPS is often set up with physical limits to never use the full range, perhaps only 1.25V to 3.75V. That way the controller can localize a failure -- a 1V input suggests the failure is internal to the TPS or wiring rather than on the controller or an external short.

Yes, reducing the input voltage range like this reduces the resolution of the throttle input. But the ability to detect a very slight movement of the gas pedal isn't nearly as important as being able to detect a failure.

mora 01-31-2011 03:48 PM

Thanks for the input. Good info. Is pwm-deadzone only related to overspeed detection and doesn't affect other things?

I'll throw a guess about t-fault-rc: throttle fault raw-count. Number of times/cycles in main program loop that throttle is allowed to have faulty reading. If so this number should remain low, but might help with bad pots (which need replacing). I don't know how long it takes to sample one throttle value, but even with full t-fault-rc value it is less than second.

DJBecker 02-02-2011 11:24 AM

The pwm_deadzone value is the estimate of the minimum PWM setting where the drivers start to turn on. It's only used in the overspeed calculation.

Very short PWM pulses to the MOSFET gates provide minimal motor current and just generate heat. Older IGBTs are even worse, taking a long time to fully turn on. Plus the Cougar uses an optoisolator, which both delays and shortens the gate drive signal.

In my notes I have that the default setting of 5 corresponding to 1.2usec. My early-morning calculation puts it at 600ns (9 cycles at 16MHz). Either is a reasonable estimate.

I'm a little surprised that the Cougar code doesn't have a similar parameter for setting the PWM register, rather than only compensating for it in the overspeed check. The code should enforce a minimum PWM on time, not turning on at all if there would only be a very short output pulse. It doesn't preclude low speed operation. If you continue to accumulate the error, eventually the difference builds up enough that the MOSFETs are turned on for a few cycles. Add a little randomness (A/D converter noise seems to be enough) and you get low speed dithering for free.

The Cougar firmware might also do a better job with minimum off time. If the motor controller is estimating 98%+ PWM, it should just turn on 100%. It should specifically not clamp at 510! Switching off for a few cycles is just generating heat without adding control.

Plus my still-in-progress experiment with stand-alone SR gate drive works better when there are not very short off / freewheel phases. A stand-alone SR circuit drives a MOSFET to emulate a diode by switching the gate on when negative drain-source voltage is detected. To avoid false turn off from ringing, the drain-source voltage detection is ignored (really "heavily biased to stay on") for a bit, the minimum on time (MOT). If the MOT requirement isn't met, the result is some shoot-through current, which generates lots of heat.

mora 03-28-2011 11:09 AM

Are t-max-rc and t-min-rc auto-adjusting? I thought I'd check my potbox range from controller but RTD explorer showed me same values I was going to input. Pot is definitely not full 0-5k ohm, but something like 4.7k ohm.

DJBecker 03-28-2011 11:34 AM

Quote:

Originally Posted by mora (Post 228344)
Are t-max-rc and t-min-rc auto-adjusting? I thought I'd check my potbox range from controller but RTD explorer showed me same values I was going to input. Pot is definitely not full 0-5k ohm, but something like 4.7k ohm.

The t-max-rc and t-min-rc serial port commands set the internal variables

config.throttle_max_raw_counts
config.throttle_min_raw_counts

They are in raw A/D converter units, where the range is 0..1023 corresponding to 0-5V.

Note that Cougar uses a 5V-0V throttle, where a 5V (A/D reading of 1023) is "foot off the pedal" and 0V is "go very fast". That's less common than a 0-5V throttle, but not unique.

These settings are not auto-adjusting. The user must manually set the values, test them out and explicitly write them to the EEPROM.

It would only be a little more code to make them auto-adjusting, but that might not be code that should be written. If some part of the throttle circuit is slowly degrading, you want someone to check it out rather than hiding it with automatic compensation.

That's a bit different than having a setup and calibrate mode, where the throttle range is detected once and written. That would be useful.

mrbigh 05-11-2011 10:56 PM

RTD Explorer crash course
 
Hi, finaly I have the latest controller board assembled and working thanks to Paul's preprogrammed Atmega.
The 1kAmp controller is connected and runuing with RTD Explorer but I encounter that the momentary speed control, a 5K potentiometer, it has a 1/2" excursion on the RTD Expl. screen an it start ploting at Value 35 not exceeding 40.
How do I change parameters in temporary mode for testing and them into the Atmega.
Is it there a programming manual or guide?
At the bottom of the RTD screen I have a red Throtte Fault and V-Ref Fault, Green precharging and a blue High Pedal Lockout.
thank you

mora 05-12-2011 02:30 AM

You can input commands by typing them into a text field at lower right corner. First type the parameter you want to change, hit space and then type the value;

pc-time 20

This sets precharge time to 2 seconds. Should be easy. Parameters can be set temporary if you don't save the changes. Restarting the controller makes changes disappear then.

I haven't build 1k amp controller board yet so I have no idea how it behaves with RTD explorer. Maybe Paul can confirm if it works the same way like 500A version?

mrbigh 05-12-2011 10:30 AM

1 Attachment(s)
Quote:

Originally Posted by mora (Post 237686)
You can input commands by typing them into a text field at lower right corner. First type the parameter you want to change, hit space and then type the value;

pc-time 20

This sets precharge time to 2 seconds. Should be easy. Parameters can be set temporary if you don't save the changes. Restarting the controller makes changes disappear then.

I haven't build 1k amp controller board yet so I have no idea how it behaves with RTD explorer. Maybe Paul can confirm if it works the same way like 500A version?

MORA, thank you for replaying.
Both 500 and 1KAmp board should be similar in principle of operation, the latest with some more features than the other.
I did try to change "throttle_min_raw_counts=xxxx" and "throttle_max_raw_counts=xxxx" by the example you presented but no changes were accepted.
How do I do the save the changes made to be permanently?
I including a picture of the assembled board

sawickm 05-12-2011 10:42 AM

Wiki document - ReVolt Controller Parameters
 
I added a wiki document for this subject.

I placed it under the "Open ReVolt Controller Settings - ReVolt Control Parameters" Open ReVolt - EcoModder.

It is a "MS Word" document that can be edited. If any changes are made to the document, PM me and I will upload corrected document to the wiki.

- Mark :D

mora 05-12-2011 10:45 AM

Simply type save and hit enter to save settings.

I have an issue with rtd period parameter not saving the value. It stays for a session but doesn't want to stay in memory even if I save settings.

I calibrated my throttle by setting maximum allowable amps to 10 and checking that potentiometer was at resting position. Noted value from RTD explorer. Then I floored the pedal and noted value for throttle max counts.

Note the correct parameter for setting throttle raw counts (an example below):

t-max-rc 500
t-min-rc 800

adamj12b 05-12-2011 09:11 PM

Posted for Fran.

-------------
Very short PWM pulses to the MOSFET gates provide minimal motor current and just generate heat. Older IGBTs are even worse, taking a long time to fully turn on. Plus the Cougar uses an optoisolator, which both delays and shortens the gate drive signal.
-------------

If you look at the HCPL-4504 datasheet, you will see that turn on of the opto is _faster_ than turn off. So while opto does delay the the gate drive signal, it _lengthens_ it (not shortens)
Also notice that as temperature of the opto increases, the turn on remains relatively constant, but turn off slows down. So with higher temperature minimum high pulse (on) to the FETs stretches.

A PI loop controls current by controlling pulse width. This loop will set the correct PWM to make the requested current. You can make the current reference jump from zero (foot of gas) to 10A minimum or so. This approach would be far less sensitive to motor resistance and battery pack voltage than a minimum PWM type parameter.

In any case we wanted to avoid the behavior of the Curtis. There minimum pulse width (on time) is enforced. That resulted in jerky starts (particularly with low resistance motors) where initial current was high until some RPM was built up and the motor would generate counter EMF. The solution was to drop the switching frequency when first applying pulses. The side effect is the well known Curtis whine. This is something we wanted to avoid.

---------------
The Cougar firmware might also do a better job with minimum off time. If the motor controller is estimating 98%+ PWM, it should just turn on 100%. It should specifically not clamp at 510! Switching off for a few cycles is just generating heat without adding control.
---------------

The PWM unit of the AVR is run in phase correct PWM mode.
From the AVR spec:

TCNT1 counts up from 0 to 511 then back to 0. The output is cleared (low) when TCNT1 = OCR1A (PWM value) when counting up. The output is set (set) when TCNT1 = OCR1A (PWM value) when counting down. If OCR1A is outside this range, the PWM output will not work and will be stuck in either a high or low state (undefined). So if you want the output not to flip, you need to program a special case - take away control from the PWM unit. This can become messy unless you are very careful and understand the PWM unit and chip very well.

Paul initially set the clamp value to 510 (I don't know why not 511, perhaps he had problems with the PWM unit if he allowed 511). In any case, the shortest pulse width is:

509 up - nothing
510 up - output low
511 nothing (low 1 cycle)
510 down - output high (was low 2 cycles)

So we have 2/16us low. That is 125ns.

This is shorter than the delay times of the opto. I think the pulse won't even make its way to the gates of the FETs. Even if it did, the RC constant of the gate capacitances and gate resistors would not bring the gate voltages down to anywhere near the gate threshold voltage. In short, it won't switch the FETs and the output will be pure DC.

Fran

DJBecker 05-16-2011 04:04 PM

Quote:

Originally Posted by adamj12b (Post 237866)
If you look at the HCPL-4504 datasheet, you will see that turn on of the opto is _faster_ than turn off. So while opto does delay the the gate drive signal, it _lengthens_ it (not shortens)

The datasheet shows a gentler turn-off slope, but the effect in the circuit can go either way. The bias (in this case actual "bias resistors") is to not mistakenly turn on the MOSFET from noise. That means some (many?) designs will shorten the pulse rather than lengthen it. It just depends on how far up/down the slope you turn on/off.

We have used several different optoisolators. We started out with the cheap 2701 types, which worked fine, first time, in our initial design. We didn't really care about its performance because we knew the feedback would handle it.

Our challenge started when we upgraded to faster parts in preparation for trying a SR design. We saw both shortening and lengthening of pulses as we tried to get noise-safe, stable operation, and predictable symmetrical latency. We tried the same optoisolator that Cougar used, and didn't see any improvement. (It was actually initially worse because of a lower CTR, we needed to increase the drive and decrease the pull-up current.)

Quote:

Originally Posted by adamj12b (Post 237866)
A PI loop controls current by controlling pulse width. This loop will set the correct PWM to make the requested current. You can make the current reference jump from zero (foot of gas) to 10A minimum or so. This approach would be far less sensitive to motor resistance and battery pack voltage than a minimum PWM type parameter.

Which is why it's fine to eliminate narrow pulses, either on or off. The error will accumulate and be corrected.

Quote:

Originally Posted by adamj12b (Post 237866)
In any case we wanted to avoid the behavior of the Curtis. There minimum pulse width (on time) is enforced. That resulted in jerky starts (particularly with low resistance motors) where initial current was high until some RPM was built up and the motor would generate counter EMF. The solution was to drop the switching frequency when first applying pulses. The side effect is the well known Curtis whine. This is something we wanted to avoid.

From looking at an old analog golf cart controller, I believe that they simply halve the frequency for the low range. The result is an audible-frequency whine and poor low-speed control. It has become an endearing, familiar and comforting sound to many golfers. Perhaps not so much for us.

Once you have digital control it's easy to avoid that fixed-frequency whine. A little bit of A/D or control rounding noise is enough to make spread out the audible frequencies.


Quote:

Originally Posted by adamj12b (Post 237866)
The PWM unit of the AVR is run in phase correct PWM mode.
From the AVR spec:
... If OCR1A is outside this range, the PWM output will not work and will be stuck in either a high or low state (undefined).

Our controller is also using the AVR (although we are switching to the STM32), initially in mode 3 and later in mode 10.

I'll need to re-read the datasheet to see if I missed something, but we never encountered a problem. I don't believe this problem occurs if you follow the datasheet closely,

.... I just did a quick scan and found this text:

-----

The extreme values for the OCR2A Register represent special cases when generating a PWM
waveform output in the phase correct PWM mode. If the OCR2A is set equal to BOTTOM, the
output will be continuously low and if set equal to MAX the output will be continuously high for
non-inverted PWM mode. For inverted PWM the output will have the opposite logic values.

----

I had actually been thinking that we didn't have a problem because we always initialized to off at zero, and approached saturation from a non-zero value. Apparently there is explicit logic in the timer circuit to handle this case.


Quote:

Originally Posted by adamj12b (Post 237866)
So we have 2/16us low. That is 125ns.

This is shorter than the delay times of the opto. I think the pulse won't even make its way to the gates of the FETs. Even if it did, the RC constant of the gate capacitances and gate resistors would not bring the gate voltages down to anywhere near the gate threshold voltage. In short, it won't switch the FETs and the output will be pure DC.

Ah, but it does in some cases. In some of our power stages we are using 10 ohm gate resistors with low gate charge MOSFETs. A 125ns pulse is easily enough to hit the threshold and "ring the bell". (Yes, that power stage was ring prone anyway. We added 33 ohm resistors in series with the permanent gate resistors to calm it down.)

If your isolation circuit and gate drive is slower, there will still be a point where you have a short pulse that does a half switch.

The point is the same in either case. Either the short pulse doesn't get through, and you can get rid of it. Or it just generates heat, and you should get rid of it.

SEBART PL 03-21-2012 08:00 PM

[QUOTE=t-max-rc - Throttle max count (pedal all the way up)
Possible values: 0-1023

t-min-rc - Throttle min count (pedal all the way down)
Possible values: 0-1023
These adjust the throttle position limits in case you have a weird pot that doesn't close or open all the way. Mine worked with the default settings...
[/QUOTE]

I am going to use Coguar controler, :o
I have 1kohm-2kohm throtle -this is the oryginal throtle position from car donor so I should get around 2.5-5V , can I adjust =t-max- and min to use this throtle or I suposed to change resistor?

what values
t-max- 0t-min-rc- 1023x50%= 511 ?

Thank you for any reply.
Sebastian

MPaulHolmes 03-22-2012 01:06 AM

Hello Sebart! I would remove R8 and just add a wire, and change R10 to 1k. It will give you a lot more resolution with a 1k-2k throttle. Then set t-min-rc to 341, and t-max-rc or whatever it's called to 480. Really it should be 512, but 480 will allow for a little dead zone.

SEBART PL 03-30-2012 06:51 PM

Quote:

Originally Posted by MPaulHolmes (Post 294930)
Hello Sebart! I would remove R8 and just add a wire, and change R10 to 1k. It will give you a lot more resolution with a 1k-2k throttle. Then set t-min-rc to 341, and t-max-rc or whatever it's called to 480. Really it should be 512, but 480 will allow for a little dead zone.

Dygresion about this 1k-2kohm throtle.
I have chcecked with my bro who is an electronic guy he says:
"when pedal are absent = voltage is 0 when the pedal is max,=0V Sensor TCP -throtle resistor 1-2kohm and rezistor R10 conected do - give 5V dividing factor. I am not fully convince to remove R8 in a case short circiuit there is no safty feuture,- cause dangerous posibilities. Instead changing R8 I will put something which protect from direct short circuit 5V with ground - That could be the resistor which will be like fuse for some high currents during increase. And this R8 propably is designed to work like that.

By the way on exit J3 for sesor halla it could be given the same. Designer of this controler could think about situation - what happend if some wire will cut and will touche ground - if could be exactly 5V will turn of microprocessor.

I have read somwhere with C3 capacitor for 7 pin processor it is possible and good to give small choke series and close to 7805 legs two small capacitorsabout 100n.

Ask as well if there no dangerous for U9 when short circuit could possible happen from contacor coil becouse there is no diode reverse polarization (polarized)? "

Paul if you could comment above.
Thank you for your reply in advance.

MPaulHolmes 03-30-2012 10:19 PM

Those are all good suggestions. The software takes care of some of the issues:

Infinite resistance (a cut throttle) would flag a fault in the software. The pwm would be disabled. If the current sensor output suddenly lost power, the microcontroller would set the pwm to zero in about 0.000025 seconds also.

I expected the contactor coil diode to be included if the person wanted to, but right at the contactor. The EV200 with the economizer recommends not having it, although I used a diode right at my ev200 contactor and it didn't seem to affect operation. I agree that it wouldn't be a bad idea to have a spot for a diode, and leave it up to people to put it in or not. I've just heard that it's best to have the diode right next to the contactor, so the voltage spike never makes it to the control board at all.

I think you are right about the output of the 7805. I haven't heard of a small choke for Vcc. It sounds like a good idea though.

Edit: I was reading today about MLCC caps, and they have some really cheap 10uF MLCCs that I think could replace both the 0.1uF and 10uF Aluminum cap.

type2teach 07-22-2012 06:35 PM

I'm still a little lost here, guys. I figured out how to input data into the controller parameters and change them and save them, but things aren't doing what I wanted them to do. For example, I set the throttle max count to 1000 and as soon as I hit enter, the motor started revving on it's own! I hit the pack disconnect safety switch and saved my motor! Why would it do this?
The instructions say "throttle max count is with the pedal all the way up" does this mean physically with the pedal off the floor (IE, NO acceleration), or does it mean max input from the throttle?
I dropped it back down to 700, but now my van is so sluggish, like it's got NO pep at all. I can barely make it to 10mph.
I want to reset everything to how it came programmed, but I don't see a command for that. No, I tried "reset", but I don't think the parameters changed, and I typed "save" after every change I made.
Can I get back to "stock" with a command? Or do I need to manually input the data? If I need to manually input the data, can someone give me the specs?
Thanks!
Joel in Philly

mora 07-22-2012 06:55 PM

I've had that self-revving happen once. This was because I set throttle limits (min & max) wrong way. Min throttle was max throttle and vice versa. Your throttle calibration parameters might not be correct. Seems like you never get full throttle.

Set max battery amps to 2 and floor the throttle. Note RT (raw throttle) value. Release pedal and note that same parameter again. One should be high number and other one low. Now set these parameters as your t-max-rc and t-min-rc. You might want to leave some "slack" to both values (set parameters few units higher & lower). This ensures you always get full throttle and avoid high pedal lockout on startup. If you set these parameters (t-min-rc and t-max-rc) backwards your motor will spin on its own but it won't spin fast because of battery amp limit. Battery amp limit is set to 2 for safety. Remember to change it back to whatever you had it before when throttle is calibrated correctly.

There is no factory reset command. Every setup is different. You need to set t-min-rc, t-max-rc and bat-amps-lim. And maybe pc-time. Kp and ki after that. T-pos-gain and t-pwm-gain default to 8 and 0 if I remember right. That's a good starting point. Everything else is fine-tuning.

mora 07-22-2012 07:08 PM

I altered main post a bit. I've marked changes done in red. Let me know if anything needs to change. My financial situation could change a bit, hehehe.

bat-amps-lim - Battery amp limit
Possible values: 0-511
If you want to limit amp draw from your batteries you can set this parameter. Setting value to 0 means there is no limit for maximum battery amps drawn. However there is a hardware amp limiter on control board. This hardware limit controls max motor amps which can't be lower than battery amps. So it essentially limits battery amps too. Hardware amp limiter is adjustable but not via software. Hardware amp limit defaults at around 500A.

pc-time - Pre-charge delay time (1/10th second)
Possible values: 0-999
Controller's pre-charge circuit starts outputting +12V to J1 connector pin #3 after this time passes. Setting this value to 20 will result in +12V coming out of pin #3 after 2 seconds. 30 means 3 seconds etc. Zero value means no +12V to pin #3 at all.

type2teach 07-22-2012 07:58 PM

Quote:

Originally Posted by mora (Post 318115)
I've had that self-revving happen once. This was because I set throttle limits (min & max) wrong way. Min throttle was max throttle and vice versa. Your throttle calibration parameters might not be correct. Seems like you never get full throttle.

Set max battery amps to 2 and floor the throttle. Note RT (raw throttle) value. Release pedal and note that same parameter again. One should be high number and other one low. Now set these parameters as your t-max-rc and t-min-rc. You might want to leave some "slack" to both values (set parameters few units higher & lower). This ensures you always get full throttle and avoid high pedal lockout on startup. If you set these parameters (t-min-rc and t-max-rc) backwards your motor will spin on its own but it won't spin fast because of battery amp limit. Battery amp limit is set to 2 for safety. Remember to change it back to whatever you had it before when throttle is calibrated correctly.

There is no factory reset command. Every setup is different. You need to set t-min-rc, t-max-rc and bat-amps-lim. And maybe pc-time. Kp and ki after that. T-pos-gain and t-pwm-gain default to 8 and 0 if I remember right. That's a good starting point. Everything else is fine-tuning.

YES. THANK YOU. I don't have an EE background nor a programming background, so when people mix lingo from both, I get lost real quick.
It's great when I get a response like yours.
Ok. I'll try the step by step and report back to the forum.
What should the Battery amp limit be set at normally, if not at "2"?
When I step on the throttle and I get a number, is that the number I put in the t-max-rc (plus 2)? And the number at NO throttle, is that the t-min-rc (minus 2)?
What the heck is "Kp" and "Ki"? What is the difference between them? I know they are "loop values" (whatever that means) and it sounds like they make the controller respond quicker to your throttle pedal input, but how do I know what to put in each one? Which one should be higher for a more response feel?
Thanks SO much!:thumbup:

MPaulHolmes 07-23-2012 01:37 AM

I would leave Kp to 1, and Ki to 160. I think that's the default at least. To have a snappier throttle, I would do the following:

t-pos-gain 16
t-pwm-gain 8
save

Or maybe

t-pos-gain 19
t-pwm-gain 11

or something like that.

You want t-min-rc to be about 10 or 20 MORE than the measurement that you get when you do the pedal to the floor. I think around 410 is the default.

I would do t-max-rc about 20 or 30 LESS than the measurement when you have zero throttle. 683 is the default for t-max-rc. Zero throttle would actually be around 710 or so. The more throttle, the lower your feedback.

type2teach 09-06-2012 10:47 AM

Well... Shortly after I re-set the parameters, I had to go argue a ticket down at the DMV for another vehicle I owned concerning my inspection sticker. It was like talking to a brick wall. So I decided to stop driving my van until it had it's state inspection sticker to avoid another ticket. Then I went on vacation and now that I'm back, I took the van to inspection last week and it passed! Now I'm legal and putting some real miles on the van and have some more questions.
Here are the specs on the van: '79 vw bus, 20*6v golf cart batteries (sam's club), 9" ADC motor (of course, Revolt controler).
I hit a fairly steep hill yesterday and even in 1st I was barely getting up it. It felt like my amps were limited. A month ago when I set up my controler parameters that Paul suggested above, I *thought* I left my amps at the max, but now I'm doubting my memory. What should my amps be set at if I want it set at max?
Also, can anyone point me in the direction of an article on how to figure out State Of Charge and Depth Of Discharge on lead acids?
Thanks!
Joel in Philly

MPaulHolmes 09-06-2012 11:03 AM

Hi Joel!! Here's how you make sure there's no limit on battery amps:

bat-amps-lim 0
save

If it's 0, then the amps limit is just ignored. Are you sure you are getting the full throttle range? One way to check is to see the serial output at full throttle. Can you do that while driving? If you make sure the power section is disconnected, you could do it while parked.

type2teach 09-06-2012 01:18 PM

Thanks Paul.:thumbup:
I'll check out both parameters and let you know.

type2teach 09-07-2012 06:47 PM

I *did* set my parameters correctly. I guess it'll be <25mph up hills. I'm used to hypermiling in my Sprinter, so driving slow and using hills to my advantage are normal for me.
I just got back from the longest trip yet- 15 miles. 2/3 of my batteries are old, so I'm not expecting much from them. So far, they have exceeded my expectations!
Thanks :thumbup:

MPaulHolmes 09-07-2012 07:02 PM

How much does it weigh?

mora 05-29-2013 09:41 AM

I didn't notice until now that latest code had a .pdf included in the same archive. All the parameters have default values and ranges and short description there. I'll add those missing to main post.

t-fault-rc (throttle fault raw counts) - Raw ADC counts for throttle fault. Time window is 200ms, so these counts must accumulate within 200ms for throttle fault to latch. Default value is 100. Range: 0-1023

c-rr (current ramp rate) - Current ramp rate in amps per millisecond. Default value is 6 (6000 amps/second?). Range: 0-100.

This ramping rate would need finetuning in my opinion. This should be something like amps per 100 millisecond. No wonder I didn't notice much difference when testing.

pwm_filter - Default value is 0. Sets the speed of the low pass filter used for PWM used by throttle_pwm_gain. 0 is slowest and 3 is fastest. Range: 0-3

MPaulHolmes 05-29-2013 12:18 PM

The current was being updated in code at 1kHz I think, and the resolution was 1 tick per amp. It required fairly significant changes so that now it's 64 amps per second minimum. Unfortunately, the code change was done in AVR Studio, so it won't work with the bootloader, as far as I can tell. I did test it on a motor and it worked as expected though. Also, the pinouts were different since it was a different board. haha. But there were only a couple pins different, so it would be an easy fix.

I guess we just need someone to compile it at the command line of linux. I used to have a dual boot with linux and windows, but that computer crashed and took all the code with it. Each time I used Linux, before compiling things in linux, I used to have to type 3 random commands which made no sense to me. I don't remember what they were now, and there were several obscure changes to the default C build environment too. Some changes to "delay.c" that comes with linux, and other weird things. It took Fran all of a saturday to walk me through getting it ready. It's totally not repeatable by me.

adamj12b 05-29-2013 12:25 PM

Quote:

Originally Posted by MPaulHolmes (Post 373631)
The current was being updated in code at 1kHz I think, and the resolution was 1 tick per amp. It required fairly significant changes so that now it's 64 amps per second minimum. Unfortunately, the code change was done in AVR Studio, so it won't work with the bootloader, as far as I can tell. I did test it on a motor and it worked as expected though. Also, the pinouts were different since it was a different board. haha. But there were only a couple pins different, so it would be an easy fix.

I guess we just need someone to compile it at the command line of linux. I used to have a dual boot with linux and windows, but that computer crashed and took all the code with it. Each time I used Linux, before compiling things in linux, I used to have to type 3 random commands which made no sense to me. I don't remember what they were now, and there were several obscure changes to the default C build environment too. Some changes to "delay.c" that comes with linux, and other weird things. It took Fran all of a saturday to walk me through getting it ready. It's totally not repeatable by me.

I will put together a virtual machine and it will make everybody's life easier. It will take a day or 2 to setup and configure everything. I will include the firmware for the controller ready for anybody who wants to use it.

You can download VM Ware Player free for personal use. This is what I will use. I will use the default configuration so it is the most compatible between different computers.

-Adam

SEBART PL 08-03-2013 06:07 PM

Quote:

Originally Posted by adamj12b (Post 373632)
I will put together a virtual machine and it will make everybody's life easier.
-Adam

Could we ask for another parametr for set up maximum working temperature and after rechead this temperature comand automaticly turn off contactor
there is only one or two seconds to safe mosfets after overload, please?

+ degree parametr for cool down let say 15 C degree less to turn on contactor

I do not have AVRstudio and I do not work in C+ so I can't put this in software:

if temp > temp_max
{contactor= 0, cooling=1};
if cooling=1 and temp<temp_normal
{contactor= 1, cooling=0};
'default
temp_max=75
temp_normal=60


I have boiled two sets of IRFs I was :( :confused: :mad: and now EV project is like :snail:


All times are GMT -4. The time now is 12:06 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com