changes to motor library
Fork of motor by
Diff: motor.cpp
- Branch:
- testing
- Revision:
- 10:f4fc8ccde4ad
- Parent:
- 9:22b119eef1de
- Child:
- 11:4a6f97cc1f1e
diff -r 22b119eef1de -r f4fc8ccde4ad motor.cpp --- a/motor.cpp Mon Nov 07 16:37:58 2016 +0000 +++ b/motor.cpp Fri Nov 11 12:50:48 2016 +0000 @@ -33,7 +33,9 @@ //need a function for calcu;lating the angle //need a function for converting w1 to delta. or do i? - +//---------------------------------------------------------------------------------------------------------------------------------- +//----------------------------------------------This is for Motor Set up------------------------------------------------------------ +//---------------------------------------------------------------------------------------------------------------------------------- void runMotor() /// putting it into this mode for some reason makes a bit of a whinning noise (this may simply just be the motor running) { @@ -75,7 +77,11 @@ TFC_HBRIDGE_DISABLE; return; } - +//----------------------------------------------------------------------------------------------------- +//------------------------ this is for speed control--------------------------------------------------- +//----------------------------------------------------------------------------------------------------- + + void Acc(float& motorA, float& motorB)// set up so as to control both motors during acc. Potential use during corners { @@ -174,6 +180,24 @@ //------------------------------------------------Cornering Control----------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------------- + + +// this is a function whihc works off of the duty cycle. +void dutyCycleCorner( float speed,float & w1, float & w2,float middlePoint) +{ + float width; + //float radius= center(middlePoint); + float radius = 0.6; + float w1=(speed/radius)*(radius + width/2); + float w2=(speed/radius)*(radius - width/2); + + TFC_ + + + + return; +} + void corner(float &w1,float &w2,float deltaTheta,int maxspeed) {// when cornering left the left motor slows down more than the right hand side