LUA script for stepper ENA+ ??

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: LUA script for stepper ENA+ ??

#21 Post by jph »

Post a link to the data for the actual board(s) you purchased. I can tell from them.

Basic theory is as follows - (once you have decided and set your microstepping - no need to use a lot of microstepping or even to use it at all !, just use as much as you actually need)

There is a pot on the board that controls the vref level which controls the maximum motor coil current.
Don't worry too much about the math just turn it one way and the current limit will increase and the other it will decrease. You will NOT damage your motor with this driver.

Make a rig with the stepper driving the throttle lever with a feedback pot. GT-2 belts and drives are excellent and dirt cheap.

Adjust the current limit so that the throttle arm JUST manages to travel the full distance when powered. Set the driver current limit so this is just possible and no more. Ensure as little friction in the system as possible.

The pot will give you a reference of the position of the throttle lever at all times.

When powered (AT on), then the enable pin is triggered and the driver is active. The code you create causes the arm to move to a position where the adc input is equal to the value you set. You can equate adc input directly to position.

If you find that you are sending steps to the motor and the pot value is not changing then there is a restriction - for example - manual intervention. At this point disengage the enable signal to stop the stepper drive and allow manual control.

It should be possible to also build a small slip clutch unit using - for example - parts from an R/C car limited slip diff (slipper clutch). Another design I have considered but not yet built is by using a centrifugal clutch drum unit from an R/C IC car or helicopter and replacing the cork and centrifugal weights in the drum with a lightly loaded ptfe or similar arm that is in spring loaded contact with the drum and will slip when loaded.

A word of warning. I believe you are building the 3d printed 737 throttle quadrant from Kyle ? Karl ? the Helimech guy. imho, his mechanical designs are mostly superb, but his electronic controls are not.
I would leave enough room inside the unit - when printed - (or mod it before if you can) to make changes as needed and not to follow the design religiously. Certainly not in the drive unit he has for the trim wheels ! - unless he has changed it is is massively underpowered and slow. It needs to be a hefty drive unit for the trim with high torque starting that is capable of around 120RPM virtually instantly. It also needs to be able to be manually overridden if one grabs the trim wheels. I might build his unit myself (when he does V6 or V7 :) ) but will ensure that the inner parts are mostly cut away to allow GT-2 drive for the main parts with the control, drive motors and sensors brought out of the base of the unit at the area that it meets the pedestal. You should never have to take it apart to change a drive method.
Joe. CISSP, MSc.

jangaloo
Posts: 11
Joined: Sat Mar 28, 2020 9:10 am

Re: LUA script for stepper ENA+ ??

#22 Post by jangaloo »

Many thanks!

Heres the link from amazon. I got them from Amazon UK but that link shows the data etc - so far I managed to get them working albeit moving very slowly - will follow your instructions on turning the pot tomorrow! Am still unsure how to do the ms1, ms2 connections - is it to the 5v Vio on the arduino or the driver board 5v from the Arduino in? Same for the ground. Already managed to burn one today! ooppss! Looks like this is turning into an electronics project too!

https://www.amazon.com/BIGTREETECH-TMC2 ... 3C1XW?th=1

Microstepper settings are shown on the 4th picture

Yes have taken on the challenge to get Karls motorised throttle built and hopefully get it working with PMDG. I´ve seen many comments about the speed of the trim wheels which as I know from real life are comparably very slow. I´d be happy to compromise on not needing to grab them or have them function manually. Am still in the printing phase so am open to suggestions on how to sort that for a beefier motor!

Will report back - have yet to look at the DAC part...

Thanks as always!

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: LUA script for stepper ENA+ ??

#23 Post by jph »

Where they list VCC_IO and GND for the options for the MS1 and MS2 pins, they actually should be saying VDD and GND (as the board is labelled) - you think they could have at least used a common name.

Yes, use VDD for VCC_IO.
You can connect the MS1 and MS2 pins directly to VDD or GND (VDD is the power supply for the logic which will come from your Arduino most likely)
The MS pins are internally pulled down by weak resistors so the board will default to a 1/8 micro step.
I would leave it at that to start with.
That should be 1600 pulses per revolution (presuming a stock 1.8 degree stepper) which is why it will appear slow.

I think the data is wrong on Amazon as well.
On the 2209 the ACTUAL stepping is -
image.png
here is the datasheet for reference.
https://www.trinamic.com/fileadmin/asse ... t_V103.pdf
Joe. CISSP, MSc.

Post Reply