hello, I am fairly new to arduino. I have a basic understanding of code and need to implement an rpm sensor on my unit as well as two stepper for position. I have found various code people have written in the past but i am having a hard time trying to make the code work for my application. i am trying to write the code from scratch so there isn't any excessive code that isn't required. MY rpm is the main variable which i need within a certain range and if its high in speed adjust the steppers to get speed within spec again. i am just kinda of stumped on where to start. i need a menu to be able to human interface. i have an Arduino Due and 2 Adruino 101 on 101 is for rpm the other is steppers because the must move in parallel the due is the master which reads from the rpm and commands the steppers. any help would be appreciated.
It's a little too early to be talking about variables when you haven't posted any code.
Unless there is a problem, steppers always turn at the commanded RPM. How can the RPM be different and require an adjustment? There is some other factor you aren't telling us.
Using two Arduinos for such a simple task is overkill. Even an 8 bit Arduino can read a sensor and drive two steppers. What other factor has led you to choose two different processors?
well thats where im stuck i have a couple sketches i have been trying to adapt to my application but i feel i will spend more time trying to adjust them then i would just writing code specific to my application. The steppers are not being measured for rpm. I have a wheel that i need to keep at a certain speed the steppers control an armature that depending on closeness will move in or out depending on speed or stay where its at if speed within limits. i know it is over kill but for sake im trying to keep computing as open as possible for the sake of developing a reliable system and im trying to implement a log on the rpm for diagnostic purposes.
So why two Arduinos? Are they a long way apart or something?
no just wasnt sure of the actual program size and didn't want to be limited, if your saying one gravy then hey i am not complaining one less to try to network two makes it a lot easier. that helps that way i can just do ic2. so i could run the rpm sensor in the loop section and have the stepper in the setup so if rpm changes it moves the stepper and re runs loop to see if rpm in limits?
You have the same problem as lot of people who starts programming with Arduino.
Why do you mix 3 or 4 tasks in only one sketch if you don't have the knowledge to do it, right now?
Write simple tasks.
- Read RPM.
- Controlling 2 servos. Adjust speed.
- I don't know if you include lcd and keyboard but if u do, then add another task to complete.
When each task is ended, you can complete your goal, finally.
One more thing, you need only one UNO.
Simple and effective.
You need to explain why it is necessary to measure the RPM of a stepper when you KNOW it is running at the exact speed that your Arduino code told it to run at.
lol im not measuring the speed of a stepper goodness. but surbyte the reason im asking for any helpful hints or direction to some info i might have missed. one of the ways to learn is asking questions im a mechanic best info i have ever learned was by asking a question. i get paid by the job not to screw around for two hours. i have a goal in mind which is what im working towards. so thank you for your input greatly. i'm just going to work on it some more.
huntj42:
i have a goal in mind which is what im working towards.
It's pretty difficult to figure out what is in your mind if you don't tell us.
...R
helpful hints or direction to some info i might have missed
How are you planning to detect the rotations of the wheel. What sensor do you plan to use. Will there be multiple pulses per rotation? If detecting the passage of a magnet, use a hall sensor, rather than a reed sensor, as it has no bounce. If you are using optical methods you should consider using a sensor with digital output.