

Will get more complicated than that (with reverse direction and selection of non sequential button) but at the moment just get it to go to next stop.

At the moment just want to push button on and motor goes to next set stop. Four buttons on ‘in’ side to select the right stop. For a transfer table for a model railway, a small section of track moves sideways (driven by stepper motor) to each position. PS: You might damage the arduino board and the motor if you dont know what you are doing.Can someone help this aged challenged old man (77)Ĭan you give me a link to a stepper project that is for a stepper motor to have 4 steps (positions) to move a carriage between them. That moves motor at higher constant speed. Beware some function timers of the arduino code like delay will change after you play with those timer bits.After that its simple. There are some documents on how to do that around.

If you want to set your freqs to higher like 30kHz you need to change these timer bits. However, the pwm pins of the arduino are being set with timer bits at the startup (around 490Hz or so and some of them are higher around 900). set the duty cycle around 128 to send a square wave. In order to avoid this you can use hardware PWM on the arduino. It keeps the arduino busy in the main loop. The code given in the example is rather inefficient. The freq of the pulses determines the speed of the motor. Each pulse you send moves the motor 1 step. Stepper drives seems like use PFM (Pulse freq modulation). Gift the gift of Make: Magazine this holiday season! Subscribe to the premier DIY magazine todayĬommunity access, print, and digital Magazine, and more Share a cool tool or product with the community.įind a special something for the makers in your life.

Skill builder, project tutorials, and more Get hands-on with kits, books, and more from the Maker Shed Initiatives for the next generation of makers.
