Loading...
Pages: 1 [2]   Go Down
Author Topic: Need Help with an Uno and 2 linear actuators  (Read 330 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Tesla Member
***
Karma: 89
Posts: 6321
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

They are because I mapped the lowest value for each to be 0.

I meant print out the values actually being read when you know the actuators are level and around the position where you saw the problem, and see if you are really getting equal values.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I think I have figured out the issue. I needed to change 
Code:
Act1 = (float(ActPot2MapVal) / float(ActPot1MapVal)) * 400.00;
to 
Code:
Act1 = (float(ActPot2MapVal) / float(ActPot1MapVal)) * 375.00;.
This acts as like a buffer for the actuators so that they have time to react to the new speed value.

Code:
void EqualizeUP(){
 Act1=0;
 Act2=0;
  if(ActPot1MapVal > ActPot2MapVal){
    Act1 = (float(ActPot2MapVal) / float(ActPot1MapVal)) * 375.00;
    Act2 = 400;
  }
  else{
    Act2 = (float(ActPot1MapVal) / float(ActPot2MapVal)) * 375.00;
    Act1 = 400;
  }
 }

void EqualizeDOWN(){
 Act1=0;
 Act2=0;
  if(ActPot1MapVal > ActPot2MapVal){
    Act2 = (float(ActPot2MapVal) / float(ActPot1MapVal)) * -375.00;
    Act1 = -400;
  }
  else{
    Act1 = (float(ActPot1MapVal) / float(ActPot2MapVal)) * -375.00;
    Act2 = -400;
  }
 }
Logged

Pages: 1 [2]   Go Up
Print
 
Jump to: