Commit Graph

148 Commits

Author SHA1 Message Date
Paul Barron
e36d4bcab3 Change comment 2019-12-17 10:37:24 +01:00
Paul Barron
5d5ee5f4ad Add latest commit for tc_mca_std_lib 2019-12-17 10:33:57 +01:00
Paul Barron
5743a13513 Remove mode 2 from iRestoreCode
Issues found regarding overiding of .config params in the axis struct.
Also doubts about whether it would actually be used.
2019-12-17 10:27:25 +01:00
Paul Barron
e000543a7f Add ST_AxisPersistent.TcDUT to generic structure 2019-12-13 13:45:50 +01:00
Paul Barron
5570b03fad Changes inside tc_mca_std_lib
Moved persistent variables from MAIN to a new struct in the generic_structure
called ST_AxisPersistent
2019-12-13 13:44:16 +01:00
Paul Barron
f1063b56d7 Change names of MAIN.STARTUP and MAIN.SHUTDOWN
Change to MAIN.RESTORE_POSITIONS and MAIN.STORE_PERSISTENT
Bug fix: add check in MAIN.RESTORE_POSITIONS to check whether
an axis was moving at shutdown.
Variable name changes to acommodate moving the persistent variables
from MAIN to a DUT in the generic structure.
2019-12-13 13:41:25 +01:00
Paul Barron
f2d73d013f Fix whitespace damage
No code changes
2019-12-11 15:24:00 +01:00
Paul Barron
3b633b1487 Changes in tc_mca_std_lib
No changes in tc_general_struct in this commit
2019-12-11 15:22:36 +01:00
Paul Barron
a9d5e51ac0 Added saving of position values throughout the normal PLC cycle
Added a check in MAIN.SHUTDOWN that makes sure the restore  has been
done first before starting to save values again.
Probably should change the name from MAIN.SHUTDOWN to MAIN.SAVEVALUES or something.
2019-12-11 15:17:59 +01:00
Paul Barron
10ef1a594d Remove MAIN.SHUTDOWN from ordinary PLC cycle
This created a problem in that MAIN.STARTUP wasn't working correctly
because it takes a couple of cycles to complete and MAIN.SHUTDOWN
was overriding the values stored after a power loss. Thus the restore won't work
for a user cold reset. It can be catered for by adding it back into the ordinary PLC
cycle but only executing if bPositionRestoreDone is set.
2019-12-11 15:02:11 +01:00
Paul Barron
df44dd3b82 Bug fix: add additional check in MAIN.SHUTDOWN
gvl.axes[i].Axis.Status.Moving doesn't seem to work if the axis isn't enabled.
Therefore added a check to see whether gvl.axes[i].Axis.NcToPlc.ActVelo <> 0.
If it's non-zero then don't restore the encoder value on restart.
MAIN.SHUTDOWN also added to the normal operation cycle, this is to allow restart
after a "Reset Cold" command in Visual Studio, otherwise the only time position is
restored is an actual lose of power. It might be also useful when a user restarts
the PLC program manually.
Also modified a few comments in MAIN.STARTUP.
2019-12-11 14:28:54 +01:00
Paul Barron
83f1b66c9b Fix white space damage 2019-12-11 13:57:26 +01:00
Paul Barron
480f4098bb Moved the cycle through of the read parameter fbs inside if statement
Motivation: after the position restore code has executed successfully
there is no point running any of the code again and wasting PLC cycles.
Thus the first step in the MAIN.STARTUP is a check whether the code has
been completed or not. If it is has completed successfully ignore everything else.
2019-12-11 13:54:19 +01:00
Paul Barron
534a318269 Remove timer tmrRetry from MAIN.STARTUP
No longer required in the restore position state machine code.
If the read parameter function block isn't successful it will go back
a set in the case statement and try again.
The read parameter function block, fbReadEncRefSys, reads the type of axis
either inc or abs.
2019-12-11 13:35:50 +01:00
Paul Barron
090fbd03eb Lots of changes in MAIN.STARTUP
Changes to the way the code checks whether the enc type is valid.
Added a parameter to the axis struct for setting a homing value other than 0.
2019-12-10 16:48:34 +01:00
Paul Barron
ac37748fbe Add comments to MAIN.STARTUP
Slight tidy of code but no structural changes.
2019-12-10 13:27:05 +01:00
Paul Barron
dbd145ed68 Add DUT RestorePosition in tc_mca_std_lib
Also adjusted code in MAIN.STARTUP to adapt to the new type variable
instead of the int previously.
2019-12-10 12:49:37 +01:00
Paul Barron
f7906d265a Readability change, make case statements easier to read
No code changes
2019-12-10 11:39:00 +01:00
Paul Barron
d88816156a Change to variable in axis struct for restore of incremental enc values on lose of power
Change iPositionRestore to ePosition restore.
Change from int to enum.
2019-12-10 11:37:34 +01:00
Paul Barron
c49d1d0faf Increase homing and jog speeds
For axis 1 and 2
2019-12-10 10:37:08 +01:00
Paul Barron
c6cac2ce7c Set monitoring parameters
E.g. position lag, target position etc.
Done for axis 1 and 2.
2019-12-10 10:26:57 +01:00
Paul Barron
f59a9dfccf Invert motor polarity for axis 1 2019-12-09 15:02:05 +01:00
Paul Barron
ad48a4c161 Invert encoder counting direction on axis 2 2019-12-09 14:57:14 +01:00
Paul Barron
dd4cfbe34b Set dynamic parameters for Axis 1 and 2 2019-12-09 14:49:00 +01:00
Paul Barron
57aa137e4e Change encoder scaling factor denominator to 2000
Done for axis 1 and 2
2019-12-09 14:43:50 +01:00
Paul Barron
173400e7f0 Change Reference Velocity to 600
Changed for axis 1 and 2
2019-12-09 14:41:16 +01:00
Paul Barron
35eb7a5261 Change encoder scaling factor to num=60 and den=1000
Done for axis 1 and 2
2019-12-09 14:30:44 +01:00
Paul Barron
b7ae38ad86 Change link of encoder for axis 1 and 2 to hardware terminals 2019-12-09 14:16:51 +01:00
Paul Barron
f36a636a4e Link hardware inputs to bLimitFwd, bLimitBwd, bLimitHome
Done for both axis 1 and 2.
2019-12-09 14:05:32 +01:00
Paul Barron
8b2779fe61 Link boutput 2,3,6,7 to the hardware 2019-12-09 13:32:10 +01:00
Paul Barron
c8775e5ae5 Create bOutput 2,3,6,7 for switches in MAIN.TcPOU
modified:   solution/solution.tsproj
	modified:   solution/tc_project_app/POUs/MAIN.TcPOU
2019-12-09 13:29:28 +01:00
Paul Barron
5fe5abbbf3 Link bOutput1 and bOutput5 to hardware 2019-12-09 13:27:22 +01:00
Paul Barron
d36efd414d Create bOutput5 for axis 2 switches 2019-12-09 13:25:06 +01:00
Paul Barron
82c00f9999 Link PLC axes 1 & 2 to motion axes 1 & 2 2019-12-09 13:19:38 +01:00
Paul Barron
97f4607b7c Scan the bus 2019-12-09 13:17:30 +01:00
Paul Barron
a9dea34c41 Capitalise variable names of eStartUp
No code changes
2019-12-09 12:25:01 +01:00
Paul Barron
f98fa633a5 Fix whitespace damage in MAIN.TcPOU 2019-12-09 12:04:08 +01:00
Paul Barron
0772b525ab Update MAIN.TcPOU for TwinCAT version
Open MAIN.TcPOU in TwinCAT, add one line, delete it, save it.
TwinCAT updates the TwinCAT version number to 3.1.4024.0.
No code changes.
2019-12-09 11:59:42 +01:00
Paul Barron
bbfe0ab3e9 Commit after updating TwinCAT
No code changes
	modified:   solution.sln
	modified:   solution/solution.tsproj
	modified:   solution/tc_project_app/tc_project_app.plcproj
2019-12-09 11:54:52 +01:00
Paul Barron
619331cc28 After white space fix? 2019-12-09 11:11:08 +01:00
Paul Barron
56e8fb1c9b Change iStartup case to eStartup
Change int to enum for better readability
2019-12-04 15:09:05 +01:00
Paul Barron
fe65683e7c White space fix 2019-12-04 14:50:58 +01:00
Paul Barron
5d0116f27c Add comment plus variable name consistency fix 2019-12-04 14:44:49 +01:00
Paul Barron
1fd4d9bad6 Fix white-space danage 2019-12-04 14:09:59 +01:00
Paul Barron
3374ed36ae Merge 'tc_generic_struct/integration' into mbp-77/191204-SaveValuesOnPowerOff
Conflicts:
	solution/tc_project_app/POUs/MAIN.TcPOU
	solution/tc_project_app/tc_mca_std_lib
2019-12-04 13:42:31 +01:00
Torsten Bögershausen
4b2302d0d4 Fix whitespace damage in solution/tc_project_app/tc_mca_std_lib 2019-11-29 11:51:27 +01:00
Torsten Bögershausen
69f8fc4696 solution/tc_epicscommodule updated to 3.1.4024.0 2019-11-29 11:34:27 +01:00
Torsten Bögershausen
bef8078e99 Fix whitespace damage
Fix the whitespaces using check_fix_white_space.py
modified:   solution/tc_project_app/GVLs/GVL_APP.TcGVL
modified:   solution/tc_project_app/POUs/MAIN.TcPOU
2019-11-29 09:47:11 +01:00
Torsten Bögershausen
9facfb89c1 Update tc_epicscommodule to a white+space clean version 2019-11-29 09:43:45 +01:00
Federico Rojas
5644dd9bb7 Update Hardware FB for the latest version from Viktor Heirich and 4024.0
Some FB in the Etercat Termianls folder were not the latest version
They were replaced by the latest version according to  the developer Viktor Heirich# Please enter the commit message for your changes. Lines starting
2019-10-16 11:35:02 +02:00