View Single Post
  #8   Spotlight this post!  
Unread 22-07-2015, 13:47
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,680
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Generating Position Setpoints

Forcing Pos and Vel to the "known" values without setting a known time is probably much of the issue. You're probably getting a way with it at the end of acceleration, but not at the beginning of deceleration. I would recommend making a table of times and positions and speeds, dropping in extra values at the start/end of each phase.

Also, the use of the variable Error is strange. You are ultimately only using it as a special case flag at the start of deceleration; where it is used to set Pos is more easily given as Pos:=Decelpoint;. This should just be a special print statement that is not part of a loop.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.