7c80 install on rpi 4

More
5 years 3 months ago #216131 by PCW
Replied by PCW on topic 7c80 install on rpi 4
Spindle analog is controlled by PWMgen 0
The isolated outputs are SSRs (same hal names as 7I96)
Spindle ENA/FWD is GPIO20, Spindle DIR/REV is GPIO21
Both active low.

halcmd show pin hm2 will show all the hardware pins
halcmd show param hm2 will show all the hardware parameters

Please Log in or Create an account to join the conversation.

More
5 years 3 months ago #216136 by Borsti
Replied by Borsti on topic 7c80 install on rpi 4
Thanks for the quick replay - I will check and post later as I have some other task open from my day job ;)

Please Log in or Create an account to join the conversation.

More
5 years 3 months ago #216243 by jimhurlburt
Replied by jimhurlburt on topic 7c80 install on rpi 4
Sir:
Sorry for the delay, I saw the post, wasn't convenient to deal with it right then, then forgot later

Attached are my HAL and ini files.  The ini file is specific to my hardware, but may give you something useful to work with.  The hal file is what I am using to run my machine.  At the moment I don't have a controlable spindle, but the movement works well.

I do have two parallel steppers running the y axis, so you may need to adjust that bit.

If you have questions I will try to take note and monitor this thread for a few days.

Jim
Attachments:
The following user(s) said Thank You: rdtsc

Please Log in or Create an account to join the conversation.

More
5 years 3 months ago - 4 years 9 months ago #216247 by PCW
Replied by PCW on topic 7c80 install on rpi 4
This should be close to a working spindle section of a 7C80 hal file:


#*******************
#  SPINDLE
#*******************

setp   pid.s.Pgain     [SPINDLE_0]P
setp   pid.s.Igain     [SPINDLE_0]I
setp   pid.s.Dgain     [SPINDLE_0]D
setp   pid.s.bias      [SPINDLE_0]BIAS
setp   pid.s.FF0       [SPINDLE_0]FF0
setp   pid.s.FF1       [SPINDLE_0]FF1
setp   pid.s.FF2       [SPINDLE_0]FF2
setp   pid.s.deadband  [SPINDLE_0]DEADBAND
setp   pid.s.maxoutput [SPINDLE_0]MAX_OUTPUT
setp   pid.s.error-previous-target true

net spindle-index-enable  <=> pid.s.index-enable
net spindle-enable        =>  pid.s.enable
net spindle-vel-cmd-rpm-abs     => pid.s.command
net spindle-vel-fb-rpm      => pid.s.feedback
net spindle-output        <=  pid.s.output

# ---PWM Generator signals/setup---

setp   [HMOT](CARD0).pwmgen.00.output-type 1
setp   [HMOT](CARD0).pwmgen.00.scale  [SPINDLE_0]OUTPUT_SCALE
setp   [HMOT](CARD0).pwmgen.pwm_frequency 5000
setp   [HMOT](CARD0).pwmgen.00.out0.invert_output true

# --- Setup 7C80 GPIO bits for FWD/REV spindle control
setp [HMOT](CARD0).gpio.020.invert_output true
setp [HMOT](CARD0).gpio.020.is_output true
setp [HMOT](CARD0).gpio.021.invert_output true
setp [HMOT](CARD0).gpio.021.is_output true

net spindle-cw  => [HMOT](CARD0).gpio.020.out
net spindle-ccw => [HMOT](CARD0).gpio.021.out

net spindle-output      => [HMOT](CARD0).pwmgen.00.value
net spindle-enable      => [HMOT](CARD0).pwmgen.00.enable

# ---Encoder feedback signals/setup---

setp    [HMOT](CARD0).encoder.00.counter-mode 0
setp    [HMOT](CARD0).encoder.00.filter 1
setp    [HMOT](CARD0).encoder.00.index-invert 0
setp    [HMOT](CARD0).encoder.00.index-mask 0
setp    [HMOT](CARD0).encoder.00.index-mask-invert 0
setp    [HMOT](CARD0).encoder.00.scale  [SPINDLE_0]ENCODER_SCALE

net spindle-revs             <=   [HMOT](CARD0).encoder.00.position
net spindle-vel-fb-rps       <=   [HMOT](CARD0).encoder.00.velocity
net spindle-vel-fb-rpm       <=   [HMOT](CARD0).encoder.00.velocity-rpm
net spindle-index-enable     <=>  [HMOT](CARD0).encoder.00.index-enable

# ---setup spindle control signals---

net spindle-vel-cmd-rps        <=  spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs    <=  spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm        <=  spindle.0.speed-out
net spindle-vel-cmd-rpm-abs    <=  spindle.0.speed-out-abs
net spindle-enable             <=  spindle.0.on
net spindle-cw                 <=  spindle.0.forward
net spindle-ccw                <=  spindle.0.reverse
net spindle-brake              <=  spindle.0.brake
net spindle-revs               =>  spindle.0.revs
net spindle-at-speed           =>  spindle.0.at-speed
net spindle-vel-fb-rps         =>  spindle.0.speed-in
net spindle-index-enable      <=>  spindle.0.index-enable

# ---Setup spindle at speed signals---

sets spindle-at-speed true

**********************************************************************************

And the INI file spindle boilerplate:

[SPINDLE_0]
P = 0.0
I = 0.0
D = 0.0
FF0 = 1.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 2000.0
ENCODER_SCALE = 1024.0
OUTPUT_SCALE = 2000
OUTPUT_MIN_LIMIT = -2000
OUTPUT_MAX_LIMIT = 2000

 
Last edit: 4 years 9 months ago by PCW. Reason: missing PWM setup parameters and ABS for spindle speed
The following user(s) said Thank You: andypugh, rdtsc

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #217698 by Borsti
Replied by Borsti on topic 7c80 install on rpi 4
Hi there   !!!

Thanks a lot for the many valuable replays and finally after some days of testing my machine is homing !!!!!
Well, I need now to make sure the spindle runs and the E-Stops working etc..
I still would need some hint in regards to the outputs

# --- MACHINE-IS-ENABLED ---
net machine-is-enabled  =>   hm2_7c80.0.led.CR01 => hm2_7c80.0.gpio.012.out

This one is switching the LED and in HAL-Monitor as well the output but physically I don't have anything in Output 0

... or I just lost myself ?

Thanks for some hints!
 

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #217699 by PCW
Replied by PCW on topic 7c80 install on rpi 4
The outputs on the 7C80 are SSRs:

net machine-is-enabled => hm2_7c80.0.ssr.00.out-00

gpio12 is a sserial expansion port on a 7C80
Do not set it to output mode or you will create a bus
conflict

Please Log in or Create an account to join the conversation.

Moderators: PCW, jmelson
Time to create page: 0.660 seconds
Powered by Kunena Forum