so i set the pin modes and it looks fine, i got a eQEP encoder setting but 
i dont see where the A and B pins are written (maybe the pins are these 
written in red?)
and if so, should they look like this?: eQEP0A_in and eQEP0B_in

also where exactly go pin A (P9.92) and B (P9.27) on the cramps board 
(physical pins)?
_______________________________________________

loadrt hal_arm335xQEP encoders="eQEP0" 

loadrt sum2     names=pid-correction 
loadrt abs      names=abs-speed 
loadrt scale    names=spindle-rps2rpm 
loadrt lowpass  names=spindle-rpm-filter 
loadrt near     names=spindle-at-speed-detect 
loadrt pid      names=speed-pid 
loadrt limit1   names=pid-limit 


# ################################################ 
# THREADS 
# ################################################ 

addf hpg.capture-position     servo-thread 
addf eqep.update                            servo-thread 
addf bb_gpio.read                           servo-thread 
addf motion-command-handler                 servo-thread 
addf motion-controller                      servo-thread 
addf hpg.update               servo-thread 
addf bb_gpio.write                          servo-thread 

addf pid-correction                         servo-thread 
addf abs-speed                              servo-thread 
addf spindle-rps2rpm                        servo-thread 
addf spindle-rpm-filter                     servo-thread 
addf spindle-at-speed-detect                servo-thread 
addf speed-pid.do-pid-calcs                 servo-thread         
addf pid-limit                              servo-thread         


# ################ 
# Spindle 
# ################ 
net spindle-at-speed motion.spindle-at-speed <= spindle-at-speed-detect.out 
setp spindle-at-speed-detect.scale 1.2 

setp speed-pid.Pgain 1
setp speed-pid.Igain 0 
setp speed-pid.Dgain 0 
setp speed-pid.maxoutput 8160 
setp speed-pid.deadband 5 

# Spindle runs around 90 RPM faster than the commanded speed 
setp pid-correction.offset 0 

setp hpg.pwmgen.00.pwm_period       1000000 
setp hpg.pwmgen.00.out.00.scale         8160 
setp hpg.pwmgen.00.out.00.pin       929 
setp hpg.pwmgen.00.out.00.enable    1 
setp hpg.pwmgen.00.out.00.value     0.0 

# Stop pid output going negative 
setp pid-limit.min 0 


# Scale RPS to RPM 
setp spindle-rps2rpm.gain 60 

# Filter RPM for the display 
setp spindle-rpm-filter.gain 0.01 

# Attach motion.spindle on to enable PID, PWM is always enabled due to a 
bug that 
# causes it to output at 100% when disabled! 
net spindle_enable motion.spindle-on => speed-pid.enable 


# Setup encoder (90 slot quad = 360) 
setp eQEP0.position-scale 400 
net spindle_rev_count    eQEP0.position     =>  motion.spindle-revs 
motion.analog-in-01 
net spindle_raw_velocity eQEP0.velocity     =>  spindle-rps2rpm.in => 
motion.spindle-speed-in motion.analog-in-00 
net spindle_index_enable eQEP0.index-enable <=> motion.spindle-index-enable 
#the 
name says index, i guess i dont need that or is it something else i need?

# Attach the pid to scale, motion and sum 

net pid_feedback speed-pid.feedback <= spindle-rps2rpm.out => 
spindle-at-speed-detect.in2 => spindle-rpm-filter.in 
net pid_command  speed-pid.command  <= motion.spindle-speed-out => 
spindle-at-speed-detect.in1 => pid-correction.in0 
net pid_output   speed-pid.output   => pid-limit.in 
net pid_output_ltd pid-limit.out => pid-correction.in1 

net pwmgen_value abs-speed.in <= pid-correction.out 

net pwmgen_value-abs abs-speed.out => hpg.pwmgen.00.out.00.value 

# For display in pyvcp 
net smoothed_rpm spindle-rpm-filter.out  


Am Samstag, 24. September 2016 23:11:10 UTC+2 schrieb Charles Steinkuehler:
>
> On 9/24/2016 2:45 PM, Sag ich Dir nich wrote: 
> > to set a pin to input mode i have to add "942" to the hal file under 
> "loadrt" 
> > like so: 
> > 
> > # load low-level drivers 
> > loadrt hal_bb_gpio output_pins=816,822,823,824,825,826,914,923,925 
> > input_pins=807,808,809,810,817,911,913,942 
>
> That is not where you need to make the change.  You only need to add 
> the pin to the hal_bb_gpio driver if you need to use it as a GPIO pin 
> in HAL. 
>
> You need to use the config-pin utility (typically in the setup.sh 
> script) to set the pinmux modes.  Note that the .1 notation doesn't 
> work, so 50 is added to the pin value (ie: instead of 942 and 942.1, 
> you get 942 and 992). 
>
> Just run: 
>
> config-pin 942 input 
> config-pin 992 qep 
>
>
> You can see what modes are available for each pin with the -l switch: 
>
> $ config-pin -l p992 
> default gpio gpio_pu gpio_pd qep pruout pruin 
>
> ...and query the current state with -q: 
>
> $ config-pin -q p992 
> P9_92 Mode: gpio Direction: in Value: 0 
>
> -- 
> Charles Steinkuehler 
> [email protected] <javascript:> 
>

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to