This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
In the lab's 6b Motorware page 147. The lab suggests modifying the velocity plan configuration "STATE A" to "STATE B"
I have found the location in code, changed the state, enabled and all that, but the motor just sits there.
I think (not looking at it right now) the value "gMotorVars.SpinTAC.VelPlanStatus" comes up showing "STATE A" and never changes also.
Would someone please suggest resolutions to my error as well where I might get more information on "STVELPLAN" changes.
Thanks,
David
David,
Can you post your modified code? That would help me with resolving the configuration issue. Also, is there an error value in gMotorVars.SpinTAC.VelPlanErrID?
There is additional information in the User's Guide. Section 3.5.3 and Section 14.4 both cover Plan.
Woops !! Didn't even think to look at that error, "3004"
Seems like this was covered in one of the earlier labs.....is that right?
Attached is copy of 6b.c
Much Thanks,
David4263.COPYRIGHT.doc
David,
The error codes are documented in Section 14.4 in the User's Guide.
In looking at your code I found the issue. You cannot have a transition that goes from one state to the same state. So the line:
STVELPLAN_addCfgTran(stObj->velPlanHandle, STATE_B, STATE_B, ST_COND_NC, 0, 0, _IQ(0.1), _IQ20(1)); // From StateA to StateB
configures and invalid transition.
Also, Plan assumes that you are always starting from the first configured state, which in this case is STATE_A. So, the way that this plan is setup it would have never left STATE_A since there is not a transition that allows it to leave that state.
If you change the first transition to be the following, the lab will complete successfully:
STVELPLAN_addCfgTran(stObj->velPlanHandle, STATE_A, STATE_B, ST_COND_NC, 0, 0, _IQ(0.1), _IQ20(1)); // From StateA to StateB
Ahhhhh.... once again Adam, I owe you one. Your text explains it.
However, looking at the screen print attached, I thought it was saying to change the value from STATE_A to STATE_B,
which would have made it trying to go from B to B.
Thanks a lot.
I downloaded pdf and I am going over it now.
David
It is, but not every instance of STATE_A should be switched to STATE_B. It does look like the first STATE_A is highlighted in grey. Maybe I should update it to indicate highlighted in blue.
Adam,
No argument here. I was just looking at the image and "STATE_A" is highlighted. And one could say that it is highlighted more than the "STATE_A" two lines above. I'm not saying anything is wrong with the instructions.
It is just how I interpreted them. Don't underestimate the ingenuity of an idiot applies, although I am sure I am not an idiot for seeing it differently than most people.
Thanks for your help.
David