custom hal component failed to compile, undeclared (first use in this function)

More
03 Jan 2023 00:55 - 07 Jan 2023 23:16 #260817 by smc.collins
Last edit: 07 Jan 2023 23:16 by smc.collins.

Please Log in or Create an account to join the conversation.

More
03 Jan 2023 01:34 - 07 Jan 2023 23:16 #260818 by smc.collins
Last edit: 07 Jan 2023 23:16 by smc.collins.

Please Log in or Create an account to join the conversation.

More
04 Jan 2023 03:59 #260892 by smc.collins
more debugging, found a bunch of race conditions, memory leaks and some problems with shared variable, I don't think that one is my fault. anyways rewrote a bunch of logic, brought the code to the middle of the road for coding standards, given a few days to test and adding logic to job, I will release this a complete for broad use.

as always constructive criticism useful
Attachments:

Please Log in or Create an account to join the conversation.

More
04 Jan 2023 22:03 - 04 Jan 2023 22:06 #260970 by smc.collins
day 6, massive code cleanup, logic improvements, implemented what I think could be considered stair logic, and started creating a whole new program for running tool changers. I am working on creating functional blocks that can be assembled with a gui and assembled into a hal file and compiled with halcompile. my focus is cavemen simple type of code, short, sweet and clean. I have been carefully watching my execution times, looks VERY FAST, everything is implemented inside the component. keeps the hal file cleaner and make life simpler.

this hasn't been tested on real hardware yet, but it does pass every test my simulation machine sets and  I have made a few toolchanges with timeout problems in the last few days. so I changed some logic around and this appears to be working as intended now.

feedback appreciated, but the silence is deafening

 
Attachments:
Last edit: 04 Jan 2023 22:06 by smc.collins.

Please Log in or Create an account to join the conversation.

More
06 Jan 2023 21:47 - 06 Jan 2023 22:02 #261128 by smc.collins
more debugging, logic changes, redesigned timers and this is passing all of my unit tests I created. Next step, machine testing.Anybody know how to pass a float value into a component pin in ? I have been trying with no sucess. s32 whole numbers are fine thoughnoticed slightly out of date version with a few bugs I already squashed.
Attachments:
Last edit: 06 Jan 2023 22:02 by smc.collins.

Please Log in or Create an account to join the conversation.

More
06 Jan 2023 21:54 #261130 by rodw
Floats are supported. Available types for pins are covered in the docs here
linuxcnc.org/docs/2.9/html/hal/comp.html#_definitions
The following user(s) said Thank You: smc.collins

Please Log in or Create an account to join the conversation.

More
06 Jan 2023 22:03 #261131 by smc.collins
I get that, what I didn't see was a way to pass them from the hal file to the hal component, I have tried a bunch of different methods based on the syntax of s32 etc with no sucess.

Please Log in or Create an account to join the conversation.

More
06 Jan 2023 22:08 #261132 by rodw
Like this
author "Rod Webster";

pin in  float joint_vel            "Joint velocity (attach to joint.N.joint−vel−cmd)";
The following user(s) said Thank You: smc.collins

Please Log in or Create an account to join the conversation.

More
06 Jan 2023 22:44 - 06 Jan 2023 22:46 #261139 by smc.collins
the problem is that I can't seem to find the correct context for the hal file, I can get the pin in float to work fine. I have 6  adjustable timers, I would like to be able to set in the hal file. I can do it with s32 , I just haven't seen a example of the proper verbage for hal. 
Last edit: 06 Jan 2023 22:46 by smc.collins.

Please Log in or Create an account to join the conversation.

More
07 Jan 2023 19:24 - 08 Jan 2023 18:07 #261187 by smc.collins
edit, fixed some bugs, this code can be modified to work with the oractoolchanger, if anyone is interested I will do my best to make the modifications required but I have NO hardware to test on.Presently I am busy now working on the HurcoCarousel.comp.

in this post in the latest file

Updated the pocket filtering scheme to include a 10 msec debounce, will test later today to see if this is cure to occasionally canceled motor runs from invalid pocket values., fixed the toolchanged notification not being sent and failing to reset the iocontrol loop

I will be doing more minor testing, edge case hunting etc this week. I have written this to the best of my ability in terms of electrical, mechanical and operational theory understanding.  C and in general programming languages are new to me. If anyone wants to contribute back and update or even improve this program, please feel free to do so. There are more hal components coming for toolchanging. You can load this file into the vmc grey sim and drop in the sample hal config and add cinturnchanger.hal to the vimc ini and then you can test your ideas on tool decoding etc.

I did not implement a jog function, I gave a lot of consideration to it, and I think that the danger of jogging outweighs the inconvenience of having to call for toolchanges via the MDI, also, it's better that we go through the turret lock and test routines to ENSURE that the turret is EXACTLY where it should be so the tool offsets are correct.

if the debugging session later today fails, I will post a notification and continue updating until this program does work. I only made very small changes today and debugged them in sim, so I have a reasonable amount of confidence they are working. 
Attachments:
Last edit: 08 Jan 2023 18:07 by smc.collins.

Please Log in or Create an account to join the conversation.

Time to create page: 0.098 seconds
Powered by Kunena Forum