[Emc-users] Minimally printed rotary. Initial torque testing..

2021-09-12 Thread Sam Sokolik
Small update

https://youtu.be/eW1GGI55Epc

___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Serial Port access

2021-09-12 Thread John Dammeyer
In order to improve my rather poor Python skills I've spent the last day 
fighting with Python 3 Thonny on my WIN-10 laptop.  The issue is the change 
from Python 2 to 3 to handle extended characters which a small module like the 
CANUSB has no knowledge of.  So dealing with 0x07 (bell character) and 0x0D (CR 
character) requires strange statements like 

# Initialize CANUSB dongle
ser.eol = '\r'.encode('utf-8')
ser.write('C\r'.encode('utf-8'))# Close first
ser.write('F\r'.encode('utf-8'))# Clear Error Flags by reading them
ser.write('S5\r'.encode('utf-8'))   # set 250kbps
ser.write('O\r'.encode('utf-8'))# Open CANUSB for communication.

Received data requires the same hoops.  Anyway, I think I have a simple 
character accumulation and parsing program working that now sends a message to 
toggle an output and moves the CANopen node reporting NMT PRE-OP status into 
OPERATIONAL a which point it starts sending PDO messages with status.

This is not a LinuxCNC Python program.  That one works fine setting say MIST 
COOLANT ON/OFF via the AXIS screen button.  This parsing of messages etc is 
designed to get data back from a CANopen module into LinuxCNC when I move it to 
the LinuxCNC version.

Anyway attached is the output showing the messages and how the module comes on 
line.  I'll post the code when I've ported it to the LinuxCNC version.

John Dammeyer




> -Original Message-
> From: John Dammeyer [mailto:jo...@autoartisans.com]
> Sent: September-10-21 10:11 AM
> To: 'Enhanced Machine Controller (EMC)'
> Subject: Re: [Emc-users] Serial Port access
> 
> Hi Andy,
> 
> The output below shows CANopen PDO message #2 (0x300) to ID 0x18, 1 byte, 
> alternating between 0x01 and 0x00 being issued once
> per second.
> 
> pi@raspberrypi:~/projects/python $ python TestSerial.py
> Sent CAN message with relay value = t318101
> Sent CAN message with relay value = t318100
> Sent CAN message with relay value = t318101
> Sent CAN message with relay value = t318100
> Sent CAN message with relay value = t318101
> 
> The little module shown in that photo I posted last time is connected to a 
> pneumatic valve on Output #1.  It clicks ON and OFF once
> per second.   The code is running as a Python Command line program on a 
> standard Raspian distro.  I'll bring out the Pi4 with
> LinuxCNC and take a look at linking into the HAL file.
> 
> IMHO the Python serial is very clumsy for dealing with serial with all the 
> format and .encode parameters for simple character strings.
> The source code is attached.
> 
> John Dammeyer
> 
> > From: andy pugh [mailto:bodge...@gmail.com]
> > On Thu, 9 Sept 2021 at 05:31, John Dammeyer < 
> >  jo...@autoartisans.com> wrote:
> > > I've been reading
> > >   
> > > http://linuxcnc.org/docs/2.4/html/hal_comp.html
> >
> > For this application I think that a Python userspace component using
> > Pyserial is probably the easier approach.
> >
> >   
> > http://linuxcnc.org/docs/2.8/html/hal/halmodule.html
> >
> > --
> > atp


PythonCAN-1.pdf
Description: Adobe PDF document
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Spindle setup for 5i25/7i76

2021-09-12 Thread Gene Heskett
On Sunday 12 September 2021 17:49:43 Alan Condit wrote:

> I built a new controller for my 9x20 lathe using a 5i25/7i76 combo. I
> thought I had everything working but I still can’t get the spindle
> working correctly. I have a 1.5hp PMDC treadmill motor that I am
> controlling with a Cycletrol-150 DC controller. The am using the
> analog out from the 7i76 to replace the potentiometer to control the
> spindle speed. I have a 100 slot encoder with index (homemade) on the
> spindle.
>
> The spindle starts under LCNC control but I am not getting an “at
> speed indication” at above about 100rpm. The motor sounds like is is
> running at a steady speed but the Spindle Speed indicator fluctuates
> wildly. I am suspicious of the spindle encoder. Before I was just
> running it as a 100 count counter with index and it worked fine. I
> can’t figure out in PNCConf how to set up a spindle counter with index
> for the 7i76.
>
> Questions:
> Is it likely that my encoder is the problem?
> I don’t know how to adjust the detectors to be out of cycle by 90°?
> Any helpful hints? Should I just go back to the 100 slot counter?
> Should I replace my whole homemade encoder with a real commercial
> spindle encoder?

getting proper quadrature out of homemade stuff is a bear with 4 sore 
paws. I know, I done it about 3 times now. I would in your shoes do this 
which has worked really well here.

How many "gear shifts" do you have between the motor and the actual 
spindlle? You could probably do more than 2, but thats all the gears I 
have on my g0704. I have tally switches on that knob that tell linuxcnc 
what, if any, gear it is in. I have a sibgle screw glued to the side of 
the drawbar cap that is read by an ATS-667 hall effect device for the 
once per turn "index signal" to an encoder. Prowl ebay and get a cheap 
1000 line encoder for a $20 bill, and spin it with the back of the 
spindle motor shaft. It will be way to fast to get thru the average 
BoB's opto stuff, so you'll have to use one of the encoders in the 5i25, 
which can do that fast a signal or hack the BoB to remove them.  Feed 
the same encoder you are feedingthe index into with the outputs of this 
encoder
.
Not knowing the gear ratio in either gear, I hacked up a counter in hal 
that starts counting pulses from an encoder on the back of the spindle 
motor, counting them for 100 turns of the spindle as seen by the 
ATS-667, and freezing the count so you can read it with a hal-meter. 
Divide that count by 100 and you have the "SCALE" value for that gear. 
Repeat for the other gear. then use the tally switches and a mux to feed 
the correct SCALE into that input to linuxcnc. For my g0704, that scale 
is a hair over 7,000 in high gear, and a different hair over 14,000 in 
low gear. And with that high a scale, quantization noise flat 
disappears, allowing very high pid Pgain values, 20 or more for 
extremely stiff spindle speed control. I use the PICO pwm-servo amp, and 
the only time I can tell the spindle is loaded really heavily is when 
the iron in the motor starts squeaking as that 9.7 amp motor is being 
throttled at around 18 amps by the pwm-servo.  Thats about 2 hp from a 1 
hp rated motor, but its had 6 years to complain and hasn't, not even 
asking for fresh brushes. 

When you are ready, let me know and I'll pm you my hal files and such so 
you can cherry pick and use what you want.

Take care now Alan.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Spindle setup for 5i25/7i76

2021-09-12 Thread Peter C. Wallace

On Sun, 12 Sep 2021, Alan Condit wrote:


Date: Sun, 12 Sep 2021 16:49:43 -0500
From: Alan Condit 
Reply-To: "Enhanced Machine Controller (EMC)"

To: "Emc-users@lists.sourceforge.net" 
Subject: [Emc-users] Spindle setup for 5i25/7i76





I built a new controller for my 9x20 lathe using a 5i25/7i76 combo. I thought I 
had everything working but I still can??t get the spindle working correctly. I 
have a 1.5hp PMDC treadmill motor that I am controlling with a Cycletrol-150 DC 
controller. The am using the analog out from the 7i76 to replace the 
potentiometer to control the spindle speed. I have a 100 slot encoder with 
index (homemade) on the spindle.


The spindle starts under LCNC control but I am not getting an ??at speed 
indication?? at above about 100rpm. The motor sounds like is is running at a 
steady speed but the Spindle Speed indicator fluctuates wildly. I am suspicious 
of the spindle encoder. Before I was just running it as a 100 count counter 
with index and it worked fine. I can??t figure out in PNCConf how to set up a

spindle counter with index for the 7i76.

Questions: 
Is it likely that my encoder is the problem? 
I don??t know how to adjust the detectors to be out of cycle by 90??? Any 
helpful hints? Should I just go back to the 100 slot counter?

Should I replace my whole homemade encoder with a real commercial
spindle encoder?



I would first check the A/B phasing and symmetry by monitoring the A and B 
inputs with halscope when turning at a slow speed (say 100 RPM or less)

The pins to monitor would be:

hm2_5i25.0.encoder.00.input-a
hm2_5i25.0.encoder.00.input-b


Ideally both A and B should be square waves (50% duty cycle)
and have a 90 degree phase difference (A changes in the middle of B high and B 
low times and vice versa)




Peter Wallace
Mesa Electronics
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Spindle setup for 5i25/7i76

2021-09-12 Thread John Dammeyer
Hi Alan,
> From: Alan Condit [mailto:condit.a...@gmail.com]
> I built a new controller for my 9x20 lathe using a 5i25/7i76 combo. I thought 
> I had everything working but I still can�t get the spindle
> working correctly.
> I have a 1.5hp PMDC treadmill motor that I am controlling with a 
> Cycletrol-150 DC controller. The am using the analog out from the
> 7i76 to replace the potentiometer to control the spindle speed. I have a 100 
> slot encoder with index (homemade) on the spindle.

This is what I found for a Cycletrol DC motor controller.
http://www.grahammotorandcontrols.com/item_dc_motor_controller/176B6002/58


There is no guarantee that a PWM output will emulate a potentiometer.  That's 
the first place to look
First put the pot back and measure the voltage between the wiper and ground as 
you control the speed from 0 to full RPM open loop.  And depending on how it's 
powered be careful that the pot inputs aren't indirectly connected to ground.

It's always possible the speed control won't work unless there is also 5K Ohm 
between pin 9 and 11.

It's also possible the pot changes the resistance (as a rheostat) in a feedback 
circuit so input PWM may or may not work.  

Also PWM is exactly that pulse width.  Unless you have a filter capacitor 
across that with a bleeder resistor to ground (Pin 11) the internal circuit 
many not integrate the PWM enough for it to work.  

For example I bought a small Chinese PWM to 0-10V module that has the rule that 
the PWM frequency can't be higher than 1kHz.  Try it with 10kHz and it won't 
create a lower voltage.  So PWM frequency is a parameter that must be correct.

I also, way back, bought a step/dir to 0-10V controller that produced 10V at 
25kHz step rate.  The problem was my ELS was limited to 20kHz so I never could 
get 10V out of it.

I don't believe your 100 PPR encoder is the issue.  I'm running my spindle with 
60 PPR and can do power tapping on the mill.  

It may still be possible to find these UHU or HP_UHU kits somewhere.  I ended 
up using them because the GECKO servo drives I bought were only good to 80V and 
my servo motors like more than 90V.  The HP_UHU kit was good to over 200VDC.
https://www.cnczone.com/forums/servo-motors-drives/342836-uhu-servo-controller-build.html


Similarly there are still some STMBL kits out there.  These can actually take 
the smart serial input from the MESA boards or step/dir.  I'm not sure that 
0-10V was very implemented.
https://www.pcbway.com/project/shareproject/stmbl_servo_motor_drive.html

John


> 
> The spindle starts under LCNC control but I am not getting an �at speed 
> indication� at above about 100rpm. The motor sounds like is
> is running at a steady speed but the Spindle Speed indicator fluctuates 
> wildly. I am suspicious of the spindle encoder. Before I was
> just running it as a 100 count counter with index and it worked fine. I can�t 
> figure out in PNCConf how to set up a spindle counter
> with index for the 7i76.
> 
> Questions:
> Is it likely that my encoder is the problem?
> I don�t know how to adjust the detectors to be out of cycle by 90�? Any 
> helpful hints?
> Should I just go back to the 100 slot counter?
> Should I replace my whole homemade encoder with a real commercial spindle 
> encoder?
> 
> Sent from my iPad
> 
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users



___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] Spindle setup for 5i25/7i76

2021-09-12 Thread Alan Condit

I built a new controller for my 9x20 lathe using a 5i25/7i76 combo. I thought I 
had everything working but I still can’t get the spindle working correctly.
I have a 1.5hp PMDC treadmill motor that I am controlling with a Cycletrol-150 
DC controller. The am using the analog out from the 7i76 to replace the 
potentiometer to control the spindle speed. I have a 100 slot encoder with 
index (homemade) on the spindle.

The spindle starts under LCNC control but I am not getting an “at speed 
indication” at above about 100rpm. The motor sounds like is is running at a 
steady speed but the Spindle Speed indicator fluctuates wildly. I am suspicious 
of the spindle encoder. Before I was just running it as a 100 count counter 
with index and it worked fine. I can’t figure out in PNCConf how to set up a 
spindle counter with index for the 7i76.

Questions: 
Is it likely that my encoder is the problem? 
I don’t know how to adjust the detectors to be out of cycle by 90°? Any helpful 
hints?
Should I just go back to the 100 slot counter?
Should I replace my whole homemade encoder with a real commercial spindle 
encoder?

Sent from my iPad

___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users