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

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 03-26-2016, 04:46 PM   #2701 (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: 749
Thanked 565 Times in 447 Posts
The Windydrew custom fimrware for racing - based on Paul Holmes Open Source AC Controller 1.1

There is a throttle that is scaled 0 - 100% throttle with no regen programmed.

There is a momentary button (push to engage, disengaged when you let go of the button) that is connected to the LED pin that is wired normally open. Normal state is the button released = input Hi = forward. Button Pressed = input Lo = reverse (or regen braking)

First the regen sequence
Code:
button		Throttle	description
Released	0 - 100%	normal forward controlled by accelerator pedal, 0 - 100%
Released	0%		Coasting, no acceleration
Pressed		0%		If rpm >= 50, switch throttle signal to regen
Pressed		30%		30% regen braking
Pressed		0%		Coasting again, remain in forward with regen
Released	0%		normal forward controlled by accelerator pedal, 0 - 100%
Now we describe reverse
Code:
Released	0 - 100%	normal forward controlled by accelerator pedal, 0 - 100%
Released	0%		Coasting, no acceleration
Pressed		0%		If rpm < 50, switch to reverse.
Pressed		30%		throttle reverse
Pressed		0%		Coasting again, remain in reverse or forward with regen
Released	0%		normal forward controlled by accelerator pedal, 0 - 100%
Did I get that all right?

  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 03-26-2016, 06:39 PM   #2702 (permalink)
AC Customs car builder
 
Join Date: Jan 2009
Location: Kansas
Posts: 51

S10 - '99 Chevy S10 Base
90 day: 23.5 mpg (US)

Purple People Eater - '95 Geo Metro LSi
90 day: 34.76 mpg (US)

Volt - '14 Chevy Volt Premium
90 day: 1680 mpg (US)
Thanks: 6
Thanked 31 Times in 14 Posts
Quote:
Originally Posted by thingstodo View Post
The Windydrew custom fimrware for racing - based on Paul Holmes Open Source AC Controller 1.1

There is a throttle that is scaled 0 - 100% throttle with no regen programmed.

There is a momentary button (push to engage, disengaged when you let go of the button) that is connected to the LED pin that is wired normally open. Normal state is the button released = input Hi = forward. Button Pressed = input Lo = reverse (or regen braking)

First the regen sequence
Code:
button		Throttle	description
Released	0 - 100%	normal forward controlled by accelerator pedal, 0 - 100%
Released	0%		Coasting, no acceleration
Pressed		0%		If rpm >= 50, switch throttle signal to regen
Pressed		30%		30% regen braking
Pressed		0%		Coasting again, remain in forward with regen
Released	0%		normal forward controlled by accelerator pedal, 0 - 100%
Now we describe reverse
Code:
Released	0 - 100%	normal forward controlled by accelerator pedal, 0 - 100%
Released	0%		Coasting, no acceleration
Pressed		0%		If rpm < 50, switch to reverse.
Pressed		30%		throttle reverse
Pressed		0%		Coasting again, remain in reverse or forward with regen
Released	0%		normal forward controlled by accelerator pedal, 0 - 100%
Did I get that all right?
Looks great. I had the latest that he sent me. The one he'd used on his leaf motor, which it what I'm using as well. I can email it to you if you want to load it to github or something.

Last edited by WindyDrew; 03-26-2016 at 06:45 PM..
  Reply With Quote
Old 03-26-2016, 10:49 PM   #2703 (permalink)
EcoModding Lurker
 
Join Date: Mar 2016
Location: Trinidad
Posts: 7
Thanks: 5
Thanked 3 Times in 3 Posts
Quote:
Originally Posted by e*clipse View Post
Regarding frequency - it would be nice to have a way to adjust for different oscillator frequencies and PWM frequency settings without messing up code behavior later. I would really like to play with the PWM frequency.
- E*clipse
I noticed that Paul uses a Delay function dependent on the instruction clock - Fcy (yes?). This forms the basis for seconds and tenths of seconds delays. There's also a uS delay function but it is hardcoded dependant on the clock frequency.

Right now that portion of code, from the program I have, assumes a 30MHz clock but based on the new board the system clock is 29.4912MHz:
Code:
 -> Fcy = FOSC/4= crystalFreq*PLLmultiplier/4 = 7.3278*16/4.
Based on what I read in the manuals, I think this is correct. Paul hard-codes a counter to be used by the delay function to count the clock ticks that add up to the time unit required (1 second, 1/10th of a second). I've adjusted the code I have to work with the clock frequency defined on the new board design - at least I'm hoping that's what I did.

I'm thinking that modifying these so the multiplier used by the functions is predetermined based on the clock frequency can help with what you want to do. Possibly the clock frequency can be one of the initialization parameters and the multiplier determined from it.

Regarding PWM frequency, adjusting PTPER value in the initializing function for the AD and PWM seems like it should help. This is also tied to the Fcy so again the abstraction concept above can allow easier adjustment perhaps? Incidentally the Fcy is defined based on crystal in the new board design.

If this doesn't make sense please let me know as it will help with my understanding of the code.

Last edited by tajman; 03-26-2016 at 11:21 PM.. Reason: Correction: Should be Fcy instead of FOSC
  Reply With Quote
The Following User Says Thank You to tajman For This Useful Post:
MPaulHolmes (03-26-2016)
Old 03-28-2016, 01:52 AM   #2704 (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: 749
Thanked 565 Times in 447 Posts
March 27 update on my AC controller testing

Quick Summary

The AC controller is back up and running after I added the new DC controller to the setup. The AC motor still rotates both motors clockwise. The serial connection is still at 115,200 baud, n,8,1.

There is video, but it has not been edited yet.

Tomorrow I'd like to:
- verify that the slap switch shuts down both the DC and AC controllers if something goes wrong
- test the hardware overcurrent on the AC controller
  Reply With Quote
Old 03-28-2016, 10:40 PM   #2705 (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,368
Thanked 1,202 Times in 765 Posts
Does anybody know how to edit the wiki? people always write to me telling me all the links are dead. It would save a lot of time if I could just fix it. instead of each time trying to find all the files they're looking for.
__________________
kits and boards
  Reply With Quote
Old 03-28-2016, 10:55 PM   #2706 (permalink)
AC Customs car builder
 
Join Date: Jan 2009
Location: Kansas
Posts: 51

S10 - '99 Chevy S10 Base
90 day: 23.5 mpg (US)

Purple People Eater - '95 Geo Metro LSi
90 day: 34.76 mpg (US)

Volt - '14 Chevy Volt Premium
90 day: 1680 mpg (US)
Thanks: 6
Thanked 31 Times in 14 Posts
Quote:
Originally Posted by MPaulHolmes View Post
Does anybody know how to edit the wiki? people always write to me telling me all the links are dead. It would save a lot of time if I could just fix it. instead of each time trying to find all the files they're looking for.
Under view source after you log in to wiki. I don't have permissions, but seemed like I could've edited if I did.
Attached Thumbnails
Click image for larger version

Name:	2016-03-28 21.54.03.png
Views:	40
Size:	30.4 KB
ID:	19836  
  Reply With Quote
Old 03-29-2016, 12:15 AM   #2707 (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: 749
Thanked 565 Times in 447 Posts
March 28 update on my AC controller testing

Quick Summary

I have some results ... but I have some problems as well.
Please look at Third and Fourth, as well as the attached log files.

Details

First - a trivial problem with my bluetooth headset. The bluetooth headset does not play nicely with the bluetooth on my gopro. So the gopro is not going to be recording video .. or I have to figure out how to shut off the bluetooth without being able to use the app ... inconvenient.

Second - a less trivial problem with my bluetooth headset. The AC controller interferes with the bluetooth headset when I get within about 2 feet of the controller ... I guess interference makes sense ... so I may have to use shielded VFD cable from the output of the controller to the motor terminals and pay some attention to grounding and shielding .. LATER!

Third - some control issues. In my previous setup, with a separate 24V battery pack .. and no DC controller .. I just turned on the DC motor and the rest of the testing was done on the AC controller.
Now, with both a DC controller and an AC controller on the same battery pack, the voltage on the DC controller is much higher. I would overspeed the DC motor if I put the throttle on too high.
With the AC throttle set to regen .. a lot of regen .. since I had not centered it after my last test ... the DC controller started to rotate the motor .. and the regen kicked in .. slowed down the motor .. and spun the motor backward before the AC controller could disengage. Only a couple of revolutions .. but quite aggressive. This may not be something that could happen in *REAL LIFE* .. but it IS INTERESTING!!

Fourth - So the method I tried was to dial up the AC motor until it started to rotate ... then back off the AC throttle to 0 throttle. That's where I started.
Start up the DC motor a bit (accelerate), use the AC motor to regen (decelerate). Back and forth ... up to about 200 amps. Accelerate with the DC controller, decelerate with the AC controller, rinse and repeat. Then the AC controller seems to just quit .. at least with regen. I fiddle with the AC throttle and it seems to recover .. and then it quits again.
The DC controller starts to spin up the motor out of control ... and I hit the slap switch to kill the whole thing. I don't know if the problem happens at a specific speed, or a timeout, or some other things that I have not thought of. But it is interesting.

I'm thinking that perhaps I should use a lower voltage pack so that the control issues don't spiral so quickly? It's something to try.

Comments?
Attached Files
File Type: zip mar28.zip (37.5 KB, 28 views)
  Reply With Quote
Old 03-29-2016, 06:11 PM   #2708 (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,368
Thanked 1,202 Times in 765 Posts
For Michael's tests, Here's the current data for AC Test 2. This had a current magnitude of 311 amps!! (220amp peak for Id and Iq):


AC Test 1 curents seem to track OK too:


Do you know where in graphs the regen quits? Could the sudden cutting out of regen when you hit zero RPM be the problem? Or could the throttle be hitting weird skipping spots? I don't see anything weird in the above graphs.
__________________
kits and boards
  Reply With Quote
Old 03-30-2016, 12:13 AM   #2709 (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: 749
Thanked 565 Times in 447 Posts
Quote:
Originally Posted by MPaulHolmes View Post
Do you know where in graphs the regen quits?
I thought it would be obvious .. so maybe the regen didn't 'quit' and I just hit a flat spot on the potentiometer?

Quote:
Could the sudden cutting out of regen when you hit zero RPM be the problem?
I don't think so - the cut-out of the regen when the DC motor just started up was with little current, at the beginning of AC Test 1.

Quote:
Or could the throttle be hitting weird skipping spots?
I think that is what happened. But the control is very aggressive since the scaling on the DC controller is based on a 5K pot with a 100 or 120 degree sweep. I think I want to try out a 48V or 56V pack so that the control is a bit less touchy. I also need to extend the throttle on the DC controller and get it mounted, so that I can adjust both throttles without moving from one location to another ... and see the laptop screen for the speeds and the currents.

It will likely take me until the weekend to get that set up.

Quote:
I don't see anything weird in the above graphs.
I don't see anything weird either. I guess I should have checked that the the raw throttle was tracking my throttle position. I have a better potentiometer - another 20 turn, 10 K unit. Maybe I should get that one mounted.

I don't have the liquid cooling connected yet - I should buy the brass fittings this week.
  Reply With Quote
Old 03-30-2016, 01:15 PM   #2710 (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,368
Thanked 1,202 Times in 765 Posts
I might know what the problem is. Remember how i had to change the PI code so that it ALWAYS did the PI, even at zero throttle in the case of the permanent magnet motor? Some weird behavior happened with your motor when it went to zero from nonzero. The slip speed and electrical speed went way negative, and then WAY WAY positive for an instant. I'm thinking that's because your code still has the old way of dealing with transition from nonzero throttle to zero. I need to get you an updated .hex file.

__________________
kits and boards
  Reply With Quote
The Following User Says Thank You to MPaulHolmes For This Useful Post:
thingstodo (03-30-2016)
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 10:55 PM
Paul & Sabrina's Cheap EV Conversion MPaulHolmes Fossil Fuel Free 542 11-12-2016 09:09 PM
Contest! Name Paul & Sabrina's controller MetroMPG Forum News & Feedback 120 10-22-2011 01: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