Stuck with spindle interface 7i76 card and weird BLDC driver

More
1 year 8 months ago #320310 by timo
Hello,

I tried to figure that out, but not really successful, so I spam the forum with the questions. (I have the feeling I should have found the information somewhere; maybe someone can point me in the right direction) 
I have a 6i25 card with a 7i76 card connected to my PC. Some stepper motors are running and can be moved with keyboard, a basic configuration is running.

Now I got stuck, trying to hook up the old BLDC driver (labeled TONMAN Brushless DC driver) or the machine (which I have no documentation for) seems not to run with an analog input. 
I tried to connect the Spindle interface somehow, but it does not want to run.

There is a pair of pins labeled +- (PWM / ANNA), but I think it is not really for analog input signal.
Hooking up a potentiometer (allowing to create a voltage between 0 and 5V) does nothing to a certain voltage. At approx. 2.6V it switches from "off" to "full speed".
I tried one of those PWM generators  

Attachment not found

which works fine. It allows to control the speed of the motor, no issue. I can adjust the motor speed by setting the duty cycle to anything between 10% and 100% and it seems to be what I need. 

Now the questions: Is it correct that in my situation the spindle interface of the 7i76 is just the wrong choice for my BLDC amplifier?
                                How do I make a PWM control for my spindle with the 7i76 (6i25)?
                               
Greetings Timo



 

Please Log in to join the conversation.

More
1 year 8 months ago #320347 by PCW
Yeah, sounds like it's a 5V PWM input.
 
There is 5I25 +7I76 firmware that replaces one stepgen (stepgen4)
with a PWMGen:

 

Attachment not found



Which should work to drive the motor driver

Please Log in to join the conversation.

More
1 year 8 months ago #320393 by timo
Thank you for reply.

So to change the firmware rather than using the software PWM is the way to go?
linuxcnc.org/docs/html/man/man9/pwmgen.9.html

I will give the the firmware change a try.

I hope I will not "brick" the card. :-)

Please Log in to join the conversation.

More
1 year 8 months ago #320428 by timo
I used sudo mesaflash --device 5i25 --write 5i25_7i76x2_1pd.bit --reload

Now I cannot get the direction change working. Is the direction pin of the stepgen still working?
I am using TB3 Pin2 und Pin3 for the PWM.
I tried to find a direction pin.

I can switch the spindle on and off via Axis UI and can also change speeds. (but not the directions)

Please Log in to join the conversation.

More
1 year 8 months ago #320431 by PCW
The direction pin is  GPIO (GPIO8)

So you need to set gpio8's is_output parameter
and link it to the spindle direction pin.

 

Please Log in to join the conversation.

More
1 year 8 months ago #320441 by timo
Thanks for looking into things.
I am not sure if I understand correct.
If I type mesaflash --device 5i25 --readhmid I get this

Attachment not found



Is I/O port and GPIO refering to the same thing. In the screenshot I/O port 8 says it has no sec. (secondary?) function.


 

Please Log in to join the conversation.

More
1 year 8 months ago #320443 by PCW
All pins have GPIO capability (primary function) 
Secondary functions are PWM,Stepgen etc

Please Log in to join the conversation.

More
1 year 8 months ago #320471 by timo
I do not really understand. If I flash another bit file (obviously it has two pwm gen) it shows four lines. (that is not a fix, because I wanted to use a stepgen on pin4 and Pin17)

        IOPortTag & x"00" & PWMTag & PWMBDirPin,                 -- I/O 06    PIN 4
        IOPortTag & x"00" & PWMTag & PWMAOutPin,                -- I/O 07    PIN 17
        IOPortTag & x"01" & PWMTag & PWMBDirPin,                 -- I/O 08    PIN 5
        IOPortTag & x"01" & PWMTag & PWMAOutPin,                -- I/O 09    PIN 6

The version with one PMW shows only one line. One line seems to be "empty". 

        IOPortTag & x"00" & NullTag & NullPin,                              -- I/O 08    PIN 5
        IOPortTag & x"00" & PWMTag & PWMAOutPin,                 -- I/O 09    PIN 6

Is there something missing? I would have expected something like:

        IOPortTag & x"00" & PWMTag & PWMBDirPin,                 -- I/O 08    PIN 5
        IOPortTag & x"00" & PWMTag & PWMAOutPin,                -- I/O 09    PIN 6


Greetings Timo

p.s. Do I understand it right that the gpio.008 is not predefined connected for this pwmgen, but could have been used for something else as well?
I am still curious if the tags in the firmware would change anything in terms of use.

Now I put folllowing lines in the .hal (particular unsecure if the setp is what is to be done)

setp hm2_5i25.0.gpio.008.is_output 1
net spindle-ccw spindle.0.reverse => hm2_5i25.0.gpio.008.out

That switches the polarity on the TB3 pin4 and TB3 pin5, that again changes the direction of the motor.

Do not fully understand why it does not switch between 0 and 4.9V. It switches between -4.9V and 4.9V.
 

Please Log in to join the conversation.

More
1 year 8 months ago #320520 by PCW
The outputs on TB3 pin 4 and 5 should be used individually,
 that is, you would use the appropriate output and
GND (TB3 pin 1) NOT both outputs to create a 5V signal
Which output you chose depends on the direction polarity.

On later bitfiles I have changed from PWMDIR to GPIO
on some configurations because it is more flexible
(many systems do not use the DIR pin and it is unavailable
as a general purpose output in these cases)

And yes, GPIO8 can be used for any type of output.
 

Please Log in to join the conversation.

More
1 year 8 months ago #320569 by timo
Thank you. That clears things up a little more.

So I can change the wiring a bit, Maybe even connect the other pin to the drive enable.

Please Log in to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum