My Dalek's dome

Thread Starter

nicktruman

Joined Feb 4, 2019
75
The module you have should be fine. 24V and 60Ω would get you around 400mA, say 1A for headroom on peaks. the module should handle 1.5A at up to 32V, so you are OK with that.

I still encourage you to get a bench supply. A 24V battery could so easily fry everything while you are working on it. The bench supply has current limiting so you can keep it low until you know you’ve got things right.
I just don't have time now, I even have someone from the local village association coming over this afternoon to discuss logistics and Damian's "voice". Time is not on my side.
 

ericgibbs

Joined Jan 29, 2010
21,463
hi Nick,
I would add a 470u 16V cap and a 100n cap across the 9V Arduino supply, close to the actual Arduino.
Also, 470u 35V cap a 100n across the 24V input close to the stepper PCB.

Do you a have photo-shot of the assembly around the servo/Arduino to post.?
E
 

Thread Starter

nicktruman

Joined Feb 4, 2019
75
hi Nick,
I would add a 470u 16V cap and a 100n cap across the 9V Arduino supply, close to the actual Arduino.
Also, 470u 35V cap a 100n across the 24V input close to the stepper PCB.

Do you a have photo-shot of the assembly around the servo/Arduino to post.?
E
Hi Eric
This is what I have so far, copied from the image I posted earlier

MicrosoftTeams-image (6).jpg
 

cmartinez

Joined Jan 17, 2007
8,786
Also, where's the heat sink? That sort of driver requires one or the main chip will surely overheat and burn after a couple of minutes. In fact, it might also need a small fan constantly blowing air at it as a double precaution.
 

Thread Starter

nicktruman

Joined Feb 4, 2019
75
Also, where's the heat sink? That sort of driver requires one or the main chip will surely overheat and burn after a couple of minutes. In fact, it might also need a small fan constantly blowing air at it as a double precaution.
Yes you are right, I swapped the board for the photo, the one I'm using has a little heat sink; I just want the motor to do something :(
 

MisterBill2

Joined Jan 23, 2018
27,679
The capacitors will best support the stepper by being connected to the stepper power terminals with fairly heavy wire, #16 or #14 sized wire. And certainly having a current limited supply for initial testing is a very wise idea.
 

Thread Starter

nicktruman

Joined Feb 4, 2019
75
The capacitors will best support the stepper by being connected to the stepper power terminals with fairly heavy wire, #16 or #14 sized wire. And certainly having a current limited supply for initial testing is a very wise idea.
These would be electrolytic capacitors? with the +ve side towards the +ve battery?
 

Thread Starter

nicktruman

Joined Feb 4, 2019
75
Hi Everyone, I have found something that seems to work with a servo. On my bench it sort of works quite well.. Do you think this can be modded to run with a stepper? it works out the time difference between the 2 mics and points the servo in the right(ish) direction. The original sketch was for a Nano 3.0 I have tried to adapt it for my Uno with some success..
(original https://stoppi-homemade-physics.de/richtungshoeren/)

Code:
#include <Servo.h>          


Servo servo_direction;    

const byte interruptPin_left=2;

const byte interruptPin_right=3;

int servoPin = 11;   // Set servo to digital pin 11

long time_difference;

long time_old_left;

long time_old_right;

long silence;

float angle;           // angle from where the sound is detected

float distance;       // distance of the two microphones


void setup()

   {

    servo_direction.attach(servoPin);  

    pinMode(interruptPin_left, INPUT_PULLUP);

    pinMode(interruptPin_right, INPUT_PULLUP);

    attachInterrupt(digitalPinToInterrupt(interruptPin_left), left, RISING);

    attachInterrupt(digitalPinToInterrupt(interruptPin_right), right, RISING);

    distance = 0.5;       // distance in meter of the two microphones

    time_old_left = 0;     // last trigger-time for left microphone

    time_old_right = 0;    // last trigger-time for right microphone

    silence = 80000;      // passed time in µsec within no trigger is accepted

   }



void loop()

   {

    time_difference = time_old_left - time_old_right;     // time difference of the received tone in µsec

    if(abs(330.0*(time_difference/1000000.0)) <= distance)

       {

        angle = asin(330.0*(time_difference/1000000.0)/distance);

         angle = angle * 180.0 / 3.141592654;

         angle = angle + 90.0;

         servo_direction.write(angle);

       }

 

    delay(100);

 

   }



void left()

   {

    if(micros() - time_old_left > silence)    // accepted new trigger after enough time has been passed

       {

        time_old_left = micros();

       }

   }



void right()

   {

    if(micros() - time_old_right > silence)   // accepted new trigger after enough time has been passed

       {

        time_old_right = micros();

       }  

   }
 
Last edited by a moderator:

Ya’akov

Joined Jan 27, 2019
10,259
Hi Everyone, I have found something that seems to work with a servo. On my bench it sort of works quite well.. Do you think this can be modded to run with a stepper?
Yes, to do that you’ll need to compute the number of steps required to point at the angle computed by the code.

This means you will need to have a calibrated start position, and you will have to track each move as a differential to that zero.

It would be a lot better to include a position sensor, as the servo does. without it you will have to calibrate from time to time to avoid getting shifted far off. This might not be a big problem, you could just include a timeout where after N seconds of no triggering sound, the head returns “home”, which is not a bad behavior for a Dalek anyway.

To find home, you’ll need a sensor which is probably best just a switch on a GPIO pin that indicates the dome is at zero.
 

Thread Starter

nicktruman

Joined Feb 4, 2019
75
Yes, to do that you’ll need to compute the number of steps required to point at the angle computed by the code.

This means you will need to have a calibrated start position, and you will have to track each move as a differential to that zero.

It would be a lot better to include a position sensor, as the servo does. without it you will have to calibrate from time to time to avoid getting shifted far off. This might not be a big problem, you could just include a timeout where after N seconds of no triggering sound, the head returns “home”, which is not a bad behavior for a Dalek anyway.

To find home, you’ll need a sensor which is probably best just a switch on a GPIO pin that indicates the dome is at zero.
Thank you. If i fit a momentary micro switch at straight ahead would that work?
Can you help me modify the code to work?
I tried with a little servo as per code above and it seems quite good. it certainly points the servo in the direction of a noise.
I think I fried all my controller boards, so I have ordered another stepper (5v) and some new controllers to build a test rig. If that works I will then use my 24v stepper

Regards
Nick
 

Ya’akov

Joined Jan 27, 2019
10,259
Thank you. If i fit a momentary micro switch at straight ahead would that work?
Can you help me modify the code to work?
I tried with a little servo as per code above and it seems quite good. it certainly points the servo in the direction of a noise.
I think I fried all my controller boards, so I have ordered another stepper (5v) and some new controllers to build a test rig. If that works I will then use my 24v stepper

Regards
Nick
A microswitch mounted anywhere that would indicate zero will work. Just bear in mind that it has to stop the motor or bad things can happen. What I mean is that if the MCU ignores the home signal, and keeps moving the motor, all sorts of unintended consequences will ensue.

So, you need to have some safeguard(s) in place. One that will cover the eventuality is to have the drive tolerate slipping, include a hard stop at zero, and a sanity timeout (if the drive runs for longer than it could take to return home in any case, stop the motor and throw an error.

You can make this timeout variable depending on th expected return angle which you will know from the code which has to calculate this in normal operation. Add just a little to it in case of slipping (which is the point of homing) and it shiuld protect against odd errors that want to keep running the motor.

If it was me I would also include a “maintenance” switch that would route the power for the stepper through the NC contact of the switch. That way, when it got home, it would shut its own power off and couldn’t overshoot. To re-enable it, the maintenance switch gets flipped to ”normal” bypassing the limit switch. In maintenance mode you could tweak and test code without fear of it twisting its own head off.

Ideally, there would be two limit switches, one that indicates home and the other indicating “end of travel”. The home switch could be on the Dalek body and the end of travel switch on the dome. The EoT switch could be operated by fixed stops on the body and the home by a stop on the dome. I hope this is clear.

I am reluctant to commit to helping at this point because of my previous failure and my current situation. I ma in the process of moving my studio to a larger room and I have no place to work, in addition I have a glut of family obligations which makes my participation here spotty. I apologize, and don’t want to disappoint again.

I am going to go out on a limb and suggest @djsfantasi as a potential consultant. I can’t commit him to anything of course, and it is presumptuous to even call him out, but I think he is very well qualified to help. He has a great interest in animatronics, and a lot of experience. I know he's been busy with personal things lately, but if he is available it would be hard to find someone better.

I'm glad to hear it seems to work. I do hope it works as you want and would love to see some video of the successful operation.

By the way, I haven't given up on the mic array, which should arrive any day according to AliExpress. I’ll pursue it further (I have uses for it as well) and it may be very useful as an "upgrade" for you. It will not only localize sounds accurately but it opens the possibility of voice control (“Damian, exterminate!”), among other things. I will follow up.

(It might be worth private messaging me an email for contact in case you aren’t around here at some point)
 

Thread Starter

nicktruman

Joined Feb 4, 2019
75
A microswitch mounted anywhere that would indicate zero will work. Just bear in mind that it has to stop the motor or bad things can happen. What I mean is that if the MCU ignores the home signal, and keeps moving the motor, all sorts of unintended consequences will ensue.

So, you need to have some safeguard(s) in place. One that will cover the eventuality is to have the drive tolerate slipping, include a hard stop at zero, and a sanity timeout (if the drive runs for longer than it could take to return home in any case, stop the motor and throw an error.

You can make this timeout variable depending on th expected return angle which you will know from the code which has to calculate this in normal operation. Add just a little to it in case of slipping (which is the point of homing) and it shiuld protect against odd errors that want to keep running the motor.

If it was me I would also include a “maintenance” switch that would route the power for the stepper through the NC contact of the switch. That way, when it got home, it would shut its own power off and couldn’t overshoot. To re-enable it, the maintenance switch gets flipped to ”normal” bypassing the limit switch. In maintenance mode you could tweak and test code without fear of it twisting its own head off.

Ideally, there would be two limit switches, one that indicates home and the other indicating “end of travel”. The home switch could be on the Dalek body and the end of travel switch on the dome. The EoT switch could be operated by fixed stops on the body and the home by a stop on the dome. I hope this is clear.

I am reluctant to commit to helping at this point because of my previous failure and my current situation. I ma in the process of moving my studio to a larger room and I have no place to work, in addition I have a glut of family obligations which makes my participation here spotty. I apologize, and don’t want to disappoint again.

I am going to go out on a limb and suggest @djsfantasi as a potential consultant. I can’t commit him to anything of course, and it is presumptuous to even call him out, but I think he is very well qualified to help. He has a great interest in animatronics, and a lot of experience. I know he's been busy with personal things lately, but if he is available it would be hard to find someone better.

I'm glad to hear it seems to work. I do hope it works as you want and would love to see some video of the successful operation.

By the way, I haven't given up on the mic array, which should arrive any day according to AliExpress. I’ll pursue it further (I have uses for it as well) and it may be very useful as an "upgrade" for you. It will not only localize sounds accurately but it opens the possibility of voice control (“Damian, exterminate!”), among other things. I will follow up.

(It might be worth private messaging me an email for contact in case you aren’t around here at some point)
Thank you Ya'akov, I do really appreciate your guidance thus far! I am so far into this now I can't really give up. I'll drop you a pm.
Hi @djsfantasi I have code that works with a servo motor, but I would rather use a stepper motor; the drive is using a friction wheel against the "lazy susan" bearing that allows the Dalek's dome to rotate. The code uses the time difference between the 2 mics to calculate an angle for the servo to point at; I am guess that a stepper motor will just use a % of the number of steps?
I just thought it would be cool if it pointed its "eye" towards a noise source.
Regards
Nick
 

djsfantasi

Joined Apr 11, 2010
9,237
Hi @djsfantasi I have code that works with a servo motor, but I would rather use a stepper motor; the drive is using a friction wheel against the "lazy susan" bearing that allows the Dalek's dome to rotate. The code uses the time difference between the 2 mics to calculate an angle for the servo to point at; I am guess that a stepper motor will just use a % of the number of steps?
I just thought it would be cool if it pointed its "eye" towards a noise source.
Hi Nick! I’ve been following your thread so I grok what you’re doing.

Warning! I’ve never used a stepper but understand how they work. Driving and positioning a stepper motor is very different than using a servo.

There is an Arduino library for stepper motors as there is for RC servos. Here’s an Arduino article demonstrating using a stepper motor It includes how to wire one.

Basically if you use a micro switch to indicate a home position (perhaps when the Dalek is facing forward) and you know or calculate how many degrees per step your stepper motor moves, then based on your calculation from the sound sensor you move the stepper right or left that many degrees.

Sorry I couldn’t be more specific but hopefully the article and my high level description will help.
 
Probably too late to suggest this as you've committed to a stepper but I've found windshield wiper motors with their built in worm gear really useful for giving a high torque relatively quick rotational speed. Easy to mount typically with three threaded mounting holes and for this application, a potentiometer in the end of the rotating shaft will give angular position and they stop really fast when youb turn off the power so no real need for feedback control. With a simple pot you may be limited to 270 degrees rotation but surely the dalek should rotate on it's base to compensate for this?1674058167743.png
Forgive me if I haven't read the whole thread, but wiper motors for driving and turning on four wheels might be nice?
 

MisterBill2

Joined Jan 23, 2018
27,679
Probably too late to suggest this as you've committed to a stepper but I've found windshield wiper motors with their built in worm gear really useful for giving a high torque relatively quick rotational speed. Easy to mount typically with three threaded mounting holes and for this application, a potentiometer in the end of the rotating shaft will give angular position and they stop really fast when youb turn off the power so no real need for feedback control. With a simple pot you may be limited to 270 degrees rotation but surely the dalek should rotate on it's base to compensate for this?View attachment 285511
Forgive me if I haven't read the whole thread, but wiper motors for driving and turning on four wheels might be nice?
This looks a lot more like a powered windows motor. At least, it looks like most of the power window motors I have seen.
 
Top