Skip to content

Commit

Permalink
Add ability to enable/disable hardware limits
Browse files Browse the repository at this point in the history
  • Loading branch information
ics committed Nov 13, 2017
1 parent 6006eac commit c29b02b
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 10 deletions.
1 change: 1 addition & 0 deletions 3-5/GalilSup/Db/galil_motor_extras.req
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ $(P)$(M)_BRAKEPORT_SP
$(P)$(M)_BRAKE_CMD
$(P)$(M)_AUTOBRAKE_CMD
$(P)$(M)_BRAKEONDELAY_SP
$(P)$(M)_LIMITDISABLE_CMD
$(P)$(M)_HOMEALLOWED_CMD
$(P)$(M)_STOPDELAY_SP
$(P)$(M)_AMPGAIN_CMD
Expand Down
8 changes: 4 additions & 4 deletions 3-5/GalilSup/Db/galil_motor_extras.template
Original file line number Diff line number Diff line change
Expand Up @@ -1018,8 +1018,8 @@ record(mbbo,"$(P)$(M)_LIMITDISABLE_CMD")
field(TWVL, "2")
field(THVL, "3")
field(ZRST, "Off")
field(ONST, "Only Fwd Disabled")
field(TWST, "Only Rev Disabled")
field(ONST, "Fwd Disabled")
field(TWST, "Rev Disabled")
field(THST, "Both Disabled")
field(VAL, "0")
field(OUT, "@asyn($(PORT),$(ADDR))MOTOR_LIMIT_DISABLE")
Expand All @@ -1036,8 +1036,8 @@ record(mbbi,"$(P)$(M)_LIMITDISABLE_STATUS")
field(TWVL, "2")
field(THVL, "3")
field(ZRST, "Off")
field(ONST, "Only Fwd Disabled")
field(TWST, "Only Rev Disabled")
field(ONST, "Fwd Disabled")
field(TWST, "Rev Disabled")
field(THST, "Both Disabled")
field(INP, "@asyn($(PORT),$(ADDR))MOTOR_LIMIT_DISABLE")
}
Expand Down
87 changes: 86 additions & 1 deletion 3-5/GalilSup/op/ui/galil_motor_extras.ui
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<property name="windowTitle">
<string>EFrame</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" stretch="2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3">
<layout class="QVBoxLayout" name="verticalLayout" stretch="2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3">
<property name="spacing">
<number>1</number>
</property>
Expand Down Expand Up @@ -1972,6 +1972,91 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_30">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_37">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>125</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<family>Abyssinica SIL</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>Limit disable</string>
</property>
</widget>
</item>
<item>
<widget class="QEComboBox" name="qecombobox_14">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>1</height>
</size>
</property>
<property name="font">
<font>
<family>Abyssinica SIL</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="variable" stdset="0">
<string>$(DMC)$(M)_LIMITDISABLE_CMD</string>
</property>
</widget>
</item>
<item>
<widget class="QELabel" name="qelabel_37">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Abyssinica SIL</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="variable" stdset="0">
<string>$(DMC)$(M)_LIMITDISABLE_STATUS</string>
</property>
<property name="text">
<string>type</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_15">
<property name="spacing">
Expand Down
7 changes: 5 additions & 2 deletions 3-5/GalilSup/src/GalilAxis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1398,8 +1398,11 @@ asynStatus GalilAxis::getStatus(void)
home_ = (bool)(pC_->sourceValue(pC_->recdata_, src) == 1) ? 0 : 1;
//motor connected status
pC_->getIntegerParam(axisNo_, pC_->GalilMotorConnected_, &connectedlast);
connected = (rev_ && fwd_) ? 0 : 1;
if (connectedlast != connected)
if (limitDisable == 0)
connected = (rev_ && fwd_) ? 0 : 1;
else
connected = 1;
if (connectedlast != connected || !axisReady_)
pC_->setIntegerParam(axisNo_, pC_->GalilMotorConnected_, connected);
//If motor just connected, then limits are not
//confirmed consistent with motor direction yet
Expand Down
3 changes: 1 addition & 2 deletions 3-5/GalilSup/src/GalilController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@
// 18/09/17 M. Pearson
// Fix GalilAxis and GalilCSAXis destructors to remove compiler warnings on gcc 4.8.5 and above
// 09/11/17 M. Pearson
// Add ability to use LD command to enable/disable hardware limits.
// Required for axes that have unconnected limits.
// Add ability to enable/disable hardware limits

#include <stdio.h>
#include <math.h>
Expand Down
2 changes: 1 addition & 1 deletion 3-5/iocBoot/iocGalilTest/st.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!../../bin/linux-x86/GalilTest
#!../../bin/linux-x86_64/GalilTest

< envPaths

Expand Down

0 comments on commit c29b02b

Please sign in to comment.