7i76e use outputs to toggle motor enable

More
21 Jan 2022 19:38 #232674 by rodw

I own JMC ihvs57 servos, in the documentation I find:
"Enabling signal: This input signal is used to enable or prohibit; In addition, it can be used to clear the drive alarm. When ENA + is connected to +5 V, ENA-is connected to low power, the drive will cut off the current of each phase of the motor so that the motor is in a free state, where the pulse is not responded and the alarm can be cleared; When this function is not required, the energy signal end is suspended."
So the ENA+ only needs a short pulse to clear the drive, I can't connect the output signal from the 7i76e directly to the ENA+, because it is always on, apart from that the servo accepts only 5 Volts.
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)?

iocontrol.0.user-request-enable sends a pulse when the estop is cleared. You would need an optocoupler or fast signalling relay to switch 5v to the drive. Maybe it could be made to work. 
The following user(s) said Thank You: strahlensauger

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

More
22 Jan 2022 01:09 #232717 by strahlensauger
That sounds promising, I'll check that out.
Thank you.
The following user(s) said Thank You: rodw

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

More
23 Jan 2022 12:08 - 23 Jan 2022 12:09 #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: 23 Jan 2022 12:09 by pCNC.
The following user(s) said Thank You: strahlensauger

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

More
23 Jan 2022 12:31 #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
23 Jan 2022 12:32 #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
23 Jan 2022 19:48 - 24 Jan 2022 08:31 #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: 24 Jan 2022 08:31 by strahlensauger.

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

More
24 Jan 2022 09:03 #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
24 Jan 2022 10:38 - 24 Jan 2022 12:14 #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: 24 Jan 2022 12:14 by strahlensauger.

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

More
24 Jan 2022 18:05 - 24 Jan 2022 18:07 #232992 by pCNC
Correct :) We're not planning to use linear scales or other things that require usage of the expansion connectors (yet), so we should be able to manage with the IO on TB5 and 6.

I'm not entirely sure what you mean with "clear voltage", but the Dir- pin will take the value opposite to the Dir+ pin. If you don't map anything to it, it the dir+ keeps giving 5V and the dir- 0V, no matter what happens.

Here are the HAL and INI files I'm currently developing with:

File Attachment:

File Name: developConfig.hal
File Size:11 KB
 

File Attachment:

File Name: developConfig.ini
File Size:5 KB

File Attachment:

File Name: custom_pos...1-24.hal
File Size:1 KB


(Also, don't forget to connect the Field Power on TB1 when you start using TB5 and 6, otherwise LinuxCNC won't start forum.linuxcnc.org/39-pncconf/44668-linu...pncconf-for-mesa7i76)
 
Attachments:
Last edit: 24 Jan 2022 18:07 by pCNC.
The following user(s) said Thank You: strahlensauger

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

More
24 Jan 2022 20:56 #233012 by strahlensauger
The 7i76e is already installed and running, so every change is done on the "still alive patient". That is probably the reason why the voltage changed
so often, I get the voltage with two needles connected to the voltmeter and a flashlight underneath the mill... and a lot of cabling making it difficult
to get to the contacts... I got the glass scale really cheap, so it is just fiddling with electronics, almost more fun to me than milling. Just a hobby.
Thanks for the files, if I find some spare time in the next days I'll connect the Alarmreset cables.

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

Time to create page: 0.108 seconds
Powered by Kunena Forum