05-06-2015, 11:11 AM
|
#1841 (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 P-hack
I didn't use a makefile or template (you have some junk in there). I assume you have xc16 installed.
|
Yes. XC16 is installed.
Quote:
I just created a new project -> next
standalone next
device dsPic30f4011 next
pickit2 (or whatever) next
xc16 next
project name: psinduction (or whatever) finish
To add the files (without learning git, though you probably should at some point), you can just unzip the attachment in this post to disk, then
right click on "source files"
add existing items from folders
"add folder"
browse to /home/p-hack/ACInductionController (or whatever location you unzipped them to)
"add"
to build, click on run -> clean and build.
|
Thank you for the detailed instructions! I will do this tonight and report back. I've been struggling with this for a few weeks on and off ... maybe there are a couple of files in the zip that I didn't have .. or something ..
|
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
05-07-2015, 01:27 AM
|
#1842 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
Embarrassing post #2 - compiler - followup
I followed the instructions as closely as possible. The project is even named psinduction!
.. and It builds! No errors. I am *HAPPY*
Then I repeated what I think I started out doing before .. same steps to begin with ... name it psinduction2
BUT I copied the files from the unzip directory to the project directory myself, then added the files to the project one at a time with Add Existing item instead of Add Existing Items from folders ...
... but unlike my previous attempts .. it worked! No errors, successful build. Hmmm.
So I went through my notes and it appears that I added the .h files to the Header file section and the .c files to the source. So I tried that as psinduction3. And that works as well. Not that I should complain that things work .. but I *DID* waste a lot of time trying to get the code to compile and messing up something else obvious .. that I can't figure out right now ...
I can't reproduce the errors that I got .. but I don't really care .. the code builds and that's what I've been struggling with.
Tomorrow, or maybe Friday, I can get back to testing the AC controller and figure out what input the controller is waiting for.
WOOHOO!
|
|
|
05-07-2015, 04:56 AM
|
#1843 (permalink)
|
Dreamer
Join Date: Nov 2013
Location: Australia
Posts: 350
Thanks: 95
Thanked 214 Times in 151 Posts
|
Maybe the code needs echo some progress messages to the serial port?
Would have to move the InitUART2(); to earlier in the main()
Then have TransmitString() send output to the serial port before and after each event of significance in the main().
Something like this.
Moving EEPROM data to RAM...
EEPROM data moved.
Initialise timers...
Timers initialised.
High pedal lockout check...
Pedal checked OK.
Precharging...
Precharge complete.
Closing main contactor.
Opening Precharge contactor.
PWM interrupt enabled.
Resetting any faults.
Clear Receive Buffer.
Starting Menu...
It would likely go past to quickly to be seen but if you had a fault then it would stop somewhere giving you a clue as to the cause. Or at least an area to look at.
|
|
|
The Following 3 Users Say Thank You to Astro For This Useful Post:
|
|
05-07-2015, 11:18 AM
|
#1844 (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 Astro
Maybe the code needs echo some progress messages to the serial port?
Would have to move the InitUART2(); to earlier in the main()
Then have TransmitString() send output to the serial port before and after each event of significance in the main().
Something like this.
Moving EEPROM data to RAM...
EEPROM data moved.
Initialise timers...
Timers initialised.
High pedal lockout check...
Pedal checked OK.
Precharging...
Precharge complete.
Closing main contactor.
Opening Precharge contactor.
PWM interrupt enabled.
Resetting any faults.
Clear Receive Buffer.
Starting Menu...
It would likely go past to quickly to be seen but if you had a fault then it would stop somewhere giving you a clue as to the cause. Or at least an area to look at.
|
Good idea! This can be left in the code and I think RTD explorer will ignore it .. but I'm not sure. Perhaps this can be my debugging version.
I looked back through the posts - apparently I did not do a good job of posting progress!!
Where I left off testing, when Paul had started working on MPLAB X, the contactors pull in, I can get to the menu. I can change the PID parameters. When I run 'run-pi-test' ... nothing happens. The motor does not rotate, or hum, no current from the battery pack ...
So I sat and stared at it for a while and decided it was time to get to the point where I can build the code and use the debugger to step through and figure out what it's waiting for.
Adding print statements to the serial will help, I'm sure.
|
|
|
05-11-2015, 02:01 AM
|
#1845 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
Not much progress to report, but here goes:
- saved the hex file Paul loaded in while I was in Phoenix
- compiled and downloaded ACController code from instructable (thanx - P-hack!)
- precharge and main contactors click in sequence
- menu text is displayed (at 115,200 baud, not 38,400)
- config shows the default config
- run-pi-test does nothing, or at least appears to do nothing
40.5V DC between B- and B+ (3 x 12V lead-acid)
no current coming from the batteries
no resistance on the motor when you turn the shaft
.. tomorrow I try debug mode ...
|
|
|
05-12-2015, 01:23 AM
|
#1846 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
OK - Let's try that again
I ran ACController in debug mode ... and then went through the code to locate Run-Pi-test so that I could set a break-point ...
There is no command run-pi-test in ACController.c, or UART4011.c ... so I guess it makes sense that the controller did not respond to this command
I went through the instructable again (since I knew I read that command somewhere!). And I don't think I missed it. I did not see the name of the program that you run that will include run-pi-test .. but I thought it would be ACController.c
A bit further down in the instructable there are more instructions for 3 phase motors, and that program is ComputerRotorFluxAngle. Not sure if I need to run another one first, but I will run that one tomorrow and see what happens!
It does not appear to have a run-pi-test command either .. and the zip file does not contain UART4011.c or UART4011.h
I'll run it and see what happens.
|
|
|
05-15-2015, 06:28 PM
|
#1847 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
Not really an update
No progress for the week - will look through the various programs on the weekend and see if I can identify which program to run for the pi-test.
|
|
|
05-15-2015, 07:42 PM
|
#1848 (permalink)
|
PaulH
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
|
I'll get you some directions and new code by tomorrow morning.
|
|
|
05-16-2015, 11:01 AM
|
#1849 (permalink)
|
PaulH
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
|
The run-pi-test code was on my computer that was stolen. I never backed up that version. So, run-pi-test continues to this moment to not exist. Well, I could call the hood, and ask them about it. haha. I'm getting close to being done and sending you some hex files so you can run the PI loop tuning test.
|
|
|
05-16-2015, 11:29 AM
|
#1850 (permalink)
|
Dreamer
Join Date: Nov 2013
Location: Australia
Posts: 350
Thanks: 95
Thanked 214 Times in 151 Posts
|
Quote:
Originally Posted by MPaulHolmes
The run-pi-test code was on my computer that was stolen. I never backed up that version. So, run-pi-test continues to this moment to not exist. Well, I could call the hood, and ask them about it. haha. I'm getting close to being done and sending you some hex files so you can run the PI loop tuning test.
|
Are you going to re-create the run-pi-test as a separate file or integrate it into the accontroller file?
I think you said you were able to fit both the motor test and normal operation code into a single hex? Was that the one that was on the laptop?
|
|
|
|