#X27 stepper homes too strong

1 messages Β· Page 1 of 1 (latest)

oak jolt
#

I have a problem with a X27 stepper motor that I'm using for a gauge. I'm not using a homing switch. So I think the stepper will just turn into one direction until it reaches the mechanical stop. I have done the configuration in Prosim, so the program knows how far the stepper should turn to reach a specific value.
When I now stop Mobiflight, the stepper is turning into one direction (I think it is going to the home position). But it seems to collide too hard with the mechanical stop and turns "empty" some steps. When I then run MobiFlight again it doesn't hit the correct values anymore. Is the a way to let it move more carefully into the home position?

true jungle
#

is the end stop in your gauge or in the stepper itself?

#

also, mobiflight moves to zero point when you stop/close it

#

so your zero point needs to be in the "safe" range (like, indicated 0 and maybe not have a hard stop just there?

#

it is possible to set the stepper speed slower so it will not react so fast, and thus will not move so fast either, but the root of the problem is it should never hit the end stop or you get out if sync

#

the x27 is quite weak so make sure you don't move it too fast if your pointer is at all heavy, it might also skip steps there and could then end up hitting the stop when it has lost the calibration.

oak jolt
#

I will try to set it to a slower speed first. The end stop is in the stepper itself.

true jungle
#

Yea. you can also make it fully rotating pretty easily. See my entracnce to the youtuber scene! 😁

https://www.youtube.com/watch?v=eSry6lcNpoo

Automotive X27 stepper motors are cheap and useful for building analog gauges and indicators for flight simulators.

This video shows how you can modify them to rotate continuously, in case you need to build something like a directional gyro or compass.

The X27 is not very powerful though, so there are limits on how much mass it can actually ...

β–Ά Play video
true jungle
#

@oak jolt was any of this helpful?

oak jolt
#

Yes, I lowered the speed but the problems seem to come from the difficult fixing of the needle on the shaft too. I try to switch now to a 28byj. The shaft of this stepper seems to be much bigger and gives more possibilities to fix a coupler on it.

oak jolt
#

@true jungle By the way, now I need the stepper motor to know where its zero position is. I'm trying to use a photointerruptor. It switches from ON to OFF when the stepper is reaching the position. We can assign a pin for an auto zero input but is this input expecting an ON value?

true jungle
#

do you 3d print your needles?

#

hm, this should probably be a setting in the stepper config that is not very difficult to do - I cannot talk on behalf of @exotic tide of course, but a photointerruptor sounds like a device that would be used in this task, and it is a valid use case to support that mode of operation too

oak jolt
#

I'm not printing the needle. Only the coupler that connects the needle to the stepper.

#

I have tested the device (H22A3) in Mobiflight. It can be configured like a button. I can see that the value is always 1 and changes to 0 when the light beam is interrupted.

true jungle
#

oh this is the BYJ28

#

you could likely use a logic gate to flip it

#

but I think it would make sense to just support a "normally closed" zero switch as it is a natural choice

exotic tide
#

if you take your switch and write it to a MF variable which you invert

#

then you can drive a pin with that which you could connect to the switch pin

true jungle
#

wait, was it a ref, or is it a pin?

#

never used the feature

#

was just adding a stepper to this arduino to see the gui

#

its a pin

#

ah right yeah

#

loopback

#

I wonder what kind of switches there usually are that are normally open and are used for this?

#

@oak jolt but you can have a very simple circuit too that inverts the logic

#

two resistors, or you can use a transistor too

#

so Input is the photointerruptor

#

no wait

#

this wont work with arduino input, wouldn't it, let me check

#

this should even work

exotic tide
#

you can try to invert by using an output that you connect to your switch pin. opto coupler -> input -> MF variable -> output -> read & invert -> display pin -> connected to AuoZro Pin

true jungle
#

yeah I know, that works too but this would do the same in hardware

exotic tide
#

if you have a transistor at home

#

not everyone does

true jungle
#

no this is just a resistor

#

even simpler than the first

#

the vertical line is the switch

#

it just connects the pullup to GND

#

so the pin 2 in this case is connected to gnd

#

no wait

#

is this the wrong way around too πŸ˜„

#

we connect pins to GND to make a switch "ON"

#

so I think the switch and resistor need to be swapped around

#

or wait dang

#

I am confused now πŸ˜„

#

but I am sure it can be done with a very simple circuit

#

right, need to think that the switch is inverted, normally open

exotic tide
#

you cannot invert with just a resistor

#

or at least not that i have heard of...

true jungle
#

I think the transistor is cleaner

#

and I mean if you are writing an arduino project you just invert it in code

#

but I think you can have the switch wired between the input pin and 5V

#

and then connect the data pin to GND via 10kOhm resistor

#

so if the switch disconnects, the 10k acts as a pulldown and the pin goes low

#

but maybe use 1k also on the 5V pin, not sure if it is needed

#

so it is smaller resistance to the 5V than to GND

#

and the datapin is in the middle

#

I think it should work

#

I guess you can just leave the 1k out, I think it is safe to connect input pins to 5V directly

#

it is basically like how a potentiometer is connected

#

the side with less resistance is determining the state of the pin

#

and pots can be configured as switches

#

so yes, it actually does work

#

as long as you either have no resistor on the normally-connected switch side (5V) or a smaller resistor than the GND pulldown

#

@oak jolt so yes, 10k resistor lets you invert the logic

#

think how the potentiometer connection works

#

and try configuring a pot as a switch, it flips over at halfway

oak jolt
#

This gave me definitly some new inputs.

true jungle
#

πŸ˜„ and a lot of confused speculation, sorry πŸ˜„

sand pike
#

While we speak about stepper and zeroing here, I have a question. My altimeter use only one stepper driving the longer needle, the others are gear driven from it. For now I use software zeroing, it works well until I put the pc to sleep and on wake up I have to turn MF off and on again and sync is lost. I’d like to add a hardware zero switch but how does it work with a stepper able to do multiple turns?

true jungle
#

Why do you need to restart MobiFlight when you wake up the computer? Shouldn't it catch up with the simulator after a moment? I know at least MSFS does not really like when the PC sleeps and wakes up and it takes a moment for it to become responsive again - would this feel like MF lost the connection and needs to restart or does it never regain it?

true jungle
#

For the future, a note with my moderator hat on: It is generally better to start your own message thread, even if you find a related one via search or while reading new posts. You can always use the "copy message link" feature and reference a different thread on your own question if you feel it is related.

Every question people have is often different even if they are about the same topic, and it can make it difficult to follow the troubleshooting if there are two or more separate issues in the same thread. We also use the "solved" label to see what threads have been resolved, so additional questions have a bigger risk of going unnoticed.

And it makes it harder for the original poster to follow up the answers.

sand pike
sand pike
#

Do you like I copy my message in a new thread?

true jungle
#

you can!

#

that would be excellent

#

since I think Mickey might have some follow up to this story too