PDA

View Full Version : steppermotor and sensor



henri
10-05-2012, 11:36 AM
Hi
I've been trying to use my steppermotor card(OC). i connected a stepper motor to J6 and optic sensor to J9 but the stepper keeps rotating. is there a way to check if the optic sensor is working. The optic sensor is a sharp GP1A57HRJ00F and i wired it as in the OC maual.
Hope some one can help me out:?:.
Thnx and regards,:)
henri

hyamesto
10-05-2012, 04:14 PM
Henri:

The most common failure is the infrared led.
The USBStepper card, donīt have a limiter resistor for the infrared led.
This resistor is to be added externally.(is no clear in the manual)


First;
Have you put a 330 or 470 ohms limiter resistor for the infrared led (pin 1 and 2)?
If not, the led is blow.


To check the infrared led, use a multimeter and use a webcam, phone cam or another type of camera.


With the multimeter in ohms, check the infrared led (pins 1 and 2) in both ways.
(red cable to pin 1 and black cable to pin 2 and vice versa)


If the led blow, the multimeter show 0 or infinite resistance in both ways.
(open or closed).
Change the sensor..........


If the led is ok, you have near 0 ohms in one medition (not cero, near 0), and a high resistance in the other.


To check visually
Feed the led with 5 VCC (donīt forget the limiter resistor!!!)
Use the webcam or camera and point to the infrared led.
If the led is ok,will bright like a white light in the camera
(not visible to the human eye, but every camera today can "see" infrared light).




Second:
If the led is ok, with the sensor conected at the stepper card,use the multimeter in volts and measure pin 5 and pin 4. (multimeter black cable in pin 5 and red in pin 6).
Interrupt the light with something big and opaque and check if the multimeter changes from 5 to 0 volts.


If you can measure that diference, the sensor is ok.


Third:
Use a different method of blocking the light (sometimes, the needle is not enought, you need a wider or deeper flag), and make the test with external lights out. (some sensor are "confused" with other light sources).
Good luck!

henri
10-05-2012, 04:38 PM
Thxs hyamesto,
when you talk about pin 1 and 2 you mean the pins from the sensor. i did use a 300 ohms on pin 1 but not on pin 2 (cathode)
Ok got some cheking to do.
thnx for the advice.
regards,
henri:-)

hyamesto
10-05-2012, 05:05 PM
Sorry, pin 1 "or" pin 2, and minimum 330 ohms (better 470 ohms)

7083

henri
10-05-2012, 05:16 PM
Super and thnxs

henri
12-07-2012, 09:31 AM
Hi Guys,
some how i don't have any luck with the opticsensor. just wonder if i can use a reflective sensor instead on the USB-steppercard (because i know they are working Used them before on a phidget card).
regards,
henri

hyamesto
12-07-2012, 11:46 PM
You can try. The function of the sensor is equal to a switch, (you can try this too, with a flexible contactor found in older cassette players)
Look the picture.
I have tried several types of sensors ("U" shape form rescued from old printers), and all work great.
Look at the recommendations in post 2.
Ever, a simple conection error, kill the sensor.

7326

henri
12-08-2012, 09:58 PM
Thanks hyamesto,
I'm working on the reflective sensor. when done I'll let U know the result.
regards,
henri

henri
12-12-2012, 05:24 PM
Hi back again,
there is progress. The stepper is calibrating and stops at the sensor. Problem is that when calibrating it rotates clock wise but when it has to show the altitude it always rotates anti clock wise. I did tried to change the wires then it rotates ok, but the next time i launch it rotates anti clock wise again.
Any solution for this problem????
regards,
henri

henri
12-13-2012, 11:43 AM
Ok looks like I have the wires correct now. next is the script.
regards,
henri

hyamesto
12-13-2012, 01:21 PM
henri:
Sorry for no reply.
Manual in english of stepper card.

http://www.opencockpits.com/images/uploads/manual_usbstepper_eng.pdf

Yes, the calibration must be anti clock wise. Else, you must check the wires.
Some motors seems to be erratic, but changing parameters in SIOC is the way. (check motor speed value, and number of steps for thent of a second).
And the script, your final variable must not be equal o higher than 65535.

henri
12-13-2012, 02:05 PM
Thnx,
yes the calibration is anti clock wise now. So that's good. What do you mean with the final variable equal or higher the 65535.
in order to move 1 degrees ( altimeter) i need to enter a value of 200 and i think that's a lot. so from 0 to 1000 ft is a value of 20000.
I think that's to much isnt it
regards,
henri

hyamesto
12-13-2012, 02:29 PM
1 degrees = 200 steps? 1 turn means 72000 steps?
You have a reduction gear train ?
The sensor is on the 10.000 needle?

The 65535 is the limit of resolution of the card (16 bits) (0 to 65535) 65536 max values.
After that value, the card goes crazy. (loose the position).
You need a good and large SIOC script to avoid this problem.

henri
12-13-2012, 02:45 PM
Seems I do have a problem? and what would the script look like ( a good and large script)
see details stepper motor?
7340

hyamesto
12-13-2012, 03:00 PM
henri:
The attachment can not be read. (that happens sometimes). Post it twice. (one after one)
I need a construction scheme of your altimeter (and type of altimeter), and the script you're using now, to help you.

henri
12-13-2012, 03:10 PM
Well its just the beginning so no real altimeter yet. just testing before I will start building it.
the script i'm using:
Var 001 , name Alti_met, Link FSUIPC_IN Offset $3324, length 4
{
L0 = &Alti_met * 37.5

&Alti_stepm = L0
}


var 2 , link USB_stepper, name Alti_stepm, device 1, output 1, posl 60, posc 0, posr 4, type H

henri
12-13-2012, 03:14 PM
Here I'll try to send info of the stepper motor.
73417341

hyamesto
12-13-2012, 03:32 PM
Ok. Busy now with others things.
Let me see, and later at night, i will try to help with a little tutorial.
Try first with the whiskey compass script, in the manual.

henri
12-13-2012, 03:43 PM
Thnx, I have 2 leave also.
to be continued
henri

henri
12-14-2012, 12:26 PM
Ok I'm still working on the altimeter script.
Var 001 , name Alti_met, Link FSUIPC_IN Offset $3324, length 4 // andere var
{
L0 = &Alti_met
C0 = &Alti_met >= 0
C1 = &Alti_met <= 1000
If C0 and C1
{
L0 = &Alti_met * 36
&Alti_stepm = L0
}
else
{
C0 = &Alti_met > 1000
C1 = &Alti_met <= 2000
If C0 and C1
{
L0 = &Alti_met * 18
&Alti_stepm = L0
}
else
{
C0 = &Alti_met > 2000
C1 = &Alti_met <= 3000
If C0 and C1
{
L0 = &Alti_met * 9
&Alti_stepm = L0
}
else

ect


var 2 , link USB_stepper, name Alti_stepm, device 1, output 1, posl 60, posc 0, posr 4, type H

and that's wat jou referred to as good and large script?

still open for advice!!
regards,
henri:lol:

henri
12-14-2012, 07:25 PM
Other question. How important is the IOCstepper file?
and specially

[ Asignaciones de Variables IOCP ]
[ IOCP Variable ]
[ Motor1 ]
IOCP_Var0=10

regards,
henri

hyamesto
12-15-2012, 01:43 AM
henri:
Download and read the manual in english please (link is in upper post)

http://www.opencockpits.com/images/uploads/manual_usbstepper_eng.pdf

Since version 3.46 of SIOC, IOCstepper.exe and IOCStepper.ini are obsolete software.
You must not run this program. Instead, run SIOC and assign parameters in the variable link.
Ever, when you run SIOC.exe, the stepper motor runs two complete anticlockwise turns (calibration).
First turn to calculate the zero point, and second turn to count steps.
If the calibration is clockwise, just swap motor cables.
In the parameters, you can define the numbers of steps, and the operation (full steps or half steps).
For your motor, the full steps are 200, and half steps are 400.
In the manual, you have a script for an altimeter 100 feets needle.
You can add a gear train for better resolution,let SIOC make the calibration to know the number of steps.
If you need a 1000 feets needle, you must add another stepper motor, or add a reduction gear train of 10:1,
and feed the 100 feets needle with the stepper, but the sensor must work with the 1000 feets needle.
But warning, the calibration needs to be 20 turns anticlockwise (10 turns to zero, 10 turns to count steps)
And if you need a 10000 needle, is better to work with a servo. (or be patient, and wait 200 turns).

The best way to understand the work of USBstepper card is the "whiskey compass" script.


Var 0000, Link USB_STEPPER, Output 1, PosL 6, PosC 0, PosR 4, Type H

Var 0015, Link FSUIPC_IN, Offset $02CC, Length 8, Numbers 1 // FSimulator Compass
{
L0 = V0015 + 0 // Add X degree for my gauge center
IF L0 > 3600 // If is > 360 degree discount a full turn
{
L0 = L0 - 3600
}
V0000 = L0 // send degrees to stepper motor
}

henri
12-15-2012, 08:21 AM
Thnx,
Ok good to now I can skip the IOCstepper.exe.
I've read the manual and still studying it. Any advice on what other stepper to look for?
regards