Skip to content

Commit

Permalink
Fixed low level tilt limit restart problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
ale-git committed Oct 29, 2015
1 parent 43e1ecf commit 1eb755b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@

<Group>
<GroupName>eo-emsappl</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -2141,7 +2141,7 @@

<Group>
<GroupName>eo-emsappl-cfg</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -2253,7 +2253,7 @@

<Group>
<GroupName>opc-protocol</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand All @@ -2274,7 +2274,7 @@

<Group>
<GroupName>appl-services</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -2412,7 +2412,7 @@

<Group>
<GroupName>board-cfg</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -2602,7 +2602,7 @@

<Group>
<GroupName>eo-motor-controller</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -2891,7 +2891,7 @@

<Group>
<GroupName>eo-protocol</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -3042,7 +3042,7 @@

<Group>
<GroupName>eo-protocol-cfg-callbacks</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,10 +649,10 @@ static void s_eo_emsapplBody_encodersReader_init(EOtheEMSapplBody *p)
cfg.SPI_callbackOnLastRead = NULL;
cfg.SPI_callback_arg = NULL;

p->appEncReader = NULL; //eo_appEncReader_New(&cfg);
p->appEncReader = eo_appEncReader_New(&cfg);

// eo_errman_Assert(eo_errman_GetHandle(), (NULL != p->appEncReader),
// "error in appEncReader_New", s_eobj_ownname, &eo_errman_DescrTobedecided);
eo_errman_Assert(eo_errman_GetHandle(), (NULL != p->appEncReader),
"error in appEncReader_New", s_eobj_ownname, &eo_errman_DescrTobedecided);

}

Expand Down
30 changes: 6 additions & 24 deletions emBODY/eBcode/arch-arm/embobj/plus/mc/EOemsController.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,39 +537,21 @@ extern void eo_emsController_PWM(int16_t* pwm_motor_16)
int32_t rho0= ems->axis_controller[0]->position;
int32_t rho1= ems->axis_controller[1]->position;
int32_t rho2= ems->axis_controller[2]->position;

if (rho0*rho0+rho1*rho1+rho2*rho2-rho0*rho1-rho1*rho2-rho2*rho0>400000) // 25 deg limit
{
if ((rho0 <= rho1 || rho0 <= rho2) && pwm_joint[0]<0.f)
{
eo_axisController_Stop(ems->axis_controller[0]);
pwm_joint[0] = 0.f;
}
else if ((rho0 >= rho1 || rho0 >= rho2) && pwm_joint[0]>0.f)
if ( !(rho0 <= rho1 && rho0 <= rho2 && pwm_joint[0]>0.f) && !(rho0 >= rho1 && rho0 >= rho2 && pwm_joint[0]<0.f))
{
eo_axisController_Stop(ems->axis_controller[0]);
pwm_joint[0] = 0.f;
}

if ((rho1 <= rho2 || rho1 <= rho0) && pwm_joint[1]<0.f)
{
eo_axisController_Stop(ems->axis_controller[1]);
pwm_joint[1] = 0.f;
}
else if ((rho1 >= rho2 || rho1 >= rho0) && pwm_joint[1]>0.f)

if ( !(rho1 <= rho2 && rho1 <= rho0 && pwm_joint[1]>0.f) && !(rho1 >= rho2 && rho1 >= rho0 && pwm_joint[1]<0.f))
{
eo_axisController_Stop(ems->axis_controller[1]);
pwm_joint[1] = 0.f;
}

if ((rho2 <= rho0 || rho2 <= rho1) && pwm_joint[2]<0.f)
{
eo_axisController_Stop(ems->axis_controller[2]);
pwm_joint[2] = 0.f;
}
else if ((rho2 >= rho0 || rho2 >= rho1) && pwm_joint[2]>0.f)

if ( !(rho2 <= rho0 && rho2 <= rho1 && pwm_joint[2]>0.f) && !(rho2 >= rho0 && rho2 >= rho1 && pwm_joint[2]<0.f))
{
eo_axisController_Stop(ems->axis_controller[2]);
pwm_joint[2] = 0.f;
}
}
Expand Down
3 changes: 1 addition & 2 deletions emBODY/eBcode/arch-arm/embobj/plus/mc/EOemsControllerCfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extern "C" {
//#define EXPERIMENTAL_SPEED_CONTROL

#define USE_ONLY_QE

//#define SHOULDER_3rd_JOINT_COUPLING
//#define USE_JACOBIAN

Expand All @@ -43,7 +43,6 @@ extern "C" {
#if defined(HEAD_V3)
#undef USE_2FOC_FAST_ENCODER
#endif

//#warning in v3 fare in modo che NON venga definito USE_2FOC_FAST_ENCODER

#define EMS_PERIOD 0.001f
Expand Down

0 comments on commit 1eb755b

Please sign in to comment.