ESC Brushless MESA PWM 6i25+7i76

07 Apr 2016 15:48 #72919 by alessandro torre
I used an RC Brushless motor via ESC like a spindle.
I controlled it before via software PWM generation connected directly to the parallel port output with the following configuration:
#net 	pwmgen.2.pwm   			=>
setp pwmgen.2.enable    1
setp pwmgen.2.value     10.0
setp pwmgen.2.scale     100
setp pwmgen.2.pwm-freq  100
setp pwmgen.2.min-dc    0
setp pwmgen.2.max-dc    1

setp hm2_7i80.0.pwmgen.00.enable 1
setp hm2_7i80.0.pwmgen.pwm_frequency 1000
setp hm2_7i80.0.pwmgen.00.scale 100
setp hm2_7i80.0.pwmgen.00.value 10

#net spindle-speed-cmd 	motion.spindle-speed-out 	=> 		pwmgen.2.value

# Set the spindle's top speed in RPM

#setp pwmgen.2.max-dc 0.2
#setp pwmgen.2.min-dc 0.1
setp scale.0.offset  10
setp scale.0.gain    0.166666666
net spindle-speed-scale     motion.spindle-speed-out  	=>
net spindle-speed-cmd       scale.0.out               	=> 		pwmgen.2.value
#net spindle-on 			motion.spindle-on 			=> 		pwmgen.2.enable
net spindle-pwm 			pwmgen.2.pwm 				=>

The variation of the pin "pwmgen.2.value" from 10 to 20, moved the spindle from 0 to 12.000 rpm.

Now, to increase the performance, i'm using a new motherboard ( "ASROCK N3700-ITX" ) that doesn't have the parallel port and I'm using the Mesa 6i25+7i76 boards.
I'm trying to get thinks to work like before simply doing this change

net spindle-pwm pwmgen.2.pwm => hm2_5i25.0.7i76.0.0.output-02
instead of:
net spindle-pwm pwmgen.2.pwm =>

But It didn't work. The ESC ( DETRUM 80A) recognize the variation of the duty cycle, but it doesn't start.

I don't have a real scope to analyze the signal.
Do you have any ideas about this issue and how can i solve? It can be a thread problem or EMI issue?
Can I use the the analogue output 7i76.0.0.spinout pin to generate the PWM?

Thank you in advance

In attachment my test .ini .hal files
07 Apr 2016 17:09 #72922 by PCW
You cannot do fast PWM from the 7I76 digital outputs
because you are limited to servo thread update rates

If you want high resolution PWM you would need a
7I80DB configuration that has a PWM output, perhaps
stealing one of the 7I76's step or direction outputs if one is free
07 Apr 2016 20:54 - 07 Apr 2016 22:58 #72931 by alessandro torre
Thank You Patrick.
In my case i don't have free step or dir pins on the 7i76. In your opinion, can I use a breakout board ( perhaps 7i75 ) on the P2 of the 6i25 ( or a direct Pin on P2 ) used for the 6th step or dir pin? There is a bitfile that mix a 7i76+ a standard breakout?
If yes, do you know how can I set the stepgeneration pulse frequency to 100 Hz and a duty cycle of it from 10% to 20%?

Thank you in advance
Last Edit: 07 Apr 2016 22:58 by alessandro torre.
07 Apr 2016 23:05 #72937 by PCW
You can use a different connector, but you need firmware configuration has has a
PWM generator on that pin (not a stepgen)

to get 100 hz you set the PWM frequency to 100, to get 1-2 ms for 0 to full speed, you
will need the scale component to offset and scale the commanded RPM to the required
10% to 20% duty cycle PWM range
08 Apr 2016 07:22 #72944 by alessandro torre
How can I configure the firmware to use the 6i25 p3 for 7i76 and 6i25 p2 like a standard parport ?
There is yet a firware that supports this configuration about 6i25?
If yes, I didn't recognise the name inside the folder. Now I flashed 5i25_7i76x2.bit

Thanks for the support.
08 Apr 2016 12:24 #72955 by andypugh
The 7i76 has a spindle control output in the form of a digital potentiometer.

I would suggest taking one of these apart: and wiring the 7i76 speed-pot output in place of the physical potentiometer.
08 Apr 2016 14:54 #72963 by PCW
If you want to use software PWM. You can use almost any pin as GPIO input or output
GPIO outputs must be set to output mode in the hal file (This is true for all configurations)

man hostmot2 (GPIO section) for details

You will get better PWM resolution with the hardware PWM generator however
09 Apr 2016 10:16 #72994 by alessandro torre
Thanks for the suggestions. I used the spindle analogue output of the 7i76 like a potentiometer of the "servo tester", as Andy suggested and it works very well. I didn't know the existence of this cheap device.

Thank you
07 Mar 2017 21:17 #89170 by HalaszAttila

can You tell me please, how can I use 7i76s step or dir output as PWM output?
For my project i want to use about 1-2kHz pw, that is very high speed for digital outputs.

07 Mar 2017 22:04 #89174 by PCW
Yes, for example the 5i25_7i76p_7I85.bit config replaces all the 7I76 step/dir outputs with PWM/Dir outputs
if you only wanted 1 or a couple PWM outputs (retaining most of the stepgens) that would require a custom bitfile

If you wanted a mix of stepgens and PWMgens, you could try the to see if the PWM works for you
and then either build or ask me to build a custom 5I25_7I76 bitfile
Time to create page: 0.156 seconds
Powered by Kunena Forum