7I96 Encoder Spindle tuning

More
18 Feb 2024 20:14 #293707 by kbec
I have an optical encoder, with A+ B+ and Index that seems to be generating signals. 
I also have a SPINX board attached that is driving a digital pot to my motor speed control.

The SPINX seems to control the speed, but my motor should go from 0 to 1200 RPMs, 

What do I need to look at in the HAL watch to see what I need to possibly change? I know the encoder is not producing the right speed, nor is the SPINX driving to pot from 0-100%.

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

More
18 Feb 2024 20:34 #293710 by PCW
Replied by PCW on topic 7I96 Encoder Spindle tuning
Can you post your hal/ini files?

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

More
18 Feb 2024 22:47 #293724 by kbec
Replied by kbec on topic 7I96 Encoder Spindle tuning
Here are all my hal and ini files

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

More
19 Feb 2024 00:32 #293730 by PCW
Replied by PCW on topic 7I96 Encoder Spindle tuning
So the basic setup looks OK:
PWM scale set to 1200 so you should get 0V
when the commanded spindle speed is 0,
and full scale (spinout=spin+) at a commanded
speed of 1200 RPM

Do you get these values?

The encoder scaling say 20 which would be correct for a
5 slot disk using quadrature (A and B) Is thsi what you have?
 

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

More
19 Feb 2024 00:56 #293732 by kbec
Replied by kbec on topic 7I96 Encoder Spindle tuning
This is my decal, I think it is as you described. 

I have the SPINX to my 5v power supply. I think there is a jumper on the control board that needs to be switched to 5v power.
Attachments:

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

More
19 Feb 2024 04:24 #293740 by PCW
Replied by PCW on topic 7I96 Encoder Spindle tuning
What RPM do you get if you connect your drive speed command signal to 5V?

Also a hand made encoder may have fairly dirty signals so it
might be worth looking at them with halscope and perhaps
setting the encoder up for slower signals and better filtering

 

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

More
20 Feb 2024 20:50 #293861 by kbec
Replied by kbec on topic 7I96 Encoder Spindle tuning
I think the problem may be the board, I had to order some parts for it. It would explain what is happening I think. I'll update you when I fix the board and let you know. Thanks as always

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

More
24 Feb 2024 17:35 #294225 by kbec
Replied by kbec on topic 7I96 Encoder Spindle tuning
I think the encoder is working, my issue is with the way my SPINX1 is wired. I think the pot should go from 0-7V, mine is peaking at about 2.5. I think this is because I have the SPINX1 ENA tied to my OUT0+ which is 5V. The instructions on the SPINX1 say to power the board is 5v pin 1 and 6. 

How can I wire it so that I can get the digital pot to be from 0-7v? What does pin2 GND on the SPINX1 go to? 
Attachments:

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

More
24 Feb 2024 17:44 #294226 by PCW
Replied by PCW on topic 7I96 Encoder Spindle tuning
The analog output voltage is not related to the 5V supply
It is the voltage difference between SP- and SP+ times
the PWM duty cycle, so for example if you had +12V
on SP+ and 0V on SP- and a 50% duty cycle PWM,
you would get 6V (12V* 50%) out.

The SPINX1A ENA pin must be _low_ for the analog out
to work. So for example if you wanted SSR5 to enable
the analog out, you would connect SSR5A to SPINX1 /ENA
and SSR5B to 5V GND

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

More
24 Feb 2024 19:44 #294239 by kbec
Replied by kbec on topic 7I96 Encoder Spindle tuning
I kind of get what you are saying, but I am lost.

I am not sure how to connect the SPINX1 to my 7i96 card, and if I have my voltage wrong feeding it somewhere.

In my hal file, I have:
loadrt hm2_eth board_ip="192.168.1.121" config="num_encoders=1 num_pwmgens=1 num_stepgens=4 sserial_port_0=0xxxxxxx"
setp [HMOT](CARD0).pwmgen.pwm_frequency 20000
setp [HMOT](CARD0).pwmgen.pdm_frequency 6000000
setp [HMOT](CARD0).watchdog.timeout_ns 5000000

do the pdm and pwm both need to be set, or is one overriding the other one?

I am sorry, but I forgot a lot of my electronics knowledge a long while ago.

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

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