Help using servos for my PC case mod

Once the SSC-32 receives the command it can slowly close the doors without need of further comunication from the PC. But unless the servos have their own power supply (not connected to the PC’s 5vdc supply) you do need to make sure power stays on till the servos finish moving. Honestly even if the servo move were set to 5 seconds windows will probably still be saving your settings long after the servos are done moving.

This is an example of the text to send to the SSC-32 to move the doors. This assumes two servos, one for each door.

Initialization:
#0 P1000 #1 P2000 <- this turns the servos on, the 1000 / 2000 will need to be changed to your servos closed position values.

Close:
#0 P1000 #1 P2000 T5000 <- this moves the servos to the "closed position, and the move will take exactly 5 seconds. You can change the 5000 to whatever time in uS you want the move to take.

Open:
#0 P2000 #1 P1000 T5000 <- this opens the doors, but you must do the initialization first.

You may be able to get the job done with out a servo controller. Assuming you will have a seperate wallwart to power the servos, you could use the servos as gear motors along with some diodes, limit switches, and a DTDP relay. The relay would be operated from the 5v or 12v computer power supply when the computer starts up. Near the bottom of the below page, there is a diagram of a DTDP relay in a motor reversing setup. Another approach would be to make a servo controller like below from a 555 chip and have a small relay switch the driver between the open and closed door positions (act as a jumper around the 50k pot).

geocities.com/zoomkat/switch.htm
uoguelph.ca/~antoon/gadgets/servo4.htm

I should add that the group policy stuff that allows the startup/shutdown scripts is XP Pro…

So if you’re running XP Home or Media editions. There are solutions if you search the net, though.

Thanks guys.

a few more quesitons, do I need to by anthing else other than the ssc-32 controller, like a chip or anything?

and does it send commands out in sequence to each servo or does it send them all simulateously?

Lastly, the text file script I create. What file extension should it be?

Thanks again!

Like I mentioned before you may want to use a USB to serial cable. We do sell a 6vdc 2amp wall pack for powering the servos if you do not want to use the PC’s 5vdc line. You shouldn’t need anything else.

The beauty of the SSC-32 is, you send the commands but nothing is acted apon untill you send the cariage return (CR). So the servos will begin moving as soon ans the CR is received. For the examples I made above the two servos will begin moving at the same time, and stop moving at the same time. The move will take 5 seconds.

Robot dude, Thanks.

Sorry, I must have edited my post after your responce.

I’m a little confused as to what the file extension should be.
For example. I create a text file called open.???

EDIT: I think I just found it, is it .wsf ?

So now my question is, once it runs that script, where in the script does it tell it to send it to the usb port?

I guess I’m not understanding how the script file gets sent to the usb or com port.

IF it is done thru a dos promt as show earlier, then how does this work with the xp script editor?

Sorry for being such a PITA.

I know the servo controller, but I’m not sure about the script stuff. Better let the guru’s field these questions.

The file extension you choose doesn’t really matter, as you’re just sending the contents of the file to the serial port.

That said, it’s probably best to call them open.txt and close.txt, as they are text files, and that way double clicking will open them up in notepad (or whichever editor is your default one).

Not a PITA at all.

I’m still not sure what version of windows you have. If it is Pro, and you’re editing the group policy to add a startup and shutdown scripts, you should be able to add batch scripts (.BAT). I’m not really familiar with windows script files (wsf), so can’t help much there.

OPEN.BAT:

MODE COM1:9600,n,8,1 TYPE c:\autodoors\open.txt > COM1

CLOSE.BAT

MODE COM1:9600,n,8,1 TYPE c:\autodoors\close.txt > COM1

The mode command sets the serial port speed, parity and such.

TYPE displays the content of the file. The addition of the > pipes the output away from the screen and into the file or device you specify.

So the type command in the batch file take the contents of open.txt and passes them on to the first serial port (COM1) and from there, it goes on to the SSC32.

If you have a USB to serial port adapter, you’ll need to change COM1 to whatever the adapter’s com port number is.

I’ve realised the MS site I originally linked to is a bit confusing, so here’s another attempt in ‘how to add Startup/Shutdown scripts’:

Click ‘Start > run’, type gpedit.msc and click ‘Ok’

This should open the local group policy.

Under ‘User Configuration > Window Settings > Scripts(Logon/Logoff)’, there are entries for logon and logoff scripts.

Double click on Logon and then click ‘Add’, browse to your batch file, OPEN.BAT.

This does work in Vista Business and XP Pro. I don’t have a PC with XP Home, so I’m just crossing my fingers for that one.

Good luck!

Matt, THANK YOU! actually to everybody!

yes I am running windows xp pro. and I was able to figure out how to edit the group policy to add the scripts.

So what I understand now is that you have to have essentially 4 files.
open.txt -that contains the script for the controller to open the doors,
close.txt -that contains the script for the controller to close the doors

then you also have to have .bat files
and those are what you load into the group policy startup and shutdown scripts.

Ok, so I think I’ve got it all figured out now. Thank you guys alot. I will place my order for the ssc-32 today.

Edit: -I just placed my order. -I went ahead and orderd 6 servos, the 6v power supply, wiring harnes and a bunch of hardware.

Here is a link to my thread of the computer case I’m building just in case you guys want to follow along. -I’m just getting started.
thebestcasescenario.com/foru … hp?t=10192

Thanks again.

That is really pretty cool! 8) Keep us posted with the progress.

well, I got everyting working last night. I had a little trouble getting the commands sent to the board at first because I didn’t notice the jumper setting on the board wasn’t set to 9600 baud rate. so Once I removed one of the jumpers. Everyting started working.

I also got the startup and shutdown scripts to work to! THANKS!

The shut down happens right after windows “saves settings” It says, “Running shutdown scripts” then shortly after the computer shuts off.

When I boot it up however, it takes quite a while before it runs the script.
Basically once I get into the screen to select the user and enter my password, that is where it runs the script. it does not wait for me to login, but it does have to boot into that screen before it will happen.

Is there anyway to add the command to send the open.txt file to the com port in the dos bootup sequence. (I’m on windows xp pro) I know you used to use the autoexec.bat, but that doesn’t exist any more. If I can only get it to work at the login screen, then thats ok with me, but If I could get it to happen sooner, that would be better. Thanks!

Congrats, I’m glad its working for you!

On the startup script, you might be a bit stuck. Autoexec.bat does still exist in XP, but it ignores everything except setting environment variables, so you can’t run anything from it. The windows XP boot sequence loads things in a very specific order, and the earliest you can run something is at the login screen (or perhaps a fraction earlier if you write your own service - not recomended).

The only other possible thing I can think of (and this one is a hell of a strech and really, really not recommended if you’re not familiar with partitions, bootloaders and system recovery. If you mess up the bootloader, recovery can be a PITA :open_mouth: ):

Another bootloader (GRUB, I’m looking at you) does have serial terminal support and can be run before windows starts to load. It may be possible - especially on a single OS System - to change the menu option itself to your SSC32 command and configure it to boot windows after a 1s delay.

If I can find a null modem cable I’ll give it a shot later this week and see how it pans out.

***Please note, the GRUB solution is pure conjecture. Untested and not recomended. ***

(We need a warning or ‘hazardous matter’ smiley :wink: )

You may want to consider a dedicate microcontroller to do this for you. It could monitor the 5vdc line to know when the PC is turned on, and move your servos for you, you could still use the shut down script to close it down. I know it would add a lot of complexity to what should be a simple procedure, but it would work.

Oh wait!

If you can live with it for a little while we will be offering an upgrade to the SSC-32’s processor and firmware to allow some interesting features. The one you will be excited about is it will allow startup sequences to be added that automatically run when the servo controller is first powered up. So as soon as the SSC-32 is turned on it will initialize the servos at the closed position, then slowly open them to the full open position. They can stay that way until the shut down script closes the doors. then the power is shut down turning the SSC-32 off.

It’s going to be a little while longer for this. We are working on it! :smiley:

That sound interesting. As I was reading I realized something that will probably make the startup scipt not run any sooner. I’m using a usb to serial cable. so the drivers for it have to load before anything else. I doubt there would be anyway to load those drivers before anything else. If it were a perfect world, it would be too easy. so I am happy with the way it is untill something better comes along. Like the update for the controller. Thanks!

Ok guys. I’ve gotten all the motorized parts built and you can see a movie of how they look here.

i65.photobucket.com/albums/h205/rendermandan/Motorized%20Madness%20Case/th_100_3073.jpg

-I had a question. Is there anyway to send a command to the controller to make it stop sending commands to the servos? -What is happening when they doors open is there is tension on some of them due to wires and I can hear the servo fighting against that tension so its kind of anoying hearing that. What I want it to do is after all the servos are moved to the open position, is send a command to the controller to go to a standby stat that it is in when first powered on. Thanks!

Cool case mod. Nice work!

PS I answered your question here…
lynxmotion.net/viewtopic.php?p=30255#30255

Hey guys, I finally finished my case. Here is the finished product. I’m entered into a contest with it, so feel free to vote for me too! Thanks again.
Make sure you check out the videos at the bottom!

modshop.net/users/rendermandan/r … ed-madness

Thats crazy O_O

i wish i had a computer like that T-T