[Mod] Stargate – Working dial sequence + wallmount

This thing is the result of my previous work ‚[Concept instructions/Blueprint] Stargate - Rotate glyphs with stepper…
17
97
0
807
updated October 14, 2023

Description

PDF

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.

Print Settings

Printer Brand:

Prusa

Printer:

I3 MK3S

Rafts:

No

Supports:

Yes

PIN/Timer usage

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).

  • Timer 0 sets PWM of pins D4 & D13 with 8bit resolution
  • Timer 1 sets PWM of pins D11 & D12 with 16bit resolution
  • Timer 2 sets PWM of pins D9 & D10 with 8bit resolution
  • Timer 3 sets PWM of pins D2, D3 & D5 with 16bit resolution
  • Timer 4 sets PWM of pins D6, D7 & D8 with 16bit resolution
  • Timer 5 sets PWM of pins D44, D45 & D46 with 16bit resolution

PIN usage

Only the wormhole LEDs are connected to PWM pins.

  • WORMHOLE_LED_1 D3
  • WORMHOLE_LED_2 D4
  • WORMHOLE_LED_3 D5
  • WORMHOLE_LED_4 D12
  • WORMHOLE_LED_5 D11
  • WORMHOLE_LED_6 D8
  • WORMHOLE_LED_7 D7
  • WORMHOLE_LED_8 D6
  • WORMHOLE_LED_9 D2

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:

  • increasing of the PWM duty cycle to dim up/down the LEDs
  • increase/decrease the number of steps done by the stepper motor
  • read of sensor data (e.g. read every 10th time of the 50Hz signal to read NFC and other sensor data)

Category: 3D Printing

Tags



Model origin

The author remixed this model. Imported from Thingiverse.

Differences of the remix compared to the original

Shows dial sequence for the 5th Lighted Starget based on my own developed concept/blueprint.

License