Go Back   EcoModder Forum > EcoModding > Fossil Fuel Free
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 07-07-2018, 01:37 PM   #3271 (permalink)
Ale Madeo
 
ale0502's Avatar
 
Join Date: Jan 2016
Location: Bariloche Patagonia Argentina
Posts: 32
Thanks: 22
Thanked 7 Times in 5 Posts
pwm frecuency

I have my motor on a test bench.
On Paul´s code say:
// PWM Initialization

PTPER = 1474; // 29,491,200/((PTPER + 1)*2) = 9997Hz.

I think my pwm resolution is bad.

I change PTPER value but I didn't get better results.
On dspic datasheet say:


thanks

__________________
Los que dicen que es imposible, no deberían molestar a los que lo están intentando...
  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 07-07-2018, 10:36 PM   #3272 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,479

ChargE (not yet running) - '92 Mazda MX6 LX
90 day: 33.89 mpg (US)

Ford Prefect - '18 Ford F150 XLT XTR
Thanks: 746
Thanked 543 Times in 438 Posts
Quote:
Originally Posted by ale0502 View Post
I have my motor on a test bench.
On Paul´s code say:
// PWM Initialization

PTPER = 1474; // 29,491,200/((PTPER + 1)*2) = 9997Hz.

I think my pwm resolution is bad.

I change PTPER value but I didn't get better results.
On dspic datasheet say:


thanks
I have not checked the code I'm running. But I expect that Paul has not changed that in some time. I ran through the numbers in the code snippet and I get 9997 Khz as well.

The scope trace I will have to ask some questions about. I see that the 3 channels are all set to 5.00V per division. The time scale shows what looks like 1.00 ms. So each horizontal division should be 1 ms - right? -5 ms to +5 ms is your horizontal scale.

The narrowest of the pulses is far less than 1 ms. It could be near 0.1 ms, which is what would be expected at 10 KHz. I don't see anything that appears to be 3 Khz, or a period of 0.33 ms. What am I missing?

Are your cursors the dotted lines at -1.6 ms and +2.56 ms? I see the values on the right for Type - time, Source Ch1, Delta of 4.16 ms.

Can you capture the signals that are 'wrong' for us and post that picture, with your cursors showing the timing? I'm still confused about what is wrong.

As far as I can see, your board is working beautifully?
__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!
  Reply With Quote
Old 07-18-2018, 12:54 AM   #3273 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,479

ChargE (not yet running) - '92 Mazda MX6 LX
90 day: 33.89 mpg (US)

Ford Prefect - '18 Ford F150 XLT XTR
Thanks: 746
Thanked 543 Times in 438 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!
  Reply With Quote
The Following 4 Users Say Thank You to thingstodo For This Useful Post:
esali1987 (12-26-2018), freebeard (07-18-2018), pablitosax (07-18-2018), Piotrsko (07-19-2018)
Old 07-19-2018, 04:28 PM   #3274 (permalink)
Somewhat crazed
 
Piotrsko's Avatar
 
Join Date: Sep 2013
Location: 1826 miles WSW of Normal
Posts: 2,453
Thanks: 245
Thanked 674 Times in 586 Posts
Spelling? Suing a 9 pin connector?

Well done, otherwise.
__________________
casual notes from the underground:There are some "experts" out there that in reality don't have a clue as to what they are doing.
  Reply With Quote
Old 07-20-2018, 04:13 PM   #3275 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,479

ChargE (not yet running) - '92 Mazda MX6 LX
90 day: 33.89 mpg (US)

Ford Prefect - '18 Ford F150 XLT XTR
Thanks: 746
Thanked 543 Times in 438 Posts
Quote:
Originally Posted by Piotrsko View Post
Spelling? Suing a 9 pin connector?

Well done, otherwise.
If all I need to do is pay attention to spell-check then I think I'm doing OK.

Any comments on location for the document, or if it can be a WIKI with pictures and video embedded?
__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!
  Reply With Quote
Old 07-20-2018, 06:11 PM   #3276 (permalink)
EcoModding Lurker
 
Join Date: Feb 2018
Location: Argentina
Posts: 13
Thanks: 1
Thanked 1 Time in 1 Post
Quote:
Originally Posted by thingstodo View Post
If all I need to do is pay attention to spell-check then I think I'm doing OK.

Any comments on location for the document, or if it can be a WIKI with pictures and video embedded?
I am a newbie in the subject and I think it would be useful before a brief description of the reason for owning a programmable controller (I suppose that in order to use different battery pack, different voltages, different currents, different motors).
I also think it would be convenient to have a scheme that indicates all the external components and an explanation of each one (controller, relays, preload resistance, DC-DC converter or battery charger,etc ) and then start with Paul's contolador also with another scheme that indicates each of its parts .. controller unit , igbt's , converter encoder / resolver, interface to PC, igbt desaturator,etc ).

my humble opinion is that it would be ideal a WIKI with pictures and video embedded .

Regards !
Pablo
  Reply With Quote
Old 07-20-2018, 07:38 PM   #3277 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,479

ChargE (not yet running) - '92 Mazda MX6 LX
90 day: 33.89 mpg (US)

Ford Prefect - '18 Ford F150 XLT XTR
Thanks: 746
Thanked 543 Times in 438 Posts
Quote:
Originally Posted by pablitosax View Post
I am a newbie in the subject and I think it would be useful before a brief description of the reason for owning a programmable controller (I suppose that in order to use different battery pack, different voltages, different currents, different motors).
I also think it would be convenient to have a scheme that indicates all the external components and an explanation of each one (controller, relays, preload resistance, DC-DC converter or battery charger,etc ) and then start with Paul's contolador also with another scheme that indicates each of its parts .. controller unit , igbt's , converter encoder / resolver, interface to PC, igbt desaturator,etc ).

my humble opinion is that it would be ideal a WIKI with pictures and video embedded .

Regards !
Pablo
That is quite an undertaking for a single document. A group of related documents may be able to address such a broad topic.

If you were looking for this document, where would you expect to find it?

There could be a link in Paul's forums, but I don't think ECOMODDER would host the wiki. Is GITHUB a suitable open source repository? That certainly deals with version control, dealing with edits that may have SPAM sales stuff and the like

https://en.wikipedia.org/wiki/Compar...sting_services

OurProject.org looks like a good place to start. But it would be nice if someone who actually USES this service was to recommend it

When I figure out where to store it, I'll post a link here. I don't really expect others to submit a lot of content - the topic is technical and kinda dry reading. But who knows?
__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!
  Reply With Quote
Old 07-24-2018, 10:48 AM   #3278 (permalink)
Somewhat crazed
 
Piotrsko's Avatar
 
Join Date: Sep 2013
Location: 1826 miles WSW of Normal
Posts: 2,453
Thanks: 245
Thanked 674 Times in 586 Posts
Any advantage to google cloud services? Over on diyelectric cars the forum has destroyed the archives due to new ownership and posters are retrieving data that way.
__________________
casual notes from the underground:There are some "experts" out there that in reality don't have a clue as to what they are doing.
  Reply With Quote
Old 07-25-2018, 12:24 AM   #3279 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,479

ChargE (not yet running) - '92 Mazda MX6 LX
90 day: 33.89 mpg (US)

Ford Prefect - '18 Ford F150 XLT XTR
Thanks: 746
Thanked 543 Times in 438 Posts
Quote:
Originally Posted by Piotrsko View Post
Any advantage to google cloud services? Over on diyelectric cars the forum has destroyed the archives due to new ownership and posters are retrieving data that way.
Hmm. Any idea what google's product would be called? Their cloud services offer a bunch of stuff ... one of them sounds like it stores documents .. but not a wiki sort of thing?
__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!
  Reply With Quote
Old 10-07-2018, 06:11 AM   #3280 (permalink)
EcoModding Lurker
 
Join Date: Oct 2018
Location: RO
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Hi everyone,

I've just put in an order for the AC board (along with a DC board as well for a future project). Wondering if anyone has successfully mated any HPEVS motor to the AC board? I'm considering to use the AC35 on an 800Kg city runner.

Cheers,
Bogdan

  Reply With Quote
Reply  Post New Thread


Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paul & Sabrina's cheap DIY 144v motor controller MPaulHolmes Open ReVolt: open source DC motor controller 7350 07-28-2021 06:32 AM
Paul & Sabrina's Cheap EV Conversion MPaulHolmes Fossil Fuel Free 542 11-12-2016 10:09 PM
Contest! Name Paul & Sabrina's controller MetroMPG Forum News & Feedback 120 10-22-2011 02:59 PM



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