7C80 Analog Spindle Control

More
21 Jan 2022 21:34 #232686 by FreeRider
I am slowly and progressively losing my mind trying to get the digital pot working for VFD control (normal 2 axis lathe, 7c80 board with RPI4)! The VFD is outputting its 10volts which is fed into each side of the isolated pins (spindle- and spindle+), center wiper goes back to the analog input on the VFD...simple enough.

I've used the pncconf wizard with a 7i76 board (7C80 isn't supported, 7i76 also has dedicated spindle control) and changed the board types to match as close as possible but cannot get an error free setup! Everything works exactly as planned with the digital pot lines commented just without spindle control. There is a encoder (connected to the standard inputs) on the spindle which is operating perfectly fine.

Seems info on the 7C80's is a bit scarce so its a problem of knowing where to look for the correct info. Any help would be greatly appreciated. Hal and ini file attached. 
Attachments:

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

More
21 Jan 2022 22:33 #232693 by PCW
Replied by PCW on topic 7C80 Analog Spindle Control
The 7C80 doesn't use a sserial interface for the spindle but rather direct PWM
so the pin/parameter names are different.

There's a close to correct PWM spindle setup in this thread:

forum.linuxcnc.org/27-driver-boards/4031...pi-4?start=10#216247

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

More
21 Jan 2022 23:09 #232697 by FreeRider
Many thanks, that is actually the code I started with but it kept hanging on:

setp [HMOT](CARD0).pwmgen.00.output-type 1

Even with pwmgens set to 1 at the top of the hal its still hangs. I poured over the 7C80 manuals as well as the hostmot2 manuals and can't determine why its not happy, seems the type 1 output is exactly what I want.

Thanks again!

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

More
21 Jan 2022 23:23 #232700 by PCW
Replied by PCW on topic 7C80 Analog Spindle Control
What is the actual error?

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

More
21 Jan 2022 23:24 #232701 by FreeRider
Alright, was able to clear errors by changing all the instances of

setp [HMOT](CARD0).whatever

to

setp [HMOT](CARD0).0.whatever

Simple fix so far and it looks like I'm getting something out of the spindle output now (voltage is way off but thats a problem I can work)!

Thanks again PCW for the help!

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

More
21 Jan 2022 23:42 #232704 by PCW
Replied by PCW on topic 7C80 Analog Spindle Control
Hmm that's a bit weird considering this is whats in the ini file:

[HMOT]
# **** This is for info only ****
CARD0=hm2_7c80.0

so adding a .0 should give a name like hm2_7c80.0.0.whatever which does not exist

It looks like you also need to invert the PWM (I added that code to the previous linked section)

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

More
21 Jan 2022 23:55 #232707 by FreeRider
That's my mistake, I used a find and replace for the [HMOT](CARD0) to change them all to the actual device name and didn't use the card variable from the ini file. In my hast I made a typo which sucked back about 5 hours of work :).

Yes, I did invert the logic to get the voltage moving the right way. Thanks again for your help, had no idea the serial method I was using was flawed from the start.

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

More
22 Jan 2022 00:01 - 22 Jan 2022 00:01 #232710 by PCW
Replied by PCW on topic 7C80 Analog Spindle Control
Another thing that can help a lot is listing the available pins/parameters:
(with linuxCNC running)

halcmd show all

(for everything)

halcmd show all hm2

(for just hostmot2 hardware pins and parameters)
Last edit: 22 Jan 2022 00:01 by PCW.

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

More
22 Jan 2022 06:01 #232727 by FreeRider
Super helpful, I actually think I may have come across a thread where you posted about writing that info to a text file (which I immediately did)!

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

Moderators: PCWjmelson
Time to create page: 0.071 seconds
Powered by Kunena Forum