Hello Guest it is April 28, 2024, 10:36:32 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mcardoso

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 »
141
Mach4 General Discussion / Re: How to mark an axis as "Homed"
« on: October 06, 2019, 10:26:11 PM »
This may be diving into the realm of the Smoothstepper's Plug-in but there really seems to be no change in behavior between setting mc.mcAxisSetHomeInPlace() to TRUE or FALSE. This seems to be the only thing holding this function up for me.

I can correctly set the home offset, and set the API call to home in place, but then all the axes move to the switches and home normally. I'll cross post this question with Warp9 to try and get an idea of what they are doing with homing code on their end.

142
Mach4 General Discussion / Re: How to mark an axis as "Homed"
« on: October 06, 2019, 09:40:59 PM »
OK, here is where I am at on this. I have modified the REF ALL HOME script to ask me in a pop-up window if I want to define home from the absolute data in the servo drives or if I want to execute the normal homing sequence. If I choose normal, at the end of the sequence it asks if I would like to define the home position in the drives as well (which I answer YES to unless the homing failed for some reason). If I opt to restore the position data from the drives, the data is read, converted from hex to decimal, and written to the current position in Mach. I have not yet implemented the home in place to mark the axis as homed.

What I noticed is that the API call mc.mcAxisSetPos() only sets the fixture offset and not the actual machine position (which now as I just looked is what the documentation says - doh!). I think what I need to do is: change mode to home in place, read servo drive position, copy that position to the home offset, then home in place. Since this method can be completed when the machine is in any position, I can't guarantee I will be sitting at 0,0,0. What is pretty neat is I can enable and disable the motors as much as I want and the position data reflects the minuscule changes in shaft position as the motors get energized and de-energized. 

BTW, if anyone is interested, the servo drives are AB Ultra 3000's and I created an interface to the drives over serial (RS485) using the drive's host commands. Took a while to develop, but the serial interface through Mach 4/LUA is really solid and this communication seems bulletproof.

143
Mach4 General Discussion / Re: Axis Enable API Call?
« on: October 06, 2019, 09:30:38 PM »
Steve,

Gotcha, that makes sense. I have done a lot of scripting in Mach since I got started with it, but I still have a lot to learn. I would say now, after 6 months or so, I think I am more comfortable in Mach 4 LUA than I am in Mach 3 VBA (which I used a TON). I really appreciate how much more stable, fast, and powerful it is (even if the learning curve was... painful).

I got the "Button State" to work perfectly. Took me a little while, but I needed to enter the number zero in quotes (just like you posted) in order to get it not to generate errors. I think the enable button acts exactly how I wanted it to now - thanks!

There looks to be a TON of flexibility in the screen editor that I never realized was there, that's awesome!

144
Mach4 General Discussion / Re: How to mark an axis as "Homed"
« on: October 06, 2019, 09:25:09 PM »
Quote
There are other situations where you can change 'settings' like that. Ordinarily, and in Mach3, once a setting is made then the only way to change it is to restart Mach3.
All semblance of changing machine behaviour on the fly is lost.

I guess that is what I am familiar with (even though I've been in Mach 4 for a while now). Makes sense that it was made to be much more flexible.

Not 100% sure what you mean about the INI file. Is the goal to save your changes to the INI every time you make a change, or are you trying to avoid saving it at all?

At this time my thoughts are that I want to have Mach start up in a defined state every time. I may change settings throughout its use, but unless I crash the program, it should be back to default before shutting down.

145
Mach4 General Discussion / Re: How to mark an axis as "Homed"
« on: October 06, 2019, 06:49:36 PM »
Craig,

Didn't think of that... You think I can just change the Mach 4 homing configuration on the fly?

Looking at the API reference, I see mc.mcAxisSetHomeInPlace(inst, AxisID, T/F). I would think I could set this TRUE before calling to home the axis using my servos so they don't move (for absolute homing from the servo drives), and FALSE to home normally?

Thanks

146
Mach4 General Discussion / Re: How to mark an axis as "Homed"
« on: October 06, 2019, 05:34:18 PM »
Well shoot. So briefly, here is what I am trying to do. I have servo drives on my machine that have the absolute position stored in them through power cycles (even if the motor is moved). I can read this position into Mach and set the axis positions to match using scripts. This is the homing without needing to drive to the switch. Before I can do that though, I need to do a normal home to the home switches on my machine and write that "zero" position to the servo drives.

So technically I need to be able to home both to the switch and in place (which is what will be done most of the time).

I don't know what goes into it, but this would be a feature that would be really helpful (to me) to have exposed to the API. Something like mc.mcAxisSetRef()? Maybe I can use the home in place setting but find another way to accomplish the normal home to switch routine? I'm not sure how I could get the Smoothstepper to execute its homing sequence though...

This is a really weird use case, I know, but it would be really cool for me to get it working.

147
Mach4 General Discussion / Re: Axis Enable API Call?
« on: October 06, 2019, 05:24:40 PM »
Smurph,

I really appreciate you taking the time to respond here. It is helping me understand a lot more about the screen properties.

I tried doing that but used the scr.ButtonUp() property which didn't do what I was hoping. I'll try this out and see if I can get it to work.

When you say have a look at the properties, are you talking about dropping a button (or another element) on the screen and looking at what options are in the element's menu? I haven't seen a list elsewhere of what properties there are. Also, as far as SCR commands go, I have only seen a .txt document someone posted on this forum some time ago that listed what commands are available. Is there any published reference for those?

I totally get the documentation issue. I think many would much rather see features developed than documentation (so long as we can come here to get answers). Thanks for all the effort you put into answering questions like these.

148
Mach4 General Discussion / How to mark an axis as "Homed"
« on: October 06, 2019, 01:30:30 PM »
When you run the out-of-the-box homing script, the axes are homed one at a time and each one has a LED which changes from red to green to mark that the homing has completed on that axis.

I am writing my own homing script which doesn't use the built in "drive to home switch" type of homing. What API call can I use to set that LED green, and mark in software that the axis has been homed?

Thanks,

Mike

149
Mach4 General Discussion / Re: Axis Enable API Call?
« on: October 06, 2019, 01:27:47 PM »
Used that API call and it worked perfectly! Thanks!

Have a related question. As mentioned above, I have a number of conditions (Over-Temp Alarm, Failed power supplies, etc. ) which prevent me from enabling the machine. I could disable the "Enable" button using the scr.SetProperty() call, however I feel like that isn't the best way to do it from a user perspective since it doesn't directly tell you WHY you can't enable. Furthermore, the built-in feature to prevent enabling is only exposed to the ESTOP button and the user cannot add additional items to that list.

What I would like to do is have it to when you click on the button, it either enables the machine or doesn't, but then writes the error condition in the message bar. I wrote a script which does this, but I cannot keep the toggle button from changing states to where it is Red and shows "Disable".

My plan what to change it from a toggle button to a plain button but I could not figure out how to dynamically change the appearance of a plain button (to get it to look like a toggle button), and how to find out if the control is enabled or not.

Is there a way to use scr.SetProperty() to change the text, background color, blink enable, and blink rate of a button? Is there an API call that is something like mc.mcCntlIsEnabled() to find out if the control is currently enabled or not? I couldn't figure out how to do that.

150
Mach4 General Discussion / Re: Axis Enable API Call?
« on: October 04, 2019, 12:10:12 AM »
Ding ding ding!!!

That’s the ticket :). The control enable is exactly what I needed.

 So I was using improper semantics when describing the different elements of Mach. Let’s see if I can get it right now. The control is the overarching code which user the interpreter to read Gcode and  provide commands to the axes. The axes are logical elements which have position, velocity, and other data but are not the motor outputs... yet. The motors are the links to the physical I/O (step, direction, and enable). Motors are linked to axes and there may be more than one motor per axis, but only one axis per motor.

Thank you for taking the time to respond. It was very informative.

Mike


Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 »