This thing is the result of my previous work ‚[Concept instructions/Blueprint] Stargate - Rotate glyphs with stepper motor‘ (thing ID 4405616; edit for printables.com import: https://www.printables.com/de/model/614928-concept-instructionsblueprint-stargate-rotate-glyp).
I was able to create an arduino program, which allows to dial gate addresses.
Three videos are uploaded as things.
If you look close at the ‚Stargate_Dial.mp4‘ video (I know the image quality is not so good) you can see that the dialed address is ‚Atlantis‘.
The other two videos are showing demonstrations.
Please note that I don’t share my code, because it is very wiring and Stargate build depended. For example I use a sound shield, a NFC reader, (disabled compass hardware), stepper motor (driver) & gear transmission, etc. Also I use some libraries and I don’t want to violate any copyrights.
If you have a specific question, please write a comment and I try to answer it as soon as possible.
Regarding the function principle:
Via serial communication I send a string with the address to the arduino.
The rotation is started with a very low stepper speed. Then it will be increased until maximum speed is reached. While the glyph ring is rotating the the program tries to read the NFC tags inside the glyph ring. Each one contains unique data (e.g. number 01 to 39 - we have 39 symbols). Based on the data at some point a stepper speed will be decreased.
Note: I use the third glyph before reaching the target glyphe. Previously I wanted to use the compass hardware to measure the magnatic field and use a software PID controller for setting the speed, but it did not work until now.
When the target glyph is reached the locking sound is played and the corresponding chevron LED gets enabled. This repeats as many symbols were named in the send string. When all chevrons are locked the wormhole LEDs are enabled and the wormhole establishment sound is played.
Then the LEDs are pulsating (dim up and down) until a 'cancel' string command is send.
Printer Brand:
Prusa
Printer:
I3 MK3S
Rafts:
No
Supports:
Yes
Attention
Using PWM requires the hardware timers which are also needed for timer interrupts.
I had a bit of trouble to find a configuration which is able to use PWMs on all 9 Stargate sections/zones. The original '5ft Lighted Stargate' has only 6 zones (see its images).
The following description is for an Arduino Mega. The provided configuration is my in-use setup. It was depended on my developed connection PCB, which is shown in some images.
It is possible to rearrange the PIN mapping.
Arduino Mega timers
The arduino mega has 6 timers (0-5).
PIN usage
Only the wormhole LEDs are connected to PWM pins.
This results in a free Timer 2 and 5.
Stepper motor
I don't use a stepper motor library, because I did not find any which utilize timer interrupts to trigger the steps. Therefore I wrote my own implementation.
In my configuration the interrupt has to be triggered 4000 times a second (makes 2000 steps - toggle between HIGH and LOW on a pin to make a step). It is possible to increase the number, which results in a higher glyph ring rotation speed.
Because the stepper motor needs a wide value range for acceleration from 0 to 2000 steps the only free 16bit timer is used (timer 5).
You will find many tutorial descriptions how to calculate and setup the required registers to realise this functionality yourself.
Timer 2
The other free timer is used for creating a 50Hz signal.
I had a problem to configure it properly with the 8bit resolution with the possible timer prescalers. To resolve it I wrote an additional prescaler into the called interrupt function (a bit of experimenting to find the necessary configuration).
With this 50Hz signal different functionalities should be triggered:
Category: 3D Printing
The author remixed this model. Imported from Thingiverse.
Shows dial sequence for the 5th Lighted Starget based on my own developed concept/blueprint.