10/10/2023 0 Comments Arduino stepper motor libraryHowever when the direction is changed and we go counter clockwise any multiple of 160 steps we are always short on the first CCW movement and it is always short by the same amount as long as we keeping going counterclockwise, no matter how many tracks we move. So to move the bridge one track over we only need to move 160 micro steps ( 6400 / 40 = 160 ) to the next track.Īfter we have calibrated the system to find the home track, we are able to consistently and precisely move the bridge to the home track on start up of the system and always be able to index the turntable to the next track and further one or more tracks in the "clockwise" direction. We have 40 tracks around the turntable pit and we have decided to lay the track so that they are all an equal distance/angle to each other. After that it is simple math to calculate the location of a track. We require this fine resolution so that we can calibrate the home track precisely to the bridge track. We have set the dip switches on the driver to specify that the motor will have 6400 steps. In general I have been able to perform calibration, home and execute index movements of the stepper motor for the turntable movements successfully and accurately with one exception. There is a sensor attached to the turntable to provide a means to calibrate the stepper motor system to one of the tracks and to home it every time we start up the system. There is no gear box attached to the motor shaft. The stepper motor is a Longruner 17HS4401 controlled by a Stepperonline Driver, a DM542T and we are using a regulated power supply for the driver. We are using a Uno with a key pad to select the track that turntable bridge is rotate to. Our model railway club has been working on building an HO scale turntable for a roundhouse and we are using a stepper motor to control the movement of the bridge of the turntable. I do know that i can control the max and min PID output, as to limit my stepper motor movement, but yet to know how to make it as an input for my stepper motor.Some back ground before I get into the details of the specific problem initialize the variables we're linked to PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT) Specify the links and initial tuning parameters Define Variables we'll be connecting to * Reading analog input 0 to control analog PWM output 3 ![]() This might be the thing that i need, but still i don't know how to make the output of this library to be the input of my stepper motor. I also has downloaded accelstepper to help me control the motor, and so i know that i can control the motor by using mystepper.step (number of steps), am i able to use this variable to be the output of the PID library ? ![]() from what i know, stepper motor needs 2 pins as their input, which is the Pulse pin, and the Direction pin. I've read some PID libraries, but it states that i need to define only 1 pin as an output. ![]() i would need some PID as to make my valve able to control the flow proportionally. the input would be temperature from a thermocouple. I am attaching a stepper motor to a valve to control steam flow. I am new in coding or even arduino overall, and so i need help to write my code
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |