Assistance requested with Easy Driver and X27.168 stepper motors

236 views
Skip to first unread message

EAL 727 Captain ..

unread,
Aug 12, 2022, 11:40:32 PM8/12/22
to accelstepper
Hello, all.    Long time lurker, first time poster.

Am seeking help with the following:

I'm building a Boeing 727-200 home cockpit using OEM indicators/gauges/instruments and currently am working on the engine instrument indicators.

I'm using X27.168 automotive-type stepper motors inside these 2" instruments.

I have a sketch written and functioning but want to have the steppers (all 15 of them, eventually) go to a 'home' position of ZERO at start-up.  I've tried the moveTo(0) position and runToPosition(0) as well as moveTo(-500) and runToPosition(-500) calls in the VOID SETUP (as I only want to do this once) to no avail.

The X27.168 stepper has an internal stop which will match my zero position on the indicator.  Once SETUP takes the stepper to its ZERO (or home) position, it will then go to the LOOP section and update as the values in the simulator (X-Plane 11, in this case) change.

My sketch, thus far, is as follows:

[code]
/*
      E1N1 TEST
      Teensy 3.2, AccelStepper, EasyDriver and X27.168
      1/8 microstepping (default setting)
*/

#include <AccelStepper.h>

AccelStepper E1N1(1, 14, 15);  // 1=Library function, 14=Step, 15=Direction

FlightSimFloat e1n1;

float E1N1_pos; //   Eng 1 N1

const long STEPS_PER_REVOLUTION = 13500;
const float STEPS_PER_DEGREE = ((float) STEPS_PER_REVOLUTION) / 315.0;


void setup() {
  Serial.begin(9600);
  E1N1.setMaxSpeed(900);
  E1N1.setAcceleration(900);
  e1n1 = XPlaneRef("FJS/727/Eng/N11Needle");
}

void loop() {
  FlightSim.update();

  E1N1_pos = e1n1 * STEPS_PER_DEGREE;
  E1N1.moveTo(E1N1_pos);
  E1N1.run();
}
[/code]

For this sketch, I'm trying to get the X27.168 stepper to move in concert with what the flight sim's indicator is showing....and it does, for the most part, but I want to get the indicator needle to cycle through to ZERO and then go to whatever value is displayed on the flight sim.  This particular sketch is for the Engine 1 N1 (front fan) indicator and is only in a testing phase. Each engine has an EPR, (Exhaust Pressure Ratio), N1, EGT (Exhaust Gas Temp), N2 and Fuel Flow indicator....for three (3) engines.

Is there a way to always get the stepper to 'go home' (ZERO step position) and then go to the actual value?

Any help is certainly appreciated.

Thank you very much.

Jay
Las Vegas


Jim Larson

unread,
Aug 13, 2022, 1:01:21 AM8/13/22
to accelstepper
Since I'm totally unfamiliar with these steppers, I googled a bit. Fascinating! I think these will be my next project.They are really cool!
But after reading several posts, I think AccelStepper is the wrong tool for these. A standard stepper driver appears to be the wrong answer also.
Have a look at these links:

I'm interested in what you think and what others might have to say also. Am I totally off to follow this other input?
                -jim

gjgsm...@gmail.com

unread,
Aug 13, 2022, 4:02:21 AM8/13/22
to accelstepper
@ Jim, 
I'm not familiar with these steppers at all but out of interest I followed your links and ended up at
Github - SwitecX25 . This library seem to do the job? No driver necessary.
I notice there is a zero function and wonder if there is some internal switch or pot that it interacts with?
Years ago I also considered using cheap servos for this purpose...
Geoff

gjgsm...@gmail.com

unread,
Aug 13, 2022, 4:07:28 AM8/13/22
to accelstepper
Ok, I went back and had another look at the code, looks like the 'zero' function just runs the stepper back until it hits the stop and the zeros its position.

``#include "SwitecX25.h"

// 315 degrees of range = 315x3 steps = 945 steps
// declare motor1 with 945 steps on pins 4-7
SwitecX25 motor1(315*3, 4,5,6,7);

// declare motor2 with 945 steps on pins 8-11
SwitecX25 motor2(315*3, 8,9,10,11);

void setup(void) {
  Serial.begin(9600);
  Serial.println("Go!");

  // run both motors against stops to re-zero
  motor1.zero();   // this is a slow, blocking operation
  motor2.zero();  
  motor1.setPosition(427);
  motor2.setPosition(427);
}

void loop(void) {
  // update motors frequently to allow them to step
  motor1.update();
  motor2.update();

  // do stuff, call motorX.setPosition(step) to
  // direct needle to new position.
}
``

EAL 727 Captain ..

unread,
Aug 13, 2022, 11:48:52 AM8/13/22
to accelstepper
Jim and Geoff...

Thanks so much for your kind replies.

I'm disappointed that I can't use AccelStepper for this portion of my project as I really enjoy the simplicity of it.

I had previously seen the SwitecX25 library and kept it on a back burner in my brain for possible future use.  
It looks like that future is now and I'll have to come up with a sketch to incorporate this library solely.

The problem I'm now facing is powering the stepper (keep in mind, I'm only testing 1 for now).  With the Teensy 3.2 and the Easy Driver, I just needed to hook-up 2 wires for STEP and DIRECTION on the Teensy and use the Easy Driver for my 5V power and the four (4) wires to the stepper.
The Teensy 3.2  allows for only 3.3V and this is slightly underpowered for the X27.168 stepper.  I'm specifically using Teensy because of its incredible flight sim interface with X-Plane and its ability to read what are know as 'data refs' (values) directly from the X-Plane internal operations.
When I did a preliminary test using the SwitecX25 library, the stepper would stal while enroute to ZERO..

This got me wondering if I can use two (2) libraries at the same time...one for the SwitecX25 and one for AccelStepper.....and if so, how?

Again, I truly appreciate you taking the time to reply and for the assistance.

Jay
Las Vegas


Geoff Smith

unread,
Aug 14, 2022, 7:27:26 AM8/14/22
to accels...@googlegroups.com
Jay, you can use a level shifter to to shift the teensy’s 3v3 to 5.0v to run the stepper. Just Google SparkFun level shifter to learn all about them. 
Geoff 

Sent from my iPhone

On 14 Aug 2022, at 1:48 am, EAL 727 Captain .. <eal72...@gmail.com> wrote:

Jim and Geoff...
--
You received this message because you are subscribed to a topic in the Google Groups "accelstepper" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/accelstepper/UBoDkX0gdvw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to accelstepper...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/accelstepper/73756264-30a2-4037-80cd-0b0f80af820an%40googlegroups.com.

Geoff Smith

unread,
Aug 15, 2022, 8:19:43 PM8/15/22
to accels...@googlegroups.com
Jay, It seems likely that it stalled because the power available from the teensy was not sufficient. The Arduino 5v atmega are cheap and will deliver more power which may be enough, but if not then you can use a low power 4 channel mosfet to boost the output to ~ 1 to 2 amps for a couple of dollars. 

I imagine that the teensy is communicating with the PC via serial data (UART) which would be the same for the Arduino atmega, using the Rx and Tx pins. 

Sent from my iPhone

On 14 Aug 2022, at 9:27 pm, Geoff Smith <gjgsm...@gmail.com> wrote:

Jay, you can use a level shifter to to shift the teensy’s 3v3 to 5.0v to run the stepper. Just Google SparkFun level shifter to learn all about them. 

EAL 727 Captain ..

unread,
Aug 15, 2022, 8:58:45 PM8/15/22
to accels...@googlegroups.com
Thanks for the replies and suggestions. 

I’m thinking, also, that it could be an issue with the Easy Driver—powered separately with 5V but with STEP and DIRECTION coming from the Teensy.  It’s possible that the current limiting on the Easy Driver is ‘off’ (meaning not calibrated correctly).  In all honesty, I cannot recall measuring the current let alone adjusting it.  I know I did for the many DRV8825s I’m using elsewhere..but cannot recall if I did the same for the Easy Driver.

For what it’s worth, today, I ordered two (2) stepper driver boards featuring the VID6606 chip.  Each board can operate up to eight (8) X27.168 steppers and the reviews are great.  Interfacing is done via any MCU.  Set-up seems very simple and I’m all for simple!!
To a relative newcomer to the world of electronics and interfacing, this has been a worthwhile education, despite the slow progress I’m making.  It’s the learning which is paramount to me…all else is just gravy.  LOL

Jay


On Aug 15, 2022, at 5:19 PM, Geoff Smith <gjgsm...@gmail.com> wrote:

Jay, It seems likely that it stalled because the power available from the teensy was not sufficient. The Arduino 5v atmega are cheap and will deliver more power which may be enough, but if not then you can use a low power 4 channel mosfet to boost the output to ~ 1 to 2 amps for a couple of dollars. 
You received this message because you are subscribed to the Google Groups "accelstepper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to accelstepper...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/accelstepper/4A633F74-CB3E-458C-9EC0-2C3296ADF77D%40gmail.com.

gjgsm...@gmail.com

unread,
Aug 15, 2022, 9:59:33 PM8/15/22
to accelstepper
Check out Adafruit for more info...

The Easy Driver may not be handling the high impedance of the X27. Looking at the datasheet, the VID6606 looks like it should work.
Good luck

Brian Schmalz

unread,
Aug 16, 2022, 8:31:18 AM8/16/22
to accels...@googlegroups.com
Yeah, for sure Easy Driver is not a good solution for these kind of stepper motors. (Full disclosure, I'm the designer of the Easy Driver.) The coil resistance is far too high for any current chopping to happen, and so it will only act as a (not-ideal) H-bridge - all the extra functionality is not usable when used with a motor like this.

*Brian

EAL 727 Captain ..

unread,
Aug 16, 2022, 10:37:33 AM8/16/22
to accels...@googlegroups.com
Hi, Geoff and thank you for the link. 
I think I had seen it a few times before but never accessed it.

Will do so today. 

Thanks again, sir!!

Jay
Las Vegas

On Aug 15, 2022, at 6:59 PM, gjgsm...@gmail.com <gjgsm...@gmail.com> wrote:

Check out Adafruit for more info...

EAL 727 Captain ..

unread,
Aug 16, 2022, 10:43:24 AM8/16/22
to accels...@googlegroups.com
Brian—
I truly appreciate your honesty and for taking the time to reply.  

I’m sure that I had seen a video of the X27.168s being used with your Easy Driver somewhere along this long road I’m traveling and the set-up worked beautifully.
Maybe that poster had added something special to make it work properly.
Hard to say.

My VID6606 boards are scheduled to arrive next week so hopefully a solution is within my reach.

Thank you again.

Jay
Las Vegas


On Aug 16, 2022, at 5:31 AM, Brian Schmalz <brian....@gmail.com> wrote:



Brian Schmalz

unread,
Aug 16, 2022, 10:53:34 AM8/16/22
to accels...@googlegroups.com
Jay,

Yeah, if you ever run across that video again, please forward a link to me. I'm really interested in how well that setup worked.

I did a bunch of work with these steppers in the past, and I just drove them directly from the I/O pins of my 5V microcontroller (A PIC18F I believe). Worked really well for me, but I don't remember if I was able to find 5V versions or if I just used the 12V version.

*Brian

EAL 727 Captain

unread,
Aug 16, 2022, 12:51:04 PM8/16/22
to accels...@googlegroups.com
Brian;
I certainly will reach out to you when I stumble across the video.   I saw it less than a year ago and I’ll clear some cobwebs from my brain and will forward a link as soon as I find it.

Thank you again.

Jay

On Aug 16, 2022, at 7:53 AM, Brian Schmalz <brian....@gmail.com> wrote:


Reply all
Reply to author
Forward
0 new messages