3D 3-phase Lissajous figure - Page 1
Forum section: electronics / general

author: Circlotron
author_rank: Super Contributor
timestamp: October 18, 2020, 10:52:13 am
content: Just trying to visualise the above. Each phase is equal voltage, sinusoidal, and of course 120 deg apart. My thinking so far is that it would be a circle when viewed from the appropriate angle, andthe angle that it would be tilted onwould be if the circle was the largest circle that could be fitted inside a given sized cube. Any ideas on this?

author: daqq
author_rank: Super Contributor
timestamp: October 18, 2020, 05:07:19 pm
content: Sounds reasonable. I brewed up a quick bit of code for Octave/Matlab if anyone wants to play around.Code:clc; clear;Amps = [1, 1, 1];Phases = [0, 120, 240];Freqs = [1, 1, 1];Npoints = 1000;TMax = 3;Time = linspace(0, TMax, Npoints);Phases = pi * Phases / 180;Freqs = 2 * pi * Freqs;TPoints = Phases + (Time' .* Freqs);Sines = Amps .* sin(TPoints);X = Sines(:,1);Y = Sines(:,2);Z = Sines(:,3);scatter3(X, Y, Z);VMax = max(Amps);axis([-VMax, VMax, -VMax, VMax, -VMax, VMax]);

author: rstofer
author_rank: Super Contributor
timestamp: October 18, 2020, 05:43:02 pm
content: I get an operator error at line 15, column 19 (the .+ operator appears to be invalid in this context)Code:TPoints = Phases .+ (Time' .* Freqs);^^

author: daqq
author_rank: Super Contributor
timestamp: October 18, 2020, 06:36:51 pm
content: Are you using MATLAB? I'm running it on Octave, works fine. Changing it to just + from .+ still works.

author: Circlotron
author_rank: Super Contributor
timestamp: October 18, 2020, 09:14:36 pm
content: Interesting that the plot appears to be 45 deg to both the x and y planes and zero deg to the z plane. I intuitively thought it would be equal angles to all three planes. I have no expertise on these matters.

author: daqq
author_rank: Super Contributor
timestamp: October 18, 2020, 09:42:28 pm
content: The actual orientation is kinda tricky to describe and screenshot. I suggest you download Octave and play around with the script, change the frequencies, rotate the graph and so forth. If this is the sort of thing that interests you, a powerful mathematical scripting language is an incredibly valuable tool.

author: rstofer
author_rank: Super Contributor
timestamp: October 19, 2020, 12:16:48 am
content: Quote from: daqq on October 18, 2020, 06:36:51 pmMATLAB... I had previously made the change and it all worked fine.The code works as given in Octave. Just another incompatibility...If somebody want to see the circle canted in Z, try:Code:Amps = [1, 1, 2];

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 19, 2020, 04:32:07 am
content: It forms a circle of radius \$\sqrt{3/2} \approx 1.224745\$ centered on origin, with a diagonal axis (towards \$(-1,-1,-1)\$).This is the biggest circle you can fit in a cube with vertices at \$(\pm 1, \pm 1, \pm 1)\$ according to e.gthis essay by Maris Ozols. (Note that Ozol's hypercube had unit length sides, whereas here we have sides of length 2 and \$n = 3\$; and that \$2 \sqrt{3/8} = \sqrt{3/2}\$.)How can I tell? I asked Maxima:Code:load("vect") $"Helper functions:" $radians(deg) := deg * %pi/180 $cross(a,b) := express(a ~ b) $"P(deg) is point 'deg' degrees along the curve." $P(deg) := [ sin(radians(deg)), sin(radians(deg + 120)), sin(radians(deg + 240)) ] $"Pick three points along the curve; any three distinct points will do. Better pick points where sine has a known value." $p0 : P(0) $p1 : P(120) $p2 : P(240) $"We know the origin is the center by definition. Find normal." $n : cross(p1 - p0, p2 - p0) $ratsimp(n);"Check the distances of the three points from origin." $ratsimp([sqrt(p0 . p0), sqrt(p1 . p1), sqrt(p2 . p2)]);float(%);If you choose e.g.p0 : P(90) $ p1 : P(180) $ p2 : P(270) $you get the exact same answer (except for the magnitude of the normal vector, which is irrelevant here, as it depends on the anglep1 p0 p2).

author: rstofer
author_rank: Super Contributor
timestamp: October 19, 2020, 07:58:29 am
content: I'm also a huge fan of Maxima or, actually, wxMaxima - Maxima with a GUI frontend.College would have been a lot more fun (and easier) if we had these tools back in the early '70s.

author: Circlotron
author_rank: Super Contributor
timestamp: October 19, 2020, 10:42:36 am
content: Quote from: Nominal Animal on October 19, 2020, 04:32:07 amWow! That's great! The maths in that reference makes my head spin.I don't even know which way up the page goes. The thing is, the other day I was laying on the couch half dozing and thinking about all this and I suddenly had this strong feeling about the size of the circle. Can't explain it.

author: Circlotron
author_rank: Super Contributor
timestamp: October 19, 2020, 11:01:03 am
content: Turns out i've been thinking about this problem on and off for sixteen years... For a while I thought the path that would be traced was not circular but more of a twisted 3D figure 8. The seed for the whole thing was this thread six years ago ->QuoteFrom here ->https://www.eevblog.com/forum/projects/three-phase-magnetic-cube/Looks like I can finally stop loosing sleep over it.

author: daqq
author_rank: Super Contributor
timestamp: October 19, 2020, 11:36:22 am
content: Quote from: Circlotron on October 19, 2020, 11:01:03 amI made an animation on the topic. Two sines are of the same frequency, the frequency of the third one is varied, ranging from 1x to 3x of the other two sines. There's a moment and a point of view where you get an 8-ish figure, but you need to play with the mutual phases, sizes, frequencies.

author: daqq
author_rank: Super Contributor
timestamp: October 19, 2020, 11:37:59 am
content: And this also sweeps the phase of one of the sines. This proves nothing, it's only pretty to look at

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 19, 2020, 01:01:57 pm
content: Quote from: Circlotron on October 19, 2020, 10:42:36 amAn easy way would be to consider a cube centered at origin, with edge length 2, and its intersection with a plane through origin. The cube planes are at \$x = \pm 1\$, \$y = \pm 1\$, and \$z = \pm 1\$. Then ask yourself, what is the orientation of said plane that maximizes the minimum distance between origin and the surface of the cube (i.e., the minimum distance between origin and the cube planes). It's obviously the one with normal \$(1, 1, 1)\$ (or equivalently \$(-1, -1, -1)\$). In any other orientation the minimum distance is smaller.If you consider a circle with a fixed center, it is just all the points that are at a fixed distance from the center and all on the same plane. So, choosing the plane normal – remembering that because of cube symmetries, we only need to consider at most the positive octant in 3D – that maximizes the minimum distance between center and the intersection with the cube faces, maximizes the radius/diameter of the circle, too. And we already know it is when the normal is diagonal to the cube.The referred essay just extends this concept to any number of dimensionsn.