![]() |
Incrementation Code not working
We were working on our Incrementation code for our control system, it just makes sure we dont' make abrupt changes in our movements that could damage something....we had it working for the Y coordinates, but then we incorporated it into a function so both Y and X could call on it. That's where everything went wrong....The servos we were testing with would move in random directions without us controlling. Here is the code we wrote:
Code:
int Incrementation_Code(int motor_curr, int motor_prev, int padd, int max_step) |
Re: Incrementation Code not working
Do both servos move erratically, or only the X servo?
Did you change the Incrementation_Code function? If you have a copy that worked with only one servo try changing it so it uses the other servo/input. I will test the code tonight, and see if I can find the problem. |
Re: Incrementation Code not working
You don't set RetVal in all branches of your function.
|
Re: Incrementation Code not working
Joe Ross is right.
Code:
//Accelerate |
Re: Incrementation Code not working
Quote:
Quote:
I can't believe we didn't notice that :ahh: Thanks for the help! I'll be sure to test that when I get the chance tonight. |
Re: Incrementation Code not working
Good luck.
|
Re: Incrementation Code not working
It works fine!! The only difference than what you provided in the code was to assign it the motor_curr rather than adding or subtracting the change.
|
| All times are GMT -5. The time now is 04:49. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi