Driving a charge pump with a Mesa 5i25 stepgen
- PortlandGTS
- Offline
- Junior Member
Less
More
- Posts: 24
- Thank you received: 1
03 Jul 2021 06:05 #213537
by PortlandGTS
Driving a charge pump with a Mesa 5i25 stepgen was created by PortlandGTS
I have a Mesa 5i25 with 2xG540 firmware, connected to a G540 and a 7i75 break out board.
Following the thread mesa-7i96-and-gecko-g540 , I'm trying to get a HW stepgen to drive an external charge pump. The following code isn't working: (Charge pump connected to the IO02 terminal on the 7i75)
setp [HMOT](CARD0).stepgen.05.control-type 1 # velocity mode
setp [HMOT](CARD0).stepgen.05.velocity-cmd 10000 # 10kHz
setp [HMOT](CARD0).stepgen.05.step_type 2 # Quadrature for square wave
setp [HMOT](CARD0).stepgen.05.steplen 100
setp [HMOT](CARD0).stepgen.05.stepspace 100
setp [HMOT](CARD0).stepgen.05.enable 1
Any suggestions on what I'm doing wrong? I don't have a scope, so I can't see what kind of signal it's generating.
I'm able to drive the charge pump with a HW PWM generator, but I want to free up the PWM for spindle VFD. Here's the code I have been using (Charge pump is on IO01 on the 7i75)
setp [HMOT](CARD0).pwmgen.pwm_frequency 10000
setp [HMOT](CARD0).pwmgen.01.output-type 1
setp [HMOT](CARD0).pwmgen.01.value 0.5 #Square Wave
setp [HMOT](CARD0).pwmgen.01.enable 1
Thanks,
Tom
Following the thread mesa-7i96-and-gecko-g540 , I'm trying to get a HW stepgen to drive an external charge pump. The following code isn't working: (Charge pump connected to the IO02 terminal on the 7i75)
setp [HMOT](CARD0).stepgen.05.control-type 1 # velocity mode
setp [HMOT](CARD0).stepgen.05.velocity-cmd 10000 # 10kHz
setp [HMOT](CARD0).stepgen.05.step_type 2 # Quadrature for square wave
setp [HMOT](CARD0).stepgen.05.steplen 100
setp [HMOT](CARD0).stepgen.05.stepspace 100
setp [HMOT](CARD0).stepgen.05.enable 1
Any suggestions on what I'm doing wrong? I don't have a scope, so I can't see what kind of signal it's generating.
I'm able to drive the charge pump with a HW PWM generator, but I want to free up the PWM for spindle VFD. Here's the code I have been using (Charge pump is on IO01 on the 7i75)
setp [HMOT](CARD0).pwmgen.pwm_frequency 10000
setp [HMOT](CARD0).pwmgen.01.output-type 1
setp [HMOT](CARD0).pwmgen.01.value 0.5 #Square Wave
setp [HMOT](CARD0).pwmgen.01.enable 1
Thanks,
Tom
Please Log in or Create an account to join the conversation.
03 Jul 2021 08:58 #213542
by phillc54
Replied by phillc54 on topic Driving a charge pump with a Mesa 5i25 stepgen
This is what I have foa a G540 from a 7i96:
# ---Chargepump StepGen: 0.25 velocity = 10Khz square wave output---
setp hm2_7i96.0.stepgen.04.dirsetup 100
setp hm2_7i96.0.stepgen.04.dirhold 100
setp hm2_7i96.0.stepgen.04.steplen 100
setp hm2_7i96.0.stepgen.04.stepspace 100
setp hm2_7i96.0.stepgen.04.position-scale 10000
setp hm2_7i96.0.stepgen.04.step_type 2
setp hm2_7i96.0.stepgen.04.control-type 1
setp hm2_7i96.0.stepgen.04.maxaccel 0
setp hm2_7i96.0.stepgen.04.maxvel 0
setp hm2_7i96.0.stepgen.04.velocity-cmd 0.25
net x-enable => hm2_7i96.0.stepgen.04.enable
Please Log in or Create an account to join the conversation.
- PortlandGTS
- Offline
- Junior Member
Less
More
- Posts: 24
- Thank you received: 1
05 Jul 2021 05:33 #213744
by PortlandGTS
Replied by PortlandGTS on topic Driving a charge pump with a Mesa 5i25 stepgen
Thanks - By looking at your code, I was able to get it to work.
I tested each difference between your code and mine separately. The only change that got my charge pump to work was setting maxaccel to zero.
Strange, because maxaccel is supposed to have no effect when set to zero,
Regards,
Tom
I tested each difference between your code and mine separately. The only change that got my charge pump to work was setting maxaccel to zero.
Strange, because maxaccel is supposed to have no effect when set to zero,
Regards,
Tom
Please Log in or Create an account to join the conversation.
05 Jul 2021 15:04 - 05 Jul 2021 15:04 #213767
by PCW
Replied by PCW on topic Driving a charge pump with a Mesa 5i25 stepgen
If you set maxaccel to 0 there is no bound on the rate of change of velocity
(frequency), but if you don't set it, it is set to 1 machine unit per second^2
which will ramp the velocity (from 0) very slowly, so the charge pump
would _eventually_ work (in about 20 minutes at 1 Hz per second...)
(frequency), but if you don't set it, it is set to 1 machine unit per second^2
which will ramp the velocity (from 0) very slowly, so the charge pump
would _eventually_ work (in about 20 minutes at 1 Hz per second...)
Last edit: 05 Jul 2021 15:04 by PCW.
Please Log in or Create an account to join the conversation.
- PortlandGTS
- Offline
- Junior Member
Less
More
- Posts: 24
- Thank you received: 1
05 Jul 2021 18:04 #213771
by PortlandGTS
Replied by PortlandGTS on topic Driving a charge pump with a Mesa 5i25 stepgen
I thought something like that might be going on. Guess i just didn't wait long enough!
Please Log in or Create an account to join the conversation.
06 Feb 2022 16:10 #234118
by dbotos
Replied by dbotos on topic Driving a charge pump with a Mesa 5i25 stepgen
I'm having a similar issue, so I figured I'd continue this thread rather than creating a new one. I have a 5i25 directly to a G540 and the latter doesn't seem to be getting the charge pump signal (physical e-stop released, e-stop released in LinuxCNC, and machine power toggled on in LinuxCNC). The red FAULT light on the G540 stays illuminated.
Attached are my INI and HAL files for 2.8.2. I'm assuming something is missing / incorrect in the HAL file, since that's where the charge pump setup is. 5i25 is using the G540x2 firmware.
Thanks,
David
Attached are my INI and HAL files for 2.8.2. I'm assuming something is missing / incorrect in the HAL file, since that's where the charge pump setup is. 5i25 is using the G540x2 firmware.
Thanks,
David
Please Log in or Create an account to join the conversation.
06 Feb 2022 17:28 #234128
by PCW
Replied by PCW on topic Driving a charge pump with a Mesa 5i25 stepgen
setp [HMOT](CARD0).stepgen.04.position-scale 10000
setp [HMOT](CARD0).stepgen.04.step_type 2
setp [HMOT](CARD0).stepgen.04.control-type 1
setp [HMOT](CARD0).stepgen.04.maxaccel 0
setp [HMOT](CARD0).stepgen.04.maxvel 0
setp [HMOT](CARD0).stepgen.04.velocity-cmd 0.25
This will generate a 2500 Hz square wave, not 10 KHz
For clarity, I would probable set
setp [HMOT](CARD0).stepgen.04.position-scale 1
setp [HMOT](CARD0).stepgen.04.velocity-cmd 10000
for a 10 KHz chargepump signal
setp [HMOT](CARD0).stepgen.04.step_type 2
setp [HMOT](CARD0).stepgen.04.control-type 1
setp [HMOT](CARD0).stepgen.04.maxaccel 0
setp [HMOT](CARD0).stepgen.04.maxvel 0
setp [HMOT](CARD0).stepgen.04.velocity-cmd 0.25
This will generate a 2500 Hz square wave, not 10 KHz
For clarity, I would probable set
setp [HMOT](CARD0).stepgen.04.position-scale 1
setp [HMOT](CARD0).stepgen.04.velocity-cmd 10000
for a 10 KHz chargepump signal
Please Log in or Create an account to join the conversation.
06 Feb 2022 19:32 #234157
by dbotos
Replied by dbotos on topic Driving a charge pump with a Mesa 5i25 stepgen
Peter,
Thanks. I changed those two values and no luck.
Do I need to add a line that adds the charge pump to the base thread? Section 14.10.2.9 of the 2.8.2 documentation says:
"The Charge Pump should be added to the base thread function."
Thanks. I changed those two values and no luck.
Do I need to add a line that adds the charge pump to the base thread? Section 14.10.2.9 of the 2.8.2 documentation says:
"The Charge Pump should be added to the base thread function."
Please Log in or Create an account to join the conversation.
06 Feb 2022 19:43 #234160
by PCW
Replied by PCW on topic Driving a charge pump with a Mesa 5i25 stepgen
No, the base thread is not needed for hardware stepgens
Please Log in or Create an account to join the conversation.
06 Feb 2022 21:12 #234174
by dbotos
Replied by dbotos on topic Driving a charge pump with a Mesa 5i25 stepgen
Let me see if I understand this correctly:
position-scale = (distance) / (# of steps)
Divide the numerator and denominator of the right side by unit time:
position-scale = (distance / s) / (# steps / s)
If position-scale = 1, then:
(distance / s) = (# steps / s)
So a velocity command (distance / s) should generate a waveform of step pulses with a frequency (in Hz) equal to the value of the velocity commanded.
Is the charge pump expecting a 50% duty cycle wave? Should the steplen and stepspace be bumped up to 50,000 ns each?
T = 50,000 ns + 50,000 ns = 100,000 ns
f = 1 / T = 1 / (0.000 100 000) = 10,000 Hz
position-scale = (distance) / (# of steps)
Divide the numerator and denominator of the right side by unit time:
position-scale = (distance / s) / (# steps / s)
If position-scale = 1, then:
(distance / s) = (# steps / s)
So a velocity command (distance / s) should generate a waveform of step pulses with a frequency (in Hz) equal to the value of the velocity commanded.
Is the charge pump expecting a 50% duty cycle wave? Should the steplen and stepspace be bumped up to 50,000 ns each?
T = 50,000 ns + 50,000 ns = 100,000 ns
f = 1 / T = 1 / (0.000 100 000) = 10,000 Hz
Please Log in or Create an account to join the conversation.
Time to create page: 0.136 seconds