03-12-2016, 12:26 AM
|
#2621 (permalink)
|
Permanent Apprentice
Join Date: Jul 2010
Location: norcal oosae
Posts: 523
Thanks: 351
Thanked 314 Times in 215 Posts
|
Ok, I got Paul's go ahead on this.
Shaggy - I need to know your time requirements - can you PM me this, and maybe an email? I don't want to clog up this thread with this.
Thanks,
E*clipse
|
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
03-12-2016, 08:43 PM
|
#2622 (permalink)
|
EcoModding Lurker
Join Date: Mar 2016
Location: Trinidad
Posts: 7
Thanks: 5
Thanked 3 Times in 3 Posts
|
Quote:
Originally Posted by thingstodo
I don't remember if it is software selectable
|
Maybe "software selectable" isn't the right term but I'm referring to this post by Paul:
Quote:
Originally Posted by MPaulHolmes
Here's one of the new boards I ordered:
It's not here yet though. It does voltage monitoring, and has one of those resolver circuits right on board. You can also turn the resolver circuit off with the chip select pin on the resolver chip, so you can use the board to power something with a resolver, and then another motor that uses an encoder. The main thing about it is, it's all one sided surface mount, so that it can be put together faster.
|
|
|
|
03-14-2016, 12:49 AM
|
#2623 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
Quote:
Originally Posted by tajman
Maybe "software selectable" isn't the right term but I'm referring to this post by Paul:
|
I checked with Paul today - it IS software selectable. The Chip Select input on the resolver to encoder chip is tied to an output from the PIC
|
|
|
03-14-2016, 01:47 AM
|
#2624 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
Build log for my DC controller
Prior to March 9
Paul got the DC controller boards built (or mostly built) before I arrived.
The boards were already designed. I think he got a couple more made. And ordered the IGBTs. And everything else. Received, solder paste put on, parts placed, and board soldered in the toaster oven.
The copper sheets for the capacitors were purchased, cut, marked out and a template made.
The chill plates were ordered as 3/4 inch thick 6061 aluminum plate, cut to size, the cooling channels were machined, the mounting holes drilled and tapped, mounting hardware ordered and received.
One set of cooling holes were drilled and tapped. Plumbing hardware was received.
And a *WHOLE BUNCH* of other stuff that I don't even know about!
|
|
|
03-14-2016, 01:53 AM
|
#2625 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
Build log for my DC controller
Got to Paul's around noon on March 9. There are some chips that have not arrived as yet. But there is stuff to do - cut the copper sheets for the capacitors, get them bent, drill out pilot holes in the copper sheet, finish drilling out and tapping the second controller cooling plate.
The insulating (mylar?) sheet between the copper sheets .. we used the stuff that's rated for 800V. It's tough to cut! And not all that easy to drill. And it moves around a lot ... we ended up needing to make some of the nice round holes that are in the copper sheets ... into ovals. But they will work.
The bending of the copper sheets requires too much precision right now. The next iteration will need to allow for some additional material to be taken up by the bend, and some slop so that bends that are not perfect can be used without modifying the holes!
I have some video, and some audio ... but the camera batteries did not last so I have two different views for the first while, one view for about half an hour when I noticed that the cameras had stopped running ... and no video for the last hour. I'll try to salvage something - perhaps a time lapse would be possible.
The chips should have arrived on Wednesday afternoon .. but they arrived on Thursday afternoon instead.
I'm sure that more was done .. but that's all that I can remember!
|
|
|
03-14-2016, 01:59 AM
|
#2626 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
Build log for my DC controller
March 11. Drop by Harbor freight for some supplies - emery cloth, drill bits.
Drop by Fry's for some distilled water .. for the golf cart batteries .. if we get that far!
Paul got the chips soldered to the DC board yesterday. They look good!
We got the IGBT's tested - matched for voltage drop. Run 20A through the IGBTs and record the voltage drop. And it was documented. They match well - .03V difference from highest to lowest.
The mounting bolts for the control board standoffs were drilled.
The copper sheets were drilled - large clearance holes - with a new step drill bit. I messed up one of the holes ![Frown](/forum/images/smilies/frown.gif) . Since I was drilling both sheets at once, I messed up BOTH controller sheets ... sigh!
The chill plates were sanded off level and smooth, the heat sink paste applied, the IGBTs bolted down.
The standoffs were put on, ready for mounting the DC board. The current sensors were mounted on the chill plate.
... I think that was it ... that should be most of it ...
|
|
|
03-14-2016, 02:23 AM
|
#2627 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
Build log for my DC controller
March 13. Paul got a BUNCH of stuff done yesterday .. he was on a ROLL!
- made the current sensor cables
- fixed my mistake on the copper sheets with a piece of copper sheet and some solder (to cover the hole I drilled by mistake)
- mounted the capacitors on the copper sheets
- the DC controller boards (2 controllers being built) were installed with the temperature sensors and the current sensor cables
- found the source code and did a test build to make sure all was well
I had my old Android phone charged up, a samsung tablet as well, a gopro 3 ... the high voltage DC fuses for Paul were packed in my backpack ... and they all stayed at my sister-in-laws instead of coming with me!
My main phone and a headset is all I had. Yeesh! Audio only for most of the day with a few pictures of the boards and the setup ... but I messed up and hit the button .. sometime during the day ... to take pictures with the front-facing camera. So instead of pictures of the boards, wiring, and other interesting stuff I was looking at ... I have boring pictures of the inside of my hand as I hold the phone ... I don't seem to be able to remember much these days!
Onward!
Today we canibalized Paul's solar setup and other test stuff for
- a 12V supply for the controller
- 4 x 6V golf cart batteries
- interconnecting cables for the batteries
- a PICkit 3
- a laptop
- a 0 - 5K throttle
- a serial cable
- and ... various cables and alligator clips
Paul and I got the wiring and old (dead) batteries removed from the golf cart
The new batteries (well, solar battery bank batteries) installed and wired ..
Everything is ready for the DC controller.
Paul had a few things left to do, so I jacked up the golf cart and put some blocking under it so the rear wheels are off the ground. Out first test will be done with the wheels up so we don't have to chase the cart around the yard.
When Paul was done, the first DC controller board was powered up and programmed.
12V to the DC/DC power supply. 24V output ... adjusted to 24.17V
Power up the DC control board ... And .. Umm .. we got a whiff of burnt plastic and felt some heat from the board. There was a 'snap' from the board ... we knew something was wrong but we didn't know WHAT was wrong.
SSSSSSSOOOOOOOOOOOOooooooo ... we went looking.
After checking out the power rails - which were fine - Paul found that there was a fault on the DC Control board. Hmm ... Some connector re-seating followed .. and one connector was wired wrong. For the B phase current sensor. But the Hall Effect sensor can likely handle a wiring problem ...
After that was fixed, there was another fault. A hardware fault. But it does not seem to be set anywhere? It is set at the beginning of the initialize code .. then reset ... and that's it. Nothing else seems to touch it? Paul says he ended up not implementing anything for this.
It resisted break points .. Port displays ... some added debug code ... I learned a few things! Like that in a PIC you WRITE to a LATCH variable mapped to a PORT, and that you READ back from a variable mapped to the INPUT of that PORT. If they don't match .. the output port has failed.
Turns out that the AND gate used to generate the hardware FAULT signal was installed backward .. pin 1 is marked for a reason .. but there is a notch on that end and a circle on the other end .. looks pretty close to the same in bad light ... so we think that the PIC output port pin was fighting with the output of the AND gate. Or that's the present theory ... we'll see when Paul gets the AND gate pulled off and checked. Then the PIC port (Port F bit 0) can be checked to determine if it is bad. At this point, we gave up on this board. Paul may have another PIC .. and definitely has another AND gate ..
The second DC controller was switched in, everything connected again, and the program burned into the PIC. Preliminary tests show PWM output, the debug code works, there are DC voltages of the appropriate values at the appropriate places on the board ... and we were done for the day!
We're set up to continue on Wednesday morning (if I can get over to Paul's in the morning .. I've had issues getting up in the morning!)
|
|
|
03-14-2016, 02:44 AM
|
#2628 (permalink)
|
Master EcoModder
Join Date: Aug 2012
Location: northwest of normal
Posts: 28,255
Thanks: 7,962
Thanked 8,788 Times in 7,247 Posts
|
Thanks for the updates.
On these holes in Mylar and sheet copper: Maybe they would punch better than drill?
|
|
|
03-14-2016, 10:50 AM
|
#2629 (permalink)
|
EcoModding Lurker
Join Date: Mar 2016
Location: italy
Posts: 40
Thanks: 5
Thanked 2 Times in 2 Posts
|
Hello guys i "All thanks to e*clipse" started trying the code on dspic30f6010a
serial comunication runs fine, configuration commands works just fine.. streaming part i'don't know how it works.. i someone wants to explain....
my configuration is:
current sensors: LEM LTS25-NP IN 8 AMPS RMS CONFIGURATION. with 13.33 A/V gain. i used 13.
Motor is ac induction motor with 230v 8.5A 2 pole motor 2850RPM
this is my configuration in software:
motor-type=1
kp=01000 ki=00010
current-sensor-amps-per-volt=0013
max-regen-position=0390
min-regen-position=0490
min-throttle-position=0510
max-throttle-position=0610
fault-throttle-position=0005
max-battery-amps=0008 amps
max-battery-amps-regen=0008 amps
max-motor-amps=008 amps
max-motor-amps-regen=008 amps
precharge-time=0050 tenths of a sec
rotor-time-constant=018 ms
pole-pairs=001
max-rpm=03000 rev/min
throttle-type=1
encoder-ticks=1024 ticks/rev
pi-ratio=062
raw-throttle=0513
but when the motor starts it oscillates and then it blocks.... i dont know why.. i'm sure that hardaware is ok because it works in openloop with 1162 app note's code..
i'm attaching also the modifactions done in the code.
Lines commented with SINGH are changed.
ACController.h
Code:
//#define PAULS_MOTOR
//#define ANDREWS_MOTOR
#define AC_INDUCTION_MOTOR_CONFIG
//#define DEBUG_MODE
#define OREGON_MOTOR_CONTROLLER
#define I_TRIS_THROTTLE _TRISB7 //B0 //previous settings singh
#define I_TRIS_CURRENT1 _TRISB0 //B1
#define I_TRIS_CURRENT2 _TRISB1 //B2
#define I_TRIS_INDEX _TRISB3 //B3
#define I_TRIS_QEA _TRISB4 //B4
#define I_TRIS_QEB _TRISB5 //B5
#define O_TRIS_CLEAR_FLIP_FLOP _TRISB6 //B6
#define I_TRIS_TEMPERATURE _TRISB2 //B7
#define I_TRIS_REGEN_THROTTLE _TRISB8 //B8
#define I_TRIS_DESAT_FAULT _TRISB9 //C13
#define I_TRIS_OVERCURRENT_FAULT _TRISB10 //C14
#define I_TRIS_UNDERVOLTAGE_FAULT _TRISB11 //E8
#define O_TRIS_LED _TRISA9 // high means turn ON the LED. //D1
#define O_TRIS_PRECHARGE_RELAY _TRISA10 // HIGH means turn ON the precharge relay. //D3
#define I_TRIS_GLOBAL_FAULT _TRISB12 //D2
#define O_TRIS_CONTACTOR _TRISA14 //D0
#define O_TRIS_CLEAR_DESAT _TRISB15 //F6
#define O_TRIS_BUFFER_ENABLE _TRISD11 //SINGH For enbling the buffer ic on pcb
#define O_TRIS_PWM_3H _TRISE5
#define O_TRIS_PWM_3L _TRISE4
#define O_TRIS_PWM_2H _TRISE3
#define O_TRIS_PWM_2L _TRISE2
#define O_TRIS_PWM_1H _TRISE1
#define O_TRIS_PWM_1L _TRISE0
#define I_LAT_THROTTLE _LATB7
#define I_LAT_CURRENT1 _LATB0
#define I_LAT_CURRENT2 _LATB1
#define I_LAT_INDEX _LATB3
#define I_LAT_QEA _LATB4
#define I_LAT_QEB _LATB5
#define O_LAT_CLEAR_FLIP_FLOP _LATB6
#define I_LAT_TEMPERATURE _LATB2
#define I_LAT_REGEN_THROTTLE _LATB8
#define I_LAT_DESAT_FAULT _LATB9
#define I_LAT_OVERCURRENT_FAULT _LATB10
#define I_LAT_UNDERVOLTAGE_FAULT _LATB11
#define O_LAT_LED _LATA9 // high means turn ON the LED.
#define O_LAT_PRECHARGE_RELAY _LATA10 // HIGH means turn ON the precharge relay.
#define I_LAT_GLOBAL_FAULT _LATB12
#define O_LAT_CONTACTOR _LATA14
#define O_LAT_CLEAR_DESAT _LATB15
#define O_LAT_BUFFER_ENABLE _LATB15
#define O_LAT_PWM_3H _LATE5
#define O_LAT_PWM_3L _LATE4
#define O_LAT_PWM_2H _LATE3
#define O_LAT_PWM_2L _LATE2
#define O_LAT_PWM_1H _LATE1
#define O_LAT_PWM_1L _LATE0
#define I_PORT_THROTTLE _RB7
#define I_PORT_CURRENT1 _RB0
#define I_PORT_CURRENT2 _RB1
#define I_PORT_INDEX _RB3
#define I_PORT_QEA _RB4
#define I_PORT_QEB _RB5
#define O_PORT_CLEAR_FLIP_FLOP _RB6
#define I_PORT_TEMPERATURE _RB2
#define I_PORT_REGEN_THROTTLE _RB8
#define I_PORT_DESAT_FAULT _RB9
#define I_PORT_OVERCURRENT_FAULT _RB10
#define I_PORT_UNDERVOLTAGE_FAULT _RB11
#define O_PORT_LED _RA9 // high means turn ON the LED.
#define O_PORT_PRECHARGE_RELAY _RA10 // HIGH means turn ON the precharge relay.
#define I_PORT_GLOBAL_FAULT _RB12
#define O_PORT_CONTACTOR _RA14
#define O_PORT_CLEAR_DESAT _RB15
#define O_PORT_BUFFER_ENABLE _RD11
#define O_PORT_PWM_3H _RE5
#define O_PORT_PWM_3L _RE4
#define O_PORT_PWM_2H _RE3
#define O_PORT_PWM_2L _RE2
#define O_PORT_PWM_1H _RE1
#define O_PORT_PWM_1L _RE0
ACController.c
Code:
// CH0 corresponds to ADCBUF0. etc...
// CH0=AN7, CH1=AN0, CH2=AN1, CH3=AN2.
// AN0 = CH1 = ADCurrent1 dspic30f6010a configurations by singh
// AN1 = CH2 = ADCurrent2 dspic30f6010a configurations by singh
// AN2 = CH3 = temperature dspic30f6010a configurations by singh
// AN7 = CH0 = ADThrottle dspic30f6010a configurations by singh
ADCurrent1 = ADCBUF1;
ADCurrent2 = ADCBUF2;
Ia = ADCurrent1; // CH1 = ADCurrent1
Ib = ADCurrent2; // CH2 = ADCurrent2.
Ia -= vRef1; // vRef1 is just a constant found at the beginning of the program, approximately = 512, that changes the current feedback from being centered at 512 to centered at 0. It's specific to current sensor #1.
Ib -= vRef2; // vRef2 is just a constant found at the beginning of the program, approximately = 512, that changes the current feedback from being centered at 512 to centered at 0. It's specific to current sensor #2.
// So, you must change the interval to [-4096, 4096], so as to match the throttle range below to make feedback comparable with commanded current. So...
Ia <<= 4; // Ia is now in [-4096, 4096] if it was in [-256, 256]. In other words, if it was in [-2*LEM Rating, 2*LEM Rating].
Ib <<= 4; // Ib is now in [-4096, 4096] if it was in [-256, 256]. In other words, if it was in [-2*LEM Rating, 2*LEM Rating].
Ic = -Ia - Ib;
Ib_times2 = (Ib << 1);
rawThrottle = ADCBUF0; //Singh
throttleSum += rawThrottle;
temperatureSum += ADCBUF3; //Singh
|
|
|
03-14-2016, 12:07 PM
|
#2630 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
Quote:
Originally Posted by shaggythegangsta
Hello guys i "All thanks to e*clipse" started trying the code on dspic30f6010a
serial comunication runs fine, configuration commands works just fine.. streaming part i'don't know how it works.. i someone wants to explain.... ![Smile](/forum/images/smilies/smile.gif)
|
You set the 'flags' of all of the variables that you want to stream to 1
I think these are all of them:
stream-time 1
stream-id 1
stream-iq 1
stream-idref 1
stream-iqref 1
stream-ia 1
stream-ib 1
stream-ic 1
stream-percent-volts 1
stream-battery-amps 1
stream-raw-throttle 1
stream-throttle 1
stream-temperature 1
stream-slip-speed 1
stream-electrical-speed 1
stream-mechanical-speed 1
The you set your data-stream-period, which is how often you want them to print on the screen. 1000 = 1 second.
data-stream-period 1000
And this is how they will print out on the terminal screen:
Code:
time,Id,Iq,IdRef,IqRef,Ia,Ib,Ic,percentVolts,batteryAmps,rawThrottle,throttle,temperaure,slipSpeed,electricalSpeed,mechanicalSpeed,
00001,-004.3,-002.0,+000.0,+000.0,+002.3,+002.3,-004.7,000,+000.0,0438,-2146,013,-0398,-00398,+00000,
01001,-004.4,-001.5,+000.0,+000.0,+002.3,+002.3,-004.7,000,+000.0,0438,-2146,013,-0147,-00147,+00000,
02001,-005.5,+000.7,+000.0,+000.0,+004.6,+000.0,-004.7,000,+000.0,0438,-2146,013,-0045,-00045,+00000,
03001,-009.9,+000.9,+000.0,+000.0,+007.0,+002.3,-009.4,000,+000.0,0439,-2146,013,+0000,+00000,+00000,
04001,-007.1,+000.9,+000.0,+000.0,+004.6,+002.3,-007.1,000,+000.0,0438,-2146,013,-0060,-00060,+00000,
05001,-007.1,-001.1,+000.0,+000.0,+004.6,+002.3,-007.1,000,+000.0,0438,-2146,013,+0483,+00483,+00000,
Press Return to stop the streaming
Copy the text from your terminal screen to a text file, or capture it to a text file. When you open that file with excel, it imports the columns with commas between them.
|
|
|
|