View Single Post
Old 09-06-2014, 11:51 AM   #1087 (permalink)
MPaulHolmes
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
There's an external chassis mount 15w 9-18v input, 24v output dc dc that connects to the control board, giving it 24v. There's also a 7-36v input, 5v output on the control board. No +/-15v though. I guess you could make +/-12v out of the 24v supply? Do you know how stringent they are about the +/- 15v?

There's the ia, ib, and ic axis, all 120 degrees apart from each other. The problem is, usually encoders are not set up so that 0 degrees corresponds to ia (along the x axis). Do you know if the resolver is oriented so that ia is along what the rotor considers 0 degrees?

Your board sounds great. I was very bilingual with x86 assembly and C on my old 386 and 486 computers (and 286!) haha. You could MELT some old monochrome displays with assembly language by turning up the electron beam too high. I'm not very familiar with microchip assembly. But I can figure it out if I have to. My goal is not to use it though, so more people can make sense of what I'm doing.

I had a video game company for a year or 2 where I did lots of assembly language programming. I made a great space game that would have been cutting edge in 1985. Unfortunately, it was 1995. haha. I eventually quit programming PCs when everything left DOS, because Windows took over everything, and efficiency seemed to be flushed down the toilet. It was actually a very depressing time for me! LOL. But all the fast programming tricks I learned from all of Andre Lamothe's books (tricks of the game programming gurus, etc...) to get 30 frames per second out of a 16MHz computer have been extremely applicable for microcontroller programming. That's why I always use 16MHz now. As a shout-out to my old 386. Well, for the FOC code, I'm doing 30MHz. oh well... sorry my beautiful old computer.

I actually used a little part of one of Andre's books just yesterday. Did you know you can get a very good approximation to distance between 2 coordinate points without a square root? There's a part in the code where I need to clamp the MAGNITUDE of the vector <vq,vd> to a maximum radius. Know what Microchip did in their field oriented control code? They just wouldn't let the PWM get higher than 70% duty!!! They wanted to avoid doing a square root.
fast square root (vq < vd, and both positive):
Code:
	fastDist = vq + vd - (vq >> 1) - (vq >> 2) + (vq >> 4);
Now, that gets you within a few %. But yesterday, I found that you could just make a lookup table indexed by (vq/vd * 1024), and have the entries in that lookup table contain the error for the distance (in terms of percent). So, you can get the exact distance for any <vq,vd>!! And then you can scale vq and vd down just small enough so that they reside on the circle of maximum radius! Booya microchip! haha. Thank you Andre!
__________________
kits and boards
  Reply With Quote
The Following 3 Users Say Thank You to MPaulHolmes For This Useful Post:
a8ksh4 (11-12-2014), e*clipse (09-06-2014), mpgmike (01-31-2022)