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

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 07-04-2017, 11:02 PM   #3101 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 746
Thanked 565 Times in 447 Posts
Quote:
Originally Posted by ScottyWarpNine View Post
Cool, I just got an SOIC8 clip on programmer so I can program the ATtiny. The Pic can be programmed once it is soldered on the board via the ISP header, correct?
Yes, the PIC (pretty much ANY PIC as far as I know) can be programmed via ISP ... ICSP? .. header before or after soldering. The One-time Programmable versions (OTP) can be programmed in circuit or before as well .. just that you only get one shot at it.

__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!
  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 07-05-2017, 09:07 PM   #3102 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
My goodness, thingstodo, you are really helpful with answering questions! I have nothing further to add.
__________________
kits and boards
  Reply With Quote
Old 07-29-2017, 05:29 AM   #3103 (permalink)
EcoModding Lurker
 
Join Date: Mar 2016
Location: italy
Posts: 40
Thanks: 5
Thanked 2 Times in 2 Posts
Hello Guys, i'm back again and sorry about my very bad english.. ahah
first of all i got the motor running on dspic30f6010A.. and added a code for 16x2 LCD. because it is impossible to debug because the analog inputs for current sensing are also programming port inputs.

But now i need your help guys who already tested this controller.. and MPaulHolmes also yours ahah if you have some time.
details of hardware:
CURRENT SENSORS: LTS-25-NP
IGBTS: FGH40T120
IGBT DRIVERS: A3120 OPTOCOUPLERS
BUS VOLTAGE: 100V UP TO 22AMPS
ENCODER: 1000 PPR

MOTOR:
CONNECTION: DELTA 230V PHASE TO PHASE CONFIGURATION
KW: 2.2
RPM: 2800
POLES: 2, 1 POLE PAIR
COSFI: 0.85
NOMINAL AMPS: 8.6

1: How can i set pi-ratio parameter? how to find the best one?

2:how to set throttle mapping values? i'm using 4.7k potentiometer.
my current values are:
max-regen-position=0042
min-regen-position=0339
min-throttle-position=0539
max-throttle-position=0837

the problems with these values are:
1: the motor jumps to maximum speed (4000+ RPM) with minimum variation of potentiometer.. i checked the potentiometer and it is ok. i checked also the ADCBUF values these also are in 0-1023 int.
2: the motor turns only in one direction.. the other haf of pot range does nothing.


FOR NOW THESE ARE MY BIG PROBLEMS.. AFTER I SOLVE THESE WITH YOUR HELP GUYS I WILL TEST THE MOTOR UNDER LOAD HOPEFULLY..
My current Configuration:
motor-type=1
kp=08618 ki=00139
current-sensor-amps-per-volt=0040
max-regen-position=0042
min-regen-position=0339
min-throttle-position=0539
max-throttle-position=0837
fault-throttle-position=0005
max-battery-amps=0010 amps
max-battery-amps-regen=0002 amps
max-motor-amps=008 amps
max-motor-amps-regen=008 amps
precharge-time=0001 tenths of a sec
rotor-time-constant=023 ms
pole-pairs=001
max-rpm=03000 rev/min
throttle-type=1
encoder-ticks=1000 ticks/rev
pi-ratio=062
raw-throttle=0508
  Reply With Quote
Old 07-29-2017, 11:38 AM   #3104 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
Computing Kp and Ki ahead of time without having the controller search for it:

Kp = 2000 * pi * L * 8192 * 1702 * LEM / (Voltage * 2048)
Ki = (2000 * pi) * R * 8192 * 1702 * LEM / (Voltage * 2048 * 10000)

Voltage is in units of voltage. haha. LEM means current per 0.625v rise in output of sensor. The LEM Hass 300-s for example goes up 0.625v for every 300amp, so "LEM" in that case would be 300 (that's why I called that variable LEM).

The Kp and Ki that results would be the biggest I would use. it might be better to even cut both of them in half. But it would work.

Note: R above means the resistance of 1 of the phases. L either means stator inductance or "mutual inductance" or something like that. But you don't need to compute Kp using that formula. All I do is find Ki, and then Kp is about 60*Ki (50 to 100 would be OK). That's because the inductance and resistance ratio is always about the same for all motors because the more copper you wind, the bigger the inductance.

For using a potentiometer rather than hall effect throttle, you would need to populate R2 with maybe 1k? And then populate R1 with about 4.7k. The BOM calls for R2 to be empty and R1 to be 47k, but that is for the case of the hall effect throttle.

Try this: After changing those resistor values, set it to max throttle, and then type config (noting where raw throttle position is). Then, set it to min throttle and hit config. I haven't tested anything with a pot rather than hall effect, but maybe thingstodo has. I would set the throttle max and min variables based on what you see when you do that test.
__________________
kits and boards
  Reply With Quote
Old 07-29-2017, 12:29 PM   #3105 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 746
Thanked 565 Times in 447 Posts
Quote:
Originally Posted by MPaulHolmes View Post
Try this: After changing those resistor values, set it to max throttle, and then type config (noting where raw throttle position is). Then, set it to min throttle and hit config. I haven't tested anything with a pot rather than hall effect, but maybe thingstodo has. I would set the throttle max and min variables based on what you see when you do that test.
If you set your pot to minimum, type config and write down the number
Set your pot to maximum, type config and write down the number

Let's guess that you get 500 for minimum and 700 for maximum (based on your description). I'd change these numbers

max-regen-position=0042
min-regen-position=0339
min-throttle-position=0539
max-throttle-position=0837

to these numbers

max-regen-position=0042
min-regen-position=0510
min-throttle-position=0539
max-throttle-position=1023

For testing, you would get a small amount of reverse, only the part from 510 down to 500. If I guessed wrong and your numbers are different, give yourself about 10 counts of reverse that you can get to just to show that it works.

You still have a deadband where the motor does not turn, from 510 to 539. It needs to be big enough that you can easily get the motor speed to 0

I doubt that your reading will go up to 1023 so you will get less aggressive acceleration for your testing, but you won't be able to get to max speed.

Have fun!
__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!
  Reply With Quote
The Following 2 Users Say Thank You to thingstodo For This Useful Post:
MPaulHolmes (07-29-2017), shaggythegangsta (07-29-2017)
Old 07-29-2017, 12:51 PM   #3106 (permalink)
EcoModding Lurker
 
Join Date: Mar 2016
Location: italy
Posts: 40
Thanks: 5
Thanked 2 Times in 2 Posts
[/QUOTE]
For using a potentiometer rather than hall effect throttle, you would need to populate R2 with maybe 1k? And then populate R1 with about 4.7k. The BOM calls for R2 to be empty and R1 to be 47k, but that is for the case of the hall effect throttle.

Try this: After changing those resistor values, set it to max throttle, and then type config (noting where raw throttle position is). Then, set it to min throttle and hit config. I haven't tested anything with a pot rather than hall effect, but maybe thingstodo has. I would set the throttle max and min variables based on what you see when you do that test.[/QUOTE]


First off all thanks for fast response and thanks also for explaning the PID tuning part.. it would help me tuning the system response..
But for th throttle mapping part i could not find the R1 and R2...
in the schematic files that i have resistors involved in throttle part are R51 AND R52.
take a look at that part of code
https://ibb.co/jvFKvQ
  Reply With Quote
Old 07-29-2017, 12:53 PM   #3107 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
I forgot you have a different board. haha. Whichever resistor is connected to +5v I would use 1k.
__________________
kits and boards
  Reply With Quote
The Following User Says Thank You to MPaulHolmes For This Useful Post:
shaggythegangsta (07-29-2017)
Old 07-29-2017, 12:56 PM   #3108 (permalink)
EcoModding Lurker
 
Join Date: Mar 2016
Location: italy
Posts: 40
Thanks: 5
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by thingstodo View Post
If you set your pot to minimum, type config and write down the number
Set your pot to maximum, type config and write down the number

Let's guess that you get 500 for minimum and 700 for maximum (based on your description). I'd change these numbers

max-regen-position=0042
min-regen-position=0339
min-throttle-position=0539
max-throttle-position=0837

to these numbers

max-regen-position=0042
min-regen-position=0510
min-throttle-position=0539
max-throttle-position=1023

For testing, you would get a small amount of reverse, only the part from 510 down to 500. If I guessed wrong and your numbers are different, give yourself about 10 counts of reverse that you can get to just to show that it works.

You still have a deadband where the motor does not turn, from 510 to 539. It needs to be big enough that you can easily get the motor speed to 0

I doubt that your reading will go up to 1023 so you will get less aggressive acceleration for your testing, but you won't be able to get to max speed.

Have fun!
Thanks sir i will give a try update you guys.. thanks again for helping
  Reply With Quote
Old 07-29-2017, 12:59 PM   #3109 (permalink)
EcoModding Lurker
 
Join Date: Mar 2016
Location: italy
Posts: 40
Thanks: 5
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by MPaulHolmes View Post
I forgot you have a different board. haha. Whichever resistor is connected to +5v I would use 1k.
And R51 AND R52 same values as indicated on the schematic?
  Reply With Quote
Old 07-30-2017, 01:19 PM   #3110 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
same values as indicated on what schematic?

__________________
kits and boards
  Reply With Quote
Reply  Post New Thread




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 7381 08-02-2023 11:55 PM
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 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com