jes notes Index Gallery . Signed Distance Functions Shaft passers Snap issues

2025-11-15

Last modified: 2025-11-15 20:26:03

< 2025-11-14 2025-11-16 >

Orrery

On further consideration, I think this mechanical design may actually be OK - but the elliptic plane tilt will need to move throughout each day, not just one cycle per year.

We have 3 degrees of freedom: earth rotation around axis, earth/moon orbit around sun, moon orbit around earth. So it ought to be possible with only 3 motors. Obviously it can be done with 4 motors if you make 2x altazimuth mounts, and somehow ensure that they don't interfere.

To check whether the design I have in FreeCAD will work I am going to get Cursor to program a JavaScript simulation controlling the same axes and see if it looks right.

I went to make a project directory called "orrery", but realised I already have one! I made a basic 2d JavaScript orrery before.

This uses the VSOP87C data - maybe that is a clue! Maybe I just need to sweep through the next 100 years, grab out the coordinates from the VSOP87C data, and then see if I can solve the inverse kinematics or whatever to work out where to position my 3 motors. And then that is also the same method I can use for the real orrery, as long as it all fits on a Arduino Nano ESP32. Probably I can process the VSOP87C data down to something smaller.

OK, this VSOP87C data doesn't include the moon position, so not spectacularly useful. We already know the earth position based on time of year so VSOP87C adds nothing of value.

OK, I have a 3D geocentric JavaScript orrery, now I'm going to export altazimuth directions for a year's worth of positions, and then process separately to see if my mechanical design will work.

Oh, I think it might not work - the ecliptic axis is always 23.4 deg. away from earth's axis, but it needs to spin all the way around, not just tilt back and forth.

So if we have a stepper motor fixed to the earth that rotates the plane of the ecliptic, and then we have a stepper motor for each of the sun and the moon, moving them in the plane of the ecliptic? Probably need slip rings to communicate with the inner stepper motors.

We might get away with just 1 stepper motor, and gearing the sun/moon to each other, apparently a 254:19 ratio is quite close and the error over the next 100 years will be less than 12 degrees.

This is apparently the ratio used in the Antikythera mechanism. https://antikytheramechanism.com/anatomy.html

So let's maybe go with that, it simplifies things to use only one stepper motor to drive both sun and moon, albeit may require manual adjustment of the offset.

So now we're imagining a motor fixed to the earth, potentially aligned with earth's axis, to handle earth's daily rotation, and a motor fixed to that axis, but offset by 23.4 degrees (?) which only turns once per year, and handles the precession of the ecliptic (?).

Or would they rather be the other way around? The ecliptic needs to go around once a day as well. I need to think harder on this.

AS5600

I read that the AS5600 may be calibrated quite poorly, which you can fix with a manually-derived calibration curve. But in any case let's see if I can get any data out of it at all. First I need to solder wires on to the pads as it doesn't have any.

There is https://github.com/RobTillaart/AS5600

The PCB has a set of pads labelled GND/5V/PWM - I'm going to try to use these - but there is another set labelled for I2C or something, which I'm hoping not to have to bother with.

The PWM test program doesn't seem to be working. The way it works is it measures the low time and high time of the PWM pulse to determine the angle, but it looks like the pin is not really behaving like PWM.

Unsure if I need to do some I2C stuff to put it into PWM mode, very annoying if so.

Waving a magnet around near the chip does seem to make it do something, but not obvious that it is measuring the angle.

Is it possible that the pin is mislabelled and instead it is an analogue signal?

Yes! Seems to be. Messing around with the "AnalogInOutSerial" sketch, and serial plotter, it definitely looks like rotating a magnet near the chip makes the output voltage change. And it's not at 100% 0 or 100% 5v, so it is definitely analogue.

I may want a decent test harness to hold everything aligned, instead of trying to hold it still with my hands while I rotate a magnet. And maybe actuate the magnet with a stepper motor so that I can build up a calibration curve.

Something like this:

The mounting screws are M2, which is annoyingly small. The axis is 21mm off the bottom, which means I can position a stepper motor next to it on the table and it will line up. The hole is 5.25mm, hopefully won't have to mess about drilling it out to fit a 5mm shaft.

It seems like it might actually work better when powered by 3.3v instead of 5v. It's not filling me with a massive amount of confidence. Maybe it doesn't matter, we can use this thing to get a rough idea of "homing" at startup, and then count steps with the stepper motor, and only readjust if it seems like we're missing steps?

I don't know, it's about as easy to rig up as a hall effect sensor for an index point, and means we don't need to swing all the way around to find the index point, so probably a winner overall. And it might work better with a proper radial-flux (?) magnet, I am just using an axial-flux magnet tipped on its side.

< 2025-11-14 2025-11-16 >