7i76e use outputs to toggle motor enable

More
4 years 9 months ago - 4 years 9 months ago #232872 by pCNC

I own JMC ihvs57 servos, [...]
In the discussion above the signal is always high on the enable-amp  output as far as I understood, any ideas how to connect the ENA+ input in my case?
I could just put a physical push-button inbetween a 5 Volt line, but I would prefer clearing the servos directly from Linuxcnc, something like a button in pyvcp. (Does a push button exist)?

I'm using the same type of motors, so I would expect the solution works for you too.

In my case, the pin (DIR4- on the mesa board, output 008 in pncConf) that is connected to the ENA+ of my motors, is high when the MachineIsEnabled is true and low when it is false. My multimeter confirmed that the pin changes between 0V and 5V when toggling that enable icon next to the e-stop icon in the top left corner in linuxCNC.

The alarm outputs of the motors are connected to the joint faults in LinuxCNC, which take away the MachineIsEnabled bit (via the custom_postgui.hal file). The pin connected to the ENA+ of my motor follows this to 0V. Someone needs to press the enable button to enable the machine again. That sets MachineIsEnabled to high, which in turn sets the pin to 5V. That way the errors are cleared using built in/standard LinuxCNC logic and buttons, without the need for extra/physical buttons.

The only bug I have, is that the pin follows to 0V a little slowly because the laptop can't communicate faster. Therefore the alarm is cleared as soon as it has triggered the joint fault, so the alarm is cleared a little sooner than I would expect. However, since the joint error is triggered, I don't really mind.
I'm curious if you get the same behaviour...
Last edit: 4 years 9 months ago by pCNC.
The following user(s) said Thank You: strahlensauger

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

More
4 years 9 months ago #232873 by tommylight
When the joint.n.fault triggers, LinuxCNC disables drives, that in turn resets the drives, so just enabling LinuxCNC is all that is required.
The more important part is what caused the fault, and for that the drives have to remain enabled to be able to troubleshoot, so omiting the joint.n.fault in hal will work, does require disabling and enabling LinuxCNC to reset the drives.

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

More
4 years 9 months ago #232874 by pCNC
I'm trying to tie the unhome function to my motor alarms, as LinuxCNC typically thinks my X axis stopped 50ish mm further ahead than it did in reality.I found a pin in halui that seems to be intended for this purpose, but I can't get it to work yet.

The custom hal code:

# Include your custom_postgui HAL commands here
# This file will not be overwritten when you run PNCconf again

#*************
# Motor alarms
#*************

# X - Joint 0
net x-alarm <= hm2_7i76e.0.7i76.0.0.input-11-not
net x-alarm => joint.0.amp-fault-in halui.joint.0.unhome

# Y - Joint 1
net y-alarm <= hm2_7i76e.0.7i76.0.0.input-27-not
net y-alarm => joint.1.amp-fault-in halui.joint.1.unhome

# Y2 - Joint 2
net y2-alarm <= hm2_7i76e.0.7i76.0.0.input-31-not
net y2-alarm => joint.2.amp-fault-in halui.joint.2.unhome

# Z - Joint 3
net z-alarm <= hm2_7i76e.0.7i76.0.0.input-15-not
net z-alarm => joint.3.amp-fault-in halui.joint.3.unhome

 This nets the halui.joint.N.unhome pins to the alarm signals just fine, according to hal show, but when I send my x joint into error, it remains homed. During my test, I was still in joint mode and had not homed any of the other joints yet.

Is this supposed to work, or am I overlooking something?
 

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

More
4 years 9 months ago - 4 years 9 months ago #232899 by strahlensauger
I have a 7i85 on P1 so I could use P2 for directing the Dir4- output? 
​​​​
The alarm fault pins work well.
@pcnc: When one of the alarm bits is true, I can not toggle the machine-is- enabled  by pressing the orange button, I first have to clear the alarm  and put a 5v impulse to the ena+ 
So connecting the ena+ to the dir- signal I don't understand. Still unclear is what signal you  are mapping to pin 008 and why. .And without  a button, your machine resets itself immediately after the alarm? 
Sorry for being that stupid, but could you  show me the mapping of pin 008 in the half file, I can not use pncconfig, because it would destroy my hal file.

I would prefer a solution without relay but still I have not connected the enable button and resetting the machine is more or less of academical interest, I still can turn the power off ;)...
​​​​Thanks for your patience...
Last edit: 4 years 9 months ago by strahlensauger.

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

More
4 years 9 months ago #232929 by pCNC
@strahlensauger
On the mesa 7i76 there is room for 5 step generators, and if I tell it I’m using 4 stepgens, it gives me 2 additional IO pins. On TB3 DIR4+ and - become 008 and the STEP+ and - become 009. 

From the documentation, I’m not sure if the 7i85 can do exactly the same, but I’ll post my hal file tonight for reference. 

A trick I use to try out stuff like this without messing up my hal file, is to use another configuration (e.g testConfig) to run pncConfig on to check my options and how they manifest in the HAL file. 
The following user(s) said Thank You: strahlensauger

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

More
4 years 9 months ago - 4 years 9 months ago #232942 by strahlensauger
Oh I thought you would have mapped the Pins to the P1 connector, you are using them on TB3, now I got it. And until you map them in hal they don't show clear signals-right? I couldn't measure on dir4- a clear voltage that confused me. And you dont map them to one of the outputs on TB6 because there they have 24V and you would have to use a relay.
Sorry it took that long to reach my brain...
I also have a 7i76e but on P1 is a 7i85 connected. I'm planning to use linear scales.


I used to use pncconfig to create test configurations,
but ultimatively the creation of the 7i76 TB5 and TB6 is not working. Didn't have time to check out why that happened so I'm getting used to use vim on my Hal files...
(Just searched the forum: that was a language problem:
LANG=C pncconf  in a terminal solved the missing TABs problem)
Last edit: 4 years 9 months ago by strahlensauger.

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

Time to create page: 0.259 seconds
Powered by Kunena Forum