Optimum Lathe with 7i76 and 8i20
I have a retrofit from a conventional lathe into a cnc lathe.
I use a Mesa 5i25 with a 7i76 and a 8i20. The steppermotors for x and z-axis are driven by two leadshine amps.
These are working. The problem is to configure the 8i20. I have the following hardware configuration :
encoder without index and a bldc-motor without hallsensors.
I read in the man bldc that it is possible to align the rotor without index or external sensor.
at first i tried with pncconf and openloop to spin the shaft of the motor - but nothing happens eccept of a long list of errors (pncconf works not so fine or iam to stupid for)
I removed the pins in the hal (hall etc) but all what i got is that the 8i20 gives current on one coil of the motor.
I put a high signal on the pin bldc.0.init to finish the align process....
Has anyone set up a system with a configuration like mine?
Has anyone a idea how i can setup the system to run in openloop? (just for the first)
basti
Please Log in or Create an account to join the conversation.
Pncconf will not be of any help with that. Basically you must setup the proper BLDC
parameters and net the proper signals in HAL to get commutation working.
Once commutation is working (you can spin the motor) than you hook up the motor PID
connections.
Do you know the encoder and motor specifications?
Please Log in or Create an account to join the conversation.
The motor has 2200W and when one of the coils is under current i can feel three "peaks" i dont find a word for it...
I will set up a simple configuration with encoder and bldc modules - then i link the pins like rawcounts etc from encoder to bldc ... hope i can manage it today
With the old configuratio i was able to monitor the HV-Bus voltage of the 8i20 so i think that the communication works. (but not the commutation)
Please Log in or Create an account to join the conversation.
encoder without index and a bldc-motor without hallsensors.
How was the motor originally commutated? It is quite unusual to have a brushless motor with no commutation source at all.
Having said that, as long as the motor is free to rotate when the machine is enabled then it should be possible to home your motor "magnetically".
You need to configure the "bldc" component in "q" mode.
To simplify testing I would start off in a halcmd session and just try to get the motor spinning (assuming this is a spindle motor and it can spin indefinitely).
Note that the 8i20 needs the hardware enable contacts to be set in order to work. These should probably be controlled by GPIO in some way.
NB! I am typing this from memory, any and all HAL pin names might be wrong, please correct pin-names as necessary
halrun
loadrt hostmot2
loadrt hm2_pci
show pin
show pin *8i20*
loadrt threads
addf hm2_5i25.0.read thread1
addf hm2_5i25.0.write thread1
start
This is a good time to check your encoder:
loadusr -s halmeter pin hm2_5i25.0.encoder.00.counts
setp hm2_5i25.0.encoder.00.reset 1
setp hm2_5i25.0.encoder.00.reset 0
Now load bldc and make a few connections.
loadrt bldc config="q"
addf bldc.0 thread1
net commutation-counts hm2_5i25.0.encoder.00.rawcounts bldc.0.rawcounts
net rotor-angle-out bldc.0.rotor-angle hm2_5i25.0.8i20.0.1.angle
net motor-current-cmd bldc.0.out hm2_5i25.0.8i20.0.1.current
setp bldc.0.poles 3
setp bldc.0.scale 2000
setp bldc.0.init-value 0.1
[code]
You should now be ready to init the motor. Note that once the above has been checked you can put it in a file called something like "test.hal" and use "source test.hal" to save typing next time you test the system. You will then need to add the working parts to one of your HAL files, though in the actual HAL file you would not use "loadrt threads" or "start" as that is handled by the LinuxCNC start-upp scripts.
To initialise the motor use [code]setp bldc.0.init 1
show pin bldc.0.init-done
You should now be able to spin the motor:
setp bldc.0.value 0.1
setp bldc.0.value -1
If the motor turns for a fraction and then locks up then this probably indicates a mis-match between encoder direction and motor direction.
setp hm2_5i25.0.encoder.00.scale -2000
A warning: don't leave the current at a high value with the motor not spinning or damage may occur.
The points to note are that 8i20 current commands need to be sourced from the bldc component (and the bldc component needs to be the reciever of the PID or spindle command values). bldc also needs encoder raw counts and the init pin needs to be toggled before the motor will try to run. Often the init pin will be connected to a machine-is-on HAL pin or the axis-enable.
Please Log in or Create an account to join the conversation.
At the moment the 8i20 logic is powered over the bus cable and the HV-Bus has 65V DC (just for testing at the beginning later i go up to 300V)
I enable the hardware over a gpio (this works without problems)
after testing in a halcmd session (thats much cooler than in emc because of auto-type thanks for this)
I put the lines in my HAL-file.
After switching the machine on, the alignment starts. but when i start the spindle and increase speed, then increases current but nothing rotates (also in the halcmd session)
I think there is a missunderstood because i thought that the pin bldc.0.value is for the speed of the motorshaft (man page said: bldc.N.value PWM master amplitude input)
maybe i have to give a other type of signal to the bldc.0.value pin .... like a sinewave ?
I tried different values for the encoder and motorpoles but no rotation (exccept of the alignment).
Please Log in or Create an account to join the conversation.
after testing in a halcmd session (thats much cooler than in emc because of auto-type thanks for this)
I put the lines in my HAL-file.
Did the motor spin when testing?
[/quote]After switching the machine on, the alignment starts. but when i start the spindle and increase speed, then increases current but nothing rotates (also in the halcmd session)[/quote]
The whole point of the halcmd session was to make sure that everything was right...
If the motor locks up rather than spinning that _generally) means that the encoder scale needs to be negative. It could also mean that the pole count is wrong.
It is rather easy in the halcmd session to just keep trying setp bldc.poles 6 , setp bldc.scale -2000 and so-on until the motor spins.
Thinking about is bldc.0.poles should _not_ be 3. It should always be an even number, and is only really likely to be 4 or 6, but you might as well try 2 and 8 too.
Please Log in or Create an account to join the conversation.
When i increased the value of bldc.0.value
It feels like the motor has more tourque (i tried to rotate the shaft with my hand)
The bldc.0.poles are similar to the motorpoles of a asynchronus machine ?
I think that makes sense.....
I tried different values ( 3,6,9 ) for bldc.0.poles and invertet the encoderscale.
Then i thought that i have the wrong input for bldc.0.value.
Please Log in or Create an account to join the conversation.
I tried different values ( 3,6,9 ) for bldc.0.poles and invertet the encoderscale.
Then i thought that i have the wrong input for bldc.0.value.
If the alignment worked (and it might not have, you may need more init-value to get a good lock) then the motor should start to spin for a constant value of bldc.0.value once all the parameters are correct.
You might need to exit and re-start bldc to re-init between settings, though. (but I think it ought to work without)
Please Log in or Create an account to join the conversation.
I dont know why but the only way to let the motor spin is to use the bldc.1.frequency input ....(i wasted lots of hours)
maybe the alignment is the problem but nothing changed when i increased the init value (but for very small values - the motor`s tourque was to low to align)
the spindle wont work very well so i decided to repair the Hall-Sensors....(maybe its easier to get the system in a running stadium)
but now i have another problem these guys work with 5V and the 7i76 needs at least 8V for high level.....
is there a special trick or do i need optocoulers to lift the signal to use the Hall sensors (5V) with the Mesa 7i76?
Its not possible to use the second DB25 from the 5i25 because it is reserved for a another project.
Please Log in or Create an account to join the conversation.
I dont know why but the only way to let the motor spin is to use the bldc.1.frequency input ....(i wasted lots of hours)
Brushless motors can be a great source of entertainment, especially if you don't know all the relevant parameters.
If magnetic homing won't work you could try homing to the encoder index. That is likely to need some trial-and-error setting of the encoder index offset.
the spindle wont work very well so i decided to repair the Hall-Sensors
Hall sensors are the most reliable option, but it would be a shame to go to all the trouble and still not be able to get the motor to run.
Does the encoder count properly when using the "frequency" input mode? Does the number of encoder counts for a full revolution of the motor shaft match the scale in the HAL file?
The 7i76 inputs need 50% of whatever the field-IO power is. If you are using more than 10V field power then you are right that the Hall sensor output might not be enough.but now i have another problem these guys work with 5V and the 7i76 needs at least 8V for high level.
One option might be to set software data process mode 1 on the 7i76 and to measure the Hall sensor input as an analogue input, then convert to logic-level in HAL using the "comp" comparator function.
Please Log in or Create an account to join the conversation.