Saturday, February 11, 2017

Stepper motor and the parallel port.


Various stepper motors, They are great for robots and other automation projects.  The same ideas can be used with micro-controllers.Here are just a few notes. Testing stepper motor wiring: http://www.piclist.com/techref/io/stepper/wiresmeterbattery.htm


The bipolar motor (4 wire):



From an old Seagate hard drive.









Unipolar motor.







CLS
VarMode = 0
VarRot = 0
VarRev = 0
VarDelay = 0
int1 = 0


Main:
CLS
OUT 888, 0
DO UNTIL INKEY$ <> ""
PRINT "Enter the number of revolutions"
INPUT VarRev
VarRev = VarRev * 50
PRINT "Enter the Mode of operation"
PRINT " 1 for single coil excitation"
PRINT " 2 for double coil excitation"
INPUT VarMode
PRINT "Enter the number of delay cycles"
INPUT VarDelay
PRINT "Enter the direction of rotation"
PRINT "5 for CW 7 for CCW"
INPUT VarRot
VarMode = VarRot + VarMode
IF VarMode = 6 THEN GOTO ScCW:
IF VarMode = 7 THEN GOTO DcCw:
IF VarMode = 8 THEN GOTO ScCcw:
IF VarMode = 9 THEN GOTO DcCcw: ELSE GOTO nd:

LOOP

ScCW:
DO
GOSUB Step1:
GOSUB Step2:
GOSUB Step3:
GOSUB Step4:
VarRev = VarRev - 1
IF VarRev = 0 THEN GOTO Main:
LOOP

ScCcw:
DO
GOSUB Step4:
GOSUB Step3:
GOSUB Step2:
GOSUB Step1:
VarRev = VarRev - 1
IF VarRev = 0 THEN GOTO Main:
LOOP

DcCw:
DO
GOSUB Step5:
GOSUB Step6:
GOSUB Step7:
GOSUB Step8:
VarRev = VarRev - 1
IF VarRev = 0 THEN GOTO Main:
LOOP

DcCcw:
DO
GOSUB Step8:
GOSUB Step7:
GOSUB Step6:
GOSUB Step5:
VarRev = VarRev - 1
IF VarRev = 0 THEN GOTO Main:
LOOP

Step1:
OUT 888, 0
DO
OUT 888, 1
IF int1 = VarDelay THEN RETURN
int1 = int1 + 1
LOOP


Step2:
OUT 888, 0
DO
OUT 888, 2
IF int1 = 0 THEN RETURN
int1 = int1 - 1
LOOP

Step3:
OUT 888, 0
DO
OUT 888, 4
IF int1 = VarDelay THEN RETURN
int1 = int1 + 1
LOOP

Step4:
OUT 888, 0
DO
OUT 888, 8
IF int1 = 0 THEN RETURN
int1 = int1 - 1
LOOP

Step5:
OUT 888, 0
DO
OUT 888, 3
IF int2 = VarDelay THEN RETURN
int2 = int2 + 1
LOOP

Step6:
OUT 888, 0
DO
OUT 888, 6
IF int2 = 0 THEN RETURN
int2 = int2 - 1
LOOP

Step7:
OUT 888, 0
DO
OUT 888, 12
IF int2 = VarRev THEN RETURN
int2 = int2 + 1
LOOP

Step8:
OUT 888, 0
DO
OUT 888, 9
IF int2 = 0 THEN RETURN
int2 = int2 - 1
LOOP



nd:
OUT 888, 0

Other motors:



Saturday, February 4, 2017

Just a quick tip or two with Kodi.

One of the interesting features in Kodi is setting the country and time zone: Here is a picture tour of where to go.








The other quick hint is that having a remote control might be an issue.    To set a web interface add-on as the default web UI, go to System -> Services -> Webserver and select that add-on for the Default value. Then go to the hostname (or IP address) of that HTPC+Port number. Note: Some platforms use port 80, which is the assumed port if no port is given in the address. Now you can use a touchpad with a browser or a laptop.  Setting up am entry in the local dns will make things easier. I like the fact that the cursor keys work great with the system. Personally I just use an old 600 mhz laptop to be the remote control. Allows you to use the internet if you need to or even just use an editor to take notes.


That's it for now.