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

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 09-25-2015, 01:46 AM   #2071 (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
Update for Sep 24

Summary: My encoder no longer works with the AC controller

I added aluminum foil to both sides of the unshielded cat5 cable, and connected it to the ground on the power supply. I ran the controller and the motor was controlled like there was no encoder signal. a<enter> shows rpm is 0, then 110, then -4 ...

OK. Remove one half of the aluminum foil. The controller acts the same way. Darn.

OK. Remove the other half of the aluminum foil. The controller acts the same way.

Cycle power and try again. Same result.

OK. This is bad.

Check voltages on the encoder. 24V in, 0V in - check. Channel A out, 14.775 volts. Channel B out, 14.75 volts. That seems OK ... Hmm.

Perhaps it is time to make a cable for the encoder built into the Siemens motor. It appears that the power source is 5V, so the motor can be directly connected to the controller. I need to put female pins on one end and a 5 pin 0.1 header on the other end.

I wonder if the controller can do decent control with only 64 pulses per revolution?

Hey - what if I shorted the output of the encoder somehow with the tin foil? I still have Abar and Bbar signals (inverse of A and B). If I can't get the siemens encoder working, I'll likely try this encoder again with Abar and Bbar.

  Reply With Quote
The Following User Says Thank You to thingstodo For This Useful Post:
MPaulHolmes (09-25-2015)
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 09-25-2015, 10:28 AM   #2072 (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,119 Times in 734 Posts
Normally the controller's 5 pin connector QEI supplies the +5v and ground for the signals. what is the ground of your 24v supply (that powers the encoder)? Is it the same ground that is used as the input of the How is it connected to the ground on the controller? is the +5v generated on the control board connected to the +5v generated by the voltage divider?
__________________
kits and boards
  Reply With Quote
Old 09-25-2015, 10:47 AM   #2073 (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 MPaulHolmes View Post
Normally the controller's 5 pin connector QEI supplies the +5v and ground for the signals. what is the ground of your 24v supply (that powers the encoder)?
It is the ground from the 5 pin header. 24V is supplied from the DC/DC converter

Quote:
Is it the same ground that is used as the input of the How is it connected to the ground on the controller? is the +5v generated on the control board connected to the +5v generated by the voltage divider?
Code:
DC/DC 24V -------------------------------------encoder +

5 pin A ----------------------10K resistor-------encoder A
                         5K resistor
5 pin gnd ---------------------------------------encoder gnd
                         5K resistor
5 pin B ----------------------10K resistor-------encoder B

15ish volt output of the encoder -> 10K in series with encoder signal 
drops about 10V -> 5K across controller A and gnd give 4.7 - 4.9V signal
did that make any sense?

The aluminum foil was a single wrap around the cat5 cable from encoder to my little circuit board, then from the circuit board to the controller. But, since it is conductive ... it may have touched something that it should not have?
  Reply With Quote
Old 09-25-2015, 03:39 PM   #2074 (permalink)
Permanent Apprentice
 
Join Date: Jul 2010
Location: norcal oosae
Posts: 523
Thanks: 351
Thanked 296 Times in 213 Posts
Quote:
Originally Posted by thingstodo View Post
It is the ground from the 5 pin header. 24V is supplied from the DC/DC converter



Code:
DC/DC 24V -------------------------------------encoder +

5 pin A ----------------------10K resistor-------encoder A
                         5K resistor
5 pin gnd ---------------------------------------encoder gnd
                         5K resistor
5 pin B ----------------------10K resistor-------encoder B

15ish volt output of the encoder -> 10K in series with encoder signal 
drops about 10V -> 5K across controller A and gnd give 4.7 - 4.9V signal
did that make any sense?

The aluminum foil was a single wrap around the cat5 cable from encoder to my little circuit board, then from the circuit board to the controller. But, since it is conductive ... it may have touched something that it should not have?
Oh, I may see something here, regarding your shielding.

Generally, you don't want to connect the shield to both the main circuit board's ground and the "satellite" circuit boards ground. The shield should only connect to the main circuit board's ground. Otherwise, you can get current loops that are separate (and dynamic) from the normal ground.

This point was emphasized in my EMI class, as well as the instructions for shielding the inputs on my Sumitomo VFD.

Hope this helps,

E*clipse
  Reply With Quote
The Following User Says Thank You to e*clipse For This Useful Post:
MPaulHolmes (09-25-2015)
Old 09-25-2015, 04:09 PM   #2075 (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,119 Times in 734 Posts
I started testing the sensorless late last night. It was using just a bit too much processing time to smooth out and correct Ialpha, Ibeta, Valpha, Vbeta, and derivative(Ialpha) and derivative(Ibeta), so I'm bumping it up to 29.5MHz instead of the 14.7MHz. oh well! haha. An extra 0.3watt or something like that for sensorless.

I think the ground loop thing might be right. Also, the stepped down +5v signal would be from the +24v supply, which was unfiltered, whereas the +5v supply from the controller was filtered, so combining the 2 5v signals might introduce 5v noise? The nice thing is you can short circuit the 5v regulator all day long and it won't care, so I doubt anything too terrible is broken. Plus, the 64 tick encoder on the motor is more than enough. PLus, it will be sensorless in no time! so who cares! haha.
__________________
kits and boards
  Reply With Quote
The Following 2 Users Say Thank You to MPaulHolmes For This Useful Post:
e*clipse (09-25-2015), thingstodo (09-26-2015)
Old 09-25-2015, 04:15 PM   #2076 (permalink)
Permanent Apprentice
 
Join Date: Jul 2010
Location: norcal oosae
Posts: 523
Thanks: 351
Thanked 296 Times in 213 Posts
Paul - is the sensorless.c code you sent the same code you're working on now w/ thingstodo? Wow. 42 pages of code. This may take a bit of coffee.

I did make it through AC-Controller V-Hz.
It's nicely commented - that's a big help.

VV Is this generally right? VV
It basically advances around the sinusoid defined in the huge lookup table at the start. The amount of advance is determined by the "throttle_feedback" variable.

The throttle_feedback variable is set by the AtoD converter, which is triggered by the PWM. This is all handled in a huge interrupt, ADCInterrupt, starting on page 7.

If this is right, it doesn't really use SVM; the variables theta1, theta2, and theta3 are the angle variables, with theta2 clocked 120 degrees and theta3 clocked 240 degrees from theta1.

You comment that it's ok if theta2 and theta3 overflow when they are being clocked relative to theta1. Example:
theta2 = theta1 + 0x5555; // 120 degree offset. Who cares if it overflows. it just wraps around. Heck ya!

I'm confused - if theta2 gets larger than the 65535, it will go to zero + the difference?

After that, the PWM duty cycle is set based on the sin values from the lookup table.

Did I generally get this right? Also - please explain how the rollover works - this could make things much easier.

-E*clipse
  Reply With Quote
Old 09-25-2015, 04:28 PM   #2077 (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,119 Times in 734 Posts
Quote:
Originally Posted by e*clipse View Post
Paul - is the sensorless.c code you sent the same code you're working on now w/ thingstodo? Wow. 42 pages of code. This may take a bit of coffee.
yes!
what does VV mean? Ya, the original V/Hz I did didn't use space vector modulation.

Quote:
Originally Posted by e*clipse View Post
You comment that it's ok if theta2 and theta3 overflow when they are being clocked relative to theta1. Example:
theta2 = theta1 + 0x5555; // 120 degree offset. Who cares if it overflows. it just wraps around. Heck ya!

I'm confused - if theta2 gets larger than the 65535, it will go to zero + the difference?
That's exactly what it does. Isn't it neat that they thought of just such emergencies?

You got that stuff! For an unsigned int, 65535 + n = n - 1. It's modulo 65536 arithmetic. For example:
34059 + 59412 = 93471 MOD 65536 = 93471 - 65536 = 27935.

So, think of the angle as time. The faster time speeds forward, the quicker you work your way through the sine wave, just stopping along the way to quickly set the duties to wherever you are on the 3 waveforms. The faster you go, you may eventually only pick 20 points evenly spaced, but even that looks an awful lot like a sine wave. So the faster you go, the lower the resolution of the sine wave, but it's still a sine wave, but with a higher frequency.
Quote:
Originally Posted by e*clipse View Post
This is a fake quote. it's so much fun making people say things they didn't actually say! hahaha
__________________
kits and boards
  Reply With Quote
The Following User Says Thank You to MPaulHolmes For This Useful Post:
e*clipse (09-25-2015)
Old 09-25-2015, 04:31 PM   #2078 (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,119 Times in 734 Posts
By the way, the variables are generally all global because during debugging, it won't let you see the value of them if they "aren't in scope". So, I just make them all in scope.
__________________
kits and boards
  Reply With Quote
The Following 2 Users Say Thank You to MPaulHolmes For This Useful Post:
e*clipse (09-25-2015), thingstodo (09-26-2015)
Old 09-25-2015, 05:03 PM   #2079 (permalink)
Permanent Apprentice
 
Join Date: Jul 2010
Location: norcal oosae
Posts: 523
Thanks: 351
Thanked 296 Times in 213 Posts
Thanks a bunch Paul!

With "VV" I was just trying to point down. Sorry for the confusion.

Quote:
That's exactly what it does. Isn't it neat that they thought of just such emergencies?

You got that stuff! For an unsigned int, 65535 + n = n - 1. It's modulo 65536 arithmetic. For example:
34059 + 59412 = 93471 MOD 65536 = 93471 - 65536 = 27935.
Ohhhh! That's very smart! Now I see the point of that.... d'Oh!

I'm also trying to focus on what's important (regarding angle, time, etc - not sanity LOL!) I think for this application neither are actually important. I mean, time's important if you need speed information, but you really don't. Also the specific angle isn't really important, just the relative angles ( previous position, next position, clocking of phases ) We don't really need specific angles because no one, even F1 drivers, cares about the exact rotary position of their tires. They should just be rotating, not dragging on the road. If we were controlling CNC lathes, that's a whole other can o' worms...

I like your use of global variables - that also make a lot of sense.

Thanks a bunch! I guess I'll go make some coffee!

E*clipse
  Reply With Quote
The Following User Says Thank You to e*clipse For This Useful Post:
thingstodo (09-26-2015)
Old 09-25-2015, 05:29 PM   #2080 (permalink)
EcoModding Lurker
 
Join Date: Sep 2015
Location: Norway
Posts: 11
Thanks: 10
Thanked 12 Times in 7 Posts
Hi all. New here..

I've been reading the project over at Instructables - instructables.com/id/200kW-AC-Motor-Controller-for-Electric-Car - with great interest. I've also read the code on GitHub and tried to follow along. Awsome work! (PS Paul, I sent you a PM over there about the schematics and such..)

This is the project that wants me to try going electric. One of my criterias is that the car should perform like it did (or better) on petrol.

One thing I have in mind is charging. I don't want to use a lot of space (and weight) on a big charger to top off the batteries needed to keep up with inverter. I've been doing some research and found this: google.com/patents/US4920475

If you look at the 3th picture - "all you need" is a rectifier and a filter on the mains to charge the car using the motor controller's regen function. - or is it?

If it's doable - is this somthing that this controller can handle?

Another question: How does the controller know the voltage sendt (also with regen) back to the batteries? I mean, so you don't get an early new years eve show..


- About me: Engineer in automation (industrial) - great interest in programming, electronics and cars

(sorry about the links - post count is to low for "real" links)


Last edited by danibjor; 09-25-2015 at 05:38 PM..
  Reply With Quote
The Following User Says Thank You to danibjor For This Useful Post:
MPaulHolmes (09-26-2015)
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