Bafang BBS02: Terry Symmetry Shift Sensor & Cable Guides

The Bafang BBS02 came with (because I added it to the order) what looks like a genuine shift (“gear”) sensor made by the original company in the Czech Republic:

Terry Bafang - shift sensor - installed
Terry Bafang – shift sensor – installed

On a typical bike, it mounts against a cable stop with the cable housing holding it in place against its other end:

Tour Easy Bafang BBS02 - shift sensor - installed
Tour Easy Bafang BBS02 – shift sensor – installed

The Terry Symmetry has only two lengths of housing: in front of the adjuster on the downtube and behind the stop brazed to the chainstay. In either position, the sensor would move as the shift cable flexed and (IMO) put unreasonable stress on the electrical cable running to the motor.

Yes, the Tour Easy has those same two lengths of housing, but the forward one joins a sheaf of wires & cables that barely moves.

Fortunately, the sensor fits neatly between stations 1 and 2 along the downtube, with a snippet of PTFE lIned housing holding it firmly in place, with the 3D printed battery mounting blocks including paths for both cables:

Terry - Bafang battery - all stations - solid model
Terry – Bafang battery – all stations – solid model

The shift cable originally ran from the adjuster in the front to the guide under the bottom bracket along a slightly diagonal path I could not possibly match. Instead, the path is now parallel to the downtube from the front adjuster:

Terry Bafang - OEM shift stop
Terry Bafang – OEM shift stop

.. to the rear block, where it angles downward over the motor to the bottom bracket:

Terry Bafang - shift cable clearance
Terry Bafang – shift cable clearance

The front block at station 1 has a Delrin / acetal bushing to align the cable with the rest of the blocks:

Terry shift guide - acetal installed
Terry shift guide – acetal installed

Yes, it’s a round peg jammed in a hexagonal hole:

Terry shift guide - acetal hole
Terry shift guide – acetal hole

Turning it from stock is well within the capabilities of Tiny Lathe™:

Terry shift guide - acetal cutoff
Terry shift guide – acetal cutoff

For great slippery, a similar UHMW PE bushing supports the cable bend at the rear of the station 4 block:

Terry shift guide - UHMWPE installed
Terry shift guide – UHMWPE installed

The Basement Laboratory Warehouse Wing disgorged an overly large rod taxing Tiny Lathe™ to its limit:

Terry shift guide - UHMWPE turning
Terry shift guide – UHMWPE turning

Memo to Self: next time, just saw off a stub and move on.

Bafang BBS02: Motor Reaction Spacer

The Terry Symmetry’s rear shift cable passes along the side of the downtube and through a plastic guide channel under the bottom bracket shell. The Bafang BBS02 motor must press against the bottom of the downtube, so the shift cable rubs against the top of the motor.

The solution is a small block shaped around the point of contact to cradle the downtube, the bottom bracket shell lug, and the motor case:

Terry - Bafang motor spacer - solid model
Terry – Bafang motor spacer – solid model

A strip of double-sided foam tape holds the block to the motor and the reaction force from the motor’s torque presses the block against the downtube:

Terry Bafang - motor reaction block
Terry Bafang – motor reaction block

Seen from the other side, looking parallel to the shift cable, you can see the tight clearance:

Terry Bafang - shift cable clearance
Terry Bafang – shift cable clearance

The block holds the motor 8 mm from the downtube, just enough to give the cable some breathing room.

The block is slightly taller on its front end, because the motor doesn’t meet the downtube at a right angle:

Terry - Bafang motor spacer - tube angle - solid model
Terry – Bafang motor spacer – tube angle – solid model

I determined the proper angle by taping waxed paper to the top of the motor, sticking a trial (non-angled) block to the downtube, coating its bottom surface with hot-melt glue, then squishing the motor against the block. The cooled glue was flush with the block on the rear and 1.8 mm thick on the front, a 5° angle over the 20 mm block.

Definitely easier than correctly figuring the geometry from first principles: tweak the model to include the measured thickness, compute the angle, tilt the tube, and print another block that fits like it grew there.

With the block in place and the motor held against the downtube, tighten the retaining nut against the “fixing plate” by giving it a few gentle whacks with a hammer, then tighten the jam nut.

The OpenSCAD source code snippet:

// Motor Reaction Block
// Holds motor away from downtube enough to miss rear shift wire

MotorOD = 111;              // motor frame dia
MotorMountRad = 85;         // BB spindle center to motor center
Space = 8.0;                // motor to frame space

Spacer = [20.0,DownTube[ID]/2,4*Space];
SpaceAngle = atan(1.8/Spacer.x);            // tilt due to non-right-angle meeting
echo(str("Spacer angle: ",SpaceAngle));

module MotorSpacer() {

    difference() {
        cube(Spacer,center=true);
        translate([0,0,DownTube[ID]/2])
            rotate([0,90 + SpaceAngle,0]) rotate(180/FrameSides)
                cylinder(d=DownTube[ID],h=DownTube[LENGTH],$fn=FrameSides,center=true);
        translate([DownTube[LENGTH]/2,0,DownTube[ID]/2 - DownTube[LENGTH]*sin(SpaceAngle)/2])       // concentric with ID
            rotate([0,90 + SpaceAngle,0]) rotate(180/FrameSides)
                cylinder(d=DownTube[OD],h=DownTube[LENGTH],$fn=FrameSides,center=true);
        translate([0,0,-(MotorOD/2 + Space)])
            rotate([90,0,0]) rotate(180/48)
                cylinder(d=MotorOD,h=2*Spacer.y,$fn=48,center=true);
    }

}

Mary’s Tour Easy didn’t need this block, because all the cables run elsewhere, but I did capture a piece of closed-cell foam between its vestigial downtube and the motor to prevent chafing.

Tour Easy: Bafang 48 V 11.6 A·h Battery Mount

Bafang BBS02 batteries should mount on the water bottle bosses along a more-or-less standard bicycle’s downtube, which a Tour Easy recumbent has only in vestigial form. The battery does, however, fit perfectly along the lower frame tubes:

Tour Easy Bafang mid-drive - battery
Tour Easy Bafang mid-drive – battery

You might be forgiven for thinking Gardner Martin (not to be confused with Martin Gardner of Scientific American fame) designed the Tour Easy frame specifically to hold that battery, but the design dates back to the 1970s and it’s just a convenient coincidence.

The battery slides into a flat baseplate and locks in place, although it’s definitely not a high-security design. Mostly, the lock suffices to keep honest people honest and prevent the battery from vibrating loose while riding:

Tour Easy Bafang battery mount - baseplate installed
Tour Easy Bafang battery mount – baseplate installed

The flat enclosure toward the rear was obviously designed for more complex circuitry than it now contains:

Tour Easy Bafang battery mount - interior
Tour Easy Bafang battery mount – interior

Those are all neatly drilled and tapped M3 machine screw holes. The cable has no strain relief, despite the presence of suitable holes at the rear opening. I tucked the spare cable inside, rather than cut it shorter, under the perhaps unwarranted assumption they did a good job crimping / soldering the wires to the terminals.

The red frame tubes are not parallel, so each of the four mounting blocks fits in only one location. They’re identified by the side-to-side tube measurement at their centerline and directional pointers:

Bafang Battery Mount - Show bottom
Bafang Battery Mount – Show bottom

The first three blocks have a hole for the mounting screw through the battery plate. The central slot fits around the plate’s feature for the recessed screw head. The two other slots clear the claws extending downward from the battery into the plate:

Bafang Battery Mount - Show view
Bafang Battery Mount – Show view

The rear block has a flat top and a recessed screw head, because the fancy metal enclosure doesn’t have a screw hole:

Tour Easy Bafang battery mount - top detail
Tour Easy Bafang battery mount – top detail

I thought of drilling a hole through the plate, but eventually put a layer of carpet tape atop the block to encourage it to not slap around, as the whole affair isn’t particularly bendy. We’ll see how well it works on the road.

I had intended to put an aluminum plate across the bottom to distribute the clamping force from the screw, but found a suitable scrap of the institutional-grade cafeteria tray we used as a garden cart seat:

Tour Easy Bafang battery mount - bottom detail
Tour Easy Bafang battery mount – bottom detail

I traced around the block, bandsawed pretty close to the line, then introduced it to Mr Disk Sander for final shaping.

The round cable runs from the rear wheel speed sensor through all four blocks to join the motor near the bottom bracket. Because a recumbent bike’s rear wheel is much further from its bottom bracket, what you see is actually an extension cable with a few extra inches doubled around its connection just ahead of the battery.

Each of the four blocks takes about an hour to print, so I did them individually while making continuous process improvements to the solid model:

Bafang Battery Mount - Build view
Bafang Battery Mount – Build view

The heavy battery cable runs along the outside of the left frame tube, with enough cable ties to keep it from flopping around:

Tour Easy Bafang battery mount - bottom view
Tour Easy Bafang battery mount – bottom view

I wanted to fit it between the tubes, but there just wasn’t enough room around the screw in the front block where the tubes converge. It’s still pretty well protected and should be fine.

The chainline worked out much better than I expected:

Tour Easy Bafang battery mount - chainline
Tour Easy Bafang battery mount – chainline

That’s with the chain on the lowest (most inboard) rear sprocket, so it’s as close to the battery as it gets. I’m sure the battery will accumulate oily chain grime, as does everything else on a bike.

Lithium batteries have a vastly higher power density than good old lead acid batteries, but seven pounds is still a lot of weight!

The OpenSCAD source code as a GitHub Gist:

// Tour Easy Bafang Battery Mount
// Ed Nisley KE4ZNU 2021-04
Layout = "Build"; // [Frame,Block,Show,Build,Bushing,Cateye]
FrameWidths = [60.8,62.0,63.4,66.7]; // last = rear overhang support block
Support = true;
//- Extrusion parameters must match reality!
/* [Hidden] */
ThreadThick = 0.25;
ThreadWidth = 0.40;
HoleWindage = 0.2;
Protrusion = 0.1; // make holes end cleanly
inch = 25.4;
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
ID = 0;
OD = 1;
LENGTH = 2;
//----------
// Dimensions
// Bike frame lies along X axis, rear to +X
FrameTube = [350,22.6 + HoleWindage,22.6 + HoleWindage]; // X = longer than anything else
FrameAngle = atan((65.8 - 59.4)/300); // measured distances = included angle between tubes
TubeAngle = FrameAngle/2; // .. frame axis to tube
FrameSides = 24;
echo(str("Frame angle: ",FrameAngle));
SpeedOD = 3.5; // speed sensor cable along frame
PowerOD = 6.7; // power cable between frame tubes
BatteryBoss = [5.5,16.0,2.5]; // battery mount boss, center is round
BossSlotOAL = 32.0; // .. end bosses are elongated
BossOC = 65.0; // .. along length of mount
LatchWidth = 10.0; // battery latches to mount plate
LatchThick = 1.5;
LatchOC = 56.0;
WallThick = 5.0; // thinnest wall
Block = [25.0,78.0,FrameTube.z + 2*WallThick]; // must be larger than frame tube spacing
echo(str("Block: ",Block));
// M5 SHCS nyloc nut
Screw = [5.0,8.5,5.0]; // OD, LENGTH = head
Washer = [5.5,10.1,1.0];
Nut = [5.0,9.0,5.0];
// 10-32 Philips nyloc nut
Screw10 = [5.2,9.8,3.6]; // OD, LENGTH = head
Washer10 = [5.5,11.0,1.0];
Nut10 = [5.2,10.7,6.2];
Kerf = 1.0; // cut through middle to apply compression
CornerRadius = 5.0;
EmbossDepth = 2*ThreadThick; // lettering depth
//----------------------
// Useful routines
module PolyCyl(Dia,Height,ForceSides=0) { // based on nophead's polyholes
Sides = (ForceSides != 0) ? ForceSides : (ceil(Dia) + 2);
FixDia = Dia / cos(180/Sides);
cylinder(d=(FixDia + HoleWindage),h=Height,$fn=Sides);
}
// clamp overall shape
module ClampBlock() {
difference() {
hull()
for (i=[-1,1], j=[-1,1])
translate([i*(Block.x/2 - CornerRadius),j*(Block.y/2 - CornerRadius),-Block.z/2])
cylinder(r=CornerRadius,h=Block.z,$fn=4*8);
translate([0,0,-(Block.z/2 + Protrusion)])
rotate(0*180/6)
PolyCyl(Screw[ID],Block.z + 2*Protrusion,6);
cube([2*Block.x,2*Block.y,Kerf],center=true);
translate([0,-(Block.y/2 - PowerOD + Protrusion/2),-PowerOD/2])
cube([2*Block.x,2*PowerOD + Protrusion,PowerOD],center=true);
}
}
// frame tube layout with measured side-to-side width
module Frame(Outer = FrameWidths[0],AdjustDia = 0.0) {
TubeOC = Outer - FrameTube.y/cos(TubeAngle); // increase dia for angle
for (i=[-1,1])
translate([0,i*TubeOC/2,0])
rotate([0,90,i*TubeAngle]) rotate(180/FrameSides)
cylinder(d=FrameTube.z + AdjustDia,h=FrameTube.x,center=true,$fn=FrameSides);
}
// complete clamp block
module Clamp(Outer = FrameWidths[0]) {
TubeOC = Outer - FrameTube.y/cos(TubeAngle); // increase dia for angle
difference() {
ClampBlock();
Frame(Outer);
translate([0,(TubeOC/2 - FrameTube[OD]/2),-SpeedOD/2])
cube([2*Block.x,2*SpeedOD,SpeedOD],center=true);
translate([0,15,Block.z/2 - EmbossDepth/2 + Protrusion])
cube([9.0,8,EmbossDepth],center=true);
translate([0,22,-Block.z/2 + EmbossDepth/2 - Protrusion])
cube([9.0,26,EmbossDepth],center=true);
if (Outer == FrameWidths[len(FrameWidths) - 1]) { // special rear block
translate([0,0,Block.z/2 - 2*Screw10[LENGTH]])
PolyCyl(Washer10[OD],2*Screw10[LENGTH] + Protrusion,6);
}
else { // other blocks have channels
translate([0,0,Block.z/2 - BatteryBoss[LENGTH]/2 + Protrusion])
cube([BossSlotOAL,BatteryBoss[OD],BatteryBoss[LENGTH] + Protrusion],center=true);
for (i=[-1,1])
translate([0,i*LatchOC/2,Block.z/2 - LatchThick/2 + Protrusion])
cube([BossSlotOAL,LatchWidth,LatchThick + Protrusion],center=true);
}
}
translate([0,15,Block.z/2 - EmbossDepth])
linear_extrude(height=EmbossDepth)
rotate(90)
text(text="^",size=5,spacing=1.00,font="Bitstream Vera Sans:style=Bold",
halign="center",valign="center");
translate([0,22,-Block.z/2])
linear_extrude(height=EmbossDepth)
rotate(-90) mirror([0,1,0])
text(text=str("^ ",Outer),size=4.5,spacing=1.00,font="Bitstream Vera Sans:style=Bold",
halign="center",valign="center");
if (Support)
color("Yellow") {
NumRibs = 7;
RibOC = Block.x/(NumRibs - 1);
intersection() {
translate([0,0,Block.z/2 + Kerf/2])
cube([2*Block.x,2*Block.y,Block.z],center=true);
union() for (j=[-1,1]) {
translate([0,j*TubeOC/2,Kerf/2])
cube([1.1*Block.x,FrameTube.y - 2*ThreadThick,4*ThreadThick],center=true);
for (i=[-floor(NumRibs/2):floor(NumRibs/2)])
translate([i*RibOC,j*TubeOC/2,0])
rotate([0,90,0]) rotate(180/FrameSides)
cylinder(d=FrameTube.z - 2*ThreadThick,h=2*ThreadWidth,$fn=FrameSides,center=true);
}
}
}
}
// Half clamp sections for printing
module HalfClamp(i = 0, Section = "Upper") {
render()
intersection() {
translate([0,0,Block.z/4])
cube([Block.x,Block.y,Block.z/2],center=true);
if (Section == "Upper")
translate([0,0,-Kerf/2])
Clamp(FrameWidths[i]);
else
translate([0,0,Block.z/2])
Clamp(FrameWidths[i]);
}
}
// Handlebar bushing for controller
BushingSize = [16.0,22.2,15.0];
module Bushing() {
difference() {
cylinder(d=BushingSize[OD],h=BushingSize[LENGTH],$fn=24);
translate([0,0,-Protrusion])
cylinder(d=BushingSize[ID],h=2*BushingSize[LENGTH],$fn=24);
translate([0*(BushingSize[OD] - BushingSize[ID])/4,0,BushingSize[LENGTH]/2])
cube([2*BushingSize[OD],2*ThreadWidth,2*BushingSize[LENGTH]],center=true);
}
}
// Cateye cadence sensor bracket
module Cateye() {
Pivot = [3.0,10.0,8.0];
Slot = [4.2,14.0,14.0];
Clip = [8.0,Slot.y,Slot.z + Pivot[OD]/2];
translate([0,0,Clip.z])
difference() {
union() {
translate([0,0,-Clip.z/2])
cube(Clip,center=true);
translate([-Clip.x/2,0,0])
rotate([0,90,0])
cylinder(d=Clip.y,h=Clip.x,$fn=12);
}
translate([-Clip.x,0,0])
rotate([0,90,0]) rotate(180/6)
PolyCyl(3.0,2*Clip.x,6);
translate([0,0,-(Clip.z - Slot.z/2)])
cube(Slot + [0,Protrusion,Protrusion],center=true);
}
}
//----------
// Build them
if (Layout == "Frame")
Frame();
if (Layout == "Block")
ClampBlock();
if (Layout == "Bushing")
Bushing();
if (Layout == "Cateye")
Cateye();
if (Layout == "Upper" || Layout == "Lower")
HalfClamp(0,Layout);
if (Layout == "Show") {
Clamp();
color("Red", 0.3)
Frame();
}
if (Layout == "Build") {
n = len(FrameWidths);
gap = 1.2;
for (i=[0:n-1]) {
j = i - ceil((n-1)/2);
translate([-gap*Block.y/2,j*gap*Block.x,0])
rotate(90)
HalfClamp(i,"Upper");
translate([gap*Block.y/2,j*gap*Block.x,0])
rotate([0,0,90])
HalfClamp(i,"Lower");
}
}

Tek CC Milled Cursor vs. Speed vs. Coolant

After getting the Sherline running with the Mesa 5I25, I could return to milling cursor hairlines for the Tek Circuit Computer:

Hairline V tool - fixture
Hairline V tool – fixture

That’s the fixture intended for Gyros circular saw blades, repurposed for V tool engraving. The V tool in the Sherline tool holder collet is one of the ten-pack from the CNC 3018, unused until this adventure.

The actual setup had a scrap cursor secured with a strip of Kapton tape:

Hairline V tool - 0.2 0.3 0.4 DOC 10K RPM - Kapton fixture
Hairline V tool – 0.2 0.3 0.4 DOC 10K RPM – Kapton fixture

Those are three passes at (nominal) depths of 0.2, 0.3, and 0.4 mm (bottom to top) with a pre-existing hairline visible just above the second pass. The spindle ran at the Sherline’s top speed of just under 10 kRPM with no coolant on the workpiece.

I touched off the 0.2 mm cut by lowering the tool 0.1 mm at a time until it just left a mark on the Kapton tape, after a coarse touch-off atop a 0.5 mm plastic card, and calling it zero.

Scribbling over the cuts with a red Industrial Sharpie looked downright gory:

Hairline V tool - 0.2 0.3 0.4 DOC - Kapton Sharpie
Hairline V tool – 0.2 0.3 0.4 DOC – Kapton Sharpie

Peeling the tape and applying a cloth moistened with denatured alcohol showed three gnarly hairlines:

Hairline V tool - 0.2 0.3 0.4 DOC 10K RPM - Kapton start
Hairline V tool – 0.2 0.3 0.4 DOC 10K RPM – Kapton start

The top hairline shows distinct signs of melted PET plastic along the trench, with poor color fill due to the Sharpie not sticking to / wiping off the smooth-ish trench bottom. The next one is the existing saw-cut hairline with the lead-in cut over on the left.

The 0.3 and 0.2 mm hairlines look much better, with less debris and more complete fill. Unfortunately, the right side of the Sherline’s tooling plate seems to be a few tenths of a millimeter lower than the left, causing the 0.2 mm hairline to … disappear … where the cutter skipped up onto the Kapton tape:

Hairline V tool - 0.2 0.3 0.4 DOC 10K RPM - Kapton mid
Hairline V tool – 0.2 0.3 0.4 DOC 10K RPM – Kapton mid

Now, in practical terms, this is the first time I’ve actually needed platform alignment to within a hundred microns in subtractive machining. As some folks discover to their astonishment, however, 3D printing does require that level of accuracy:

Thinwall Box - platform height
Thinwall Box – platform height

Engraving through a layer of tape isn’t the right way to do it and some coolant will definitely improve the results, so I ignored the alignment issue, remounted the same scrap cursor with the red hairlines on the bottom, pulled a strip of water + detergent along the tool path, cut the same hairlines, and colored the trenches with blue Industrial Sharpie:

Hairline V tool - 0.2 0.3 0.4 DOC 10K RPM - water cool start
Hairline V tool – 0.2 0.3 0.4 DOC 10K RPM – water cool start

The 0.2 mm hairline on the bottom becomes a line as the V bit begins sliding along the surface at 10 kRPM without cutting:

Hairline V tool - 0.2 0.3 0.4 DOC 10K RPM - water cool mid
Hairline V tool – 0.2 0.3 0.4 DOC 10K RPM – water cool mid

The 0.3 mm hairline looks pretty good and the 0.4 mm hairline remains too rugged by the end of the passes. I think the actual depth of cut is at least 0.05 mm less than at the start:

Hairline V tool - 0.2 0.3 0.4 DOC 10K RPM - water cool end
Hairline V tool – 0.2 0.3 0.4 DOC 10K RPM – water cool end

Obviously, neurotically precise touchoff carries a big reward, as will aligning the tooling plate to an absurd degree.

A real machinist simply flycuts the top of an offending part / fixture / tooling plate to align it with the machine’s spindle, but I have a sneaky suspicion the real problem is a speck (or ten) of swarf between the Sherline’s table and the tooling plate; better cleanliness and attention to detail may improve the situation.

Sherline CNC Driver Step Pulse Width Puzzle

Long long ago, as part of tidying up the power distribution inside the Sherline CNC controller PCB, I wrote a cleanroom reimplementation of its PIC firmware and settled on a 25 µs Step pulse width with a minimum 50 µs period:

[PARPORT]
ADDRESS = 0x378
RESET_TIME = 10000
STEPLEN = 25000
STEPSPACE = 25000
DIRSETUP = 50000
DIRHOLD = 50000

Even shorter values for the Direction signal worked with the initial pncconf setup for the Mesa 5I25 FPGA card:

DIRSETUP   = 25000
DIRHOLD    = 25000
STEPLEN    = 25000
STEPSPACE  = 25000

After thrashing through enough of the Kicad-to-HAL converter to get a HAL file sufficiently tasty to prevent LinuxCNC from spitting it out, the X and A axes moved with a gritty sound and the two other axes were pretty much inert.

After eliminating everything else, including having Tiny Scope™ confirm the pulses were exactly the right duration, I increased them by 10 µs:

DIRSETUP   = 35000
DIRHOLD    = 35000
STEPLEN    = 35000
STEPSPACE  = 35000

After which, all the axes suddenly worked perfectly.

At some point along the way, I (re)discovered that Sherline Step pulses are active-low, although in practical terms getting the pulse upside-down just delays the active edge by its width. Given that the Sherline’s top speed is 24 inch/min = 0.4 inch/s, the minimum step period is 156 µs and even a wrong-polarity step should work fine.

For the record, here’s a perfectly good Step pulse:

Mesa 5I25 35us active-low Step pulse
Mesa 5I25 35us active-low Step pulse

Gotta wipe off that screen more often …

Logitech Gamepad: HAL Startup Holdoff

The HAL configuration for the Logitech gamepad has only a few changes from the decade-ago (!) version.

The HAL driver will reverse the direction of the Y and Z axes by feeding -127.5 to the scale inputs:

Sherline HAL schematic - Logitech YZ invert
Sherline HAL schematic – Logitech YZ invert

The flat inputs make sure the joystick knob has a dead zone around the rest position; otherwise, the axes tend to crawl off without a hand on the controls.

The gamepad doesn’t emit any values until you poke a button or move a joystick, the driver starts up with all zeros in its counts registers, so the HAL axis position pins emit XYZA = -1 +1 +1 -1 just as if you had the joysticks jammed hard at their upper-left corners. The only way out is to squelch the joystick until a button gets pressed and the machine is turned on:

Sherline HAL schematic - gamepad valid - parameters
Sherline HAL schematic – gamepad valid – parameters

The Gamepad-Valid signal forcibly disables all four axes:

Gamepad Axis Priority - schematic sample
Gamepad Axis Priority – schematic sample

That’s from an earlier iteration of the axis priority logic, before I got the Kicad annotate-starting-at-100 code working.

I somewhat finessed the startup issue by dedicating two of the gamepad’s back-panel buttons to clearing the initial E-Stop and turning the machine on:

Sherline HAL schematic - gamepad EStop logic
Sherline HAL schematic – gamepad EStop logic

However, if you flip those two conditions with the LinuxCNC GUI, the joysticks will remain zeroed until you do poke a button or move a knob. So, without the Gamepad-Valid logic, the Sherline will take off for the far upper left corner at a pretty good clip, which is not what you want.

The gamepad outputs remain valid for the rest of the session, so there’s no need to reset the Gamepad-Valid flipflop. HAL does not take kindly to hotplugging USB devices, so (AFAICT) you can’t hard-reset the gamepad + driver to the initial no-data-yet condition.

Earlier versions of the top two schematics used CONSTANT symbols, but it turns out PARAMETER symbols work just as well and the resulting setp commands eliminate the need for nets and real time functions.

Kicad-to-HAL: Overview

A LinuxCNC HAL configuration file “wires up” a CNC machine’s I/O hardware and defines the logic operations required for proper operation. My Kicad-to-HAL program converts a specially drawn Kicad schematic describing the hardware and interconnections into the HAL configuration file required to set up the machine; it’s inspired by the Eagle2HAL converter I used many years ago.

For example, my Logitech USB gamepad has four buttons on its back surface:

Logitech gampad - rear buttons
Logitech gampad – rear buttons

This Kicad schematic defines the hardware components and logic required to trigger the machine’s Emergency Stop by pressing buttons 5 and 7 at the same time:

Sherline HAL schematic - gamepad EStop logic
Sherline HAL schematic – gamepad EStop logic

The large block on the left represents the gamepad’s buttons, the AND2 gate (“2” meaning “two inputs”, although there are, as yet, no AND gates with more) combines the two button signals, and the activate input of the halui_estop.100 block puts the machine into Emergency Stop state when it sees a true logic value.

The Kicad-to-HAL program converts that schematic into these lines in the HAL configuration file:

loadrt and2		count=22 


loadusr -W hal_input -KA Dual		# /Gamepad Axes/input.0.100

addf and2.0		servo-thread		# /Gamepad Buttons/and2.100

net N_014 <= and2.0.out => halui.estop.activate		# /Gamepad Buttons/and2.100

net _Gamepad_Buttons_E-Stop-A <= input.0.btn-top2 => and2.0.in0		# /Gamepad Axes/input.0.100
net _Gamepad_Buttons_E-Stop-B <= input.0.btn-base => and2.0.in1		# /Gamepad Axes/input.0.100


Another 21 AND2 gates in the complete schematic for my Sherline contribute to the count in the first line. To define a configuration using bare HAL code, you must count each AND2 gate you use, number them sequentially starting from zero, use the proper gate numbers in all the gate interconnections, and get it exactly right every time. Then do it all again, for the OR2 gates, and so forth and so on.

That’s my primary motivation for writing Kicad-to-HAL: computers can count and copy better than I can.

Wiring up the other two buttons to reset the E-Stop condition and turn the machine on requires a bit less effort:

net _Gamepad_Buttons_Machine-On <= input.0.btn-pinkie => halui.machine.on		# /Gamepad Axes/input.0.100

net _Gamepad_Buttons_E-Stop-Reset <= input.0.btn-base2 => halui.estop.reset		# /Gamepad Axes/input.0.100

Because Kicad requires distinct annotations (the trailing number) for each type of component and HAL uses annotations in a somewhat different (and occasionally self-inconsistent) manner, it’s easiest to let Kicad annotate All The Things. Kicad-to-HAL will find the smallest Kicad annotation number and subtract it from all of the annotations to produce the corresponding HAL annotation: Kicad’s and2.100 becomes HAL’s and2.0. Telling Kicad to start from 100 makes the annotations easier to match up by eye, although that’s not a requirement.

The Kicad components references provide the stems for the HAL names of the component’s pins, so that and2.0 has an output known as and2.100.out after the conversion from and2.100. Some HAL components do not have annotations, which Kicad-to-HAL recognizes by the presence of the StripAnno field and then removes the numbers to make pin names like halui.estop.activate.

The schematic must use components from the LinuxCNC-HAL.lib library file and its data fields stored in the LinuxCNC-HAL.dcm documentation file. I created only the components I needed for my Sherline setup, because I can test them with some confidence. Creating a new component generally starts by copying one that seems similar and tweaking as needed, which is something you get used to when using any schematic program for any reason.

A simple flat Kicad sheet hierarchy suffices for the Sherline schematic, with global labels connecting signals between the sheets. Presumably you can also use hierarchical pins, but I haven’t tested that. The root sheet thus shows thirteen empty blocks without their global-label interconnections.

So I used fourteen schematic sheets for the entire HAL configuration for the Sherline, including the tool length probe, three home switches, and the Logitech USB gamepad for jogging. More complex machines would require more schematic sheets, but the general idea is to put separate functions on separate sheets and let Kicad handle the connections and counting.

The original (and perhaps slightly outdated) writeups of the process have more details:

The Python source code and Kicad libary files as a GitHub Gist:

# Parse Kicad schematic netlist into a LinuxCNC HAL configuration file
#
# Ed Nisley - KE4ZNU
# 2021-04
import argparse
from pathlib import Path
import sys
from lxml import etree
# ----------
# remove Kicad annotation from reference as needed
# kref = Kicad annotated reference
# ma = lowest annotation number
def cleanHALref(kref,ma):
comp = components.xpath('comp[@ref="' + kref + '"]')[0]
fields = comp.xpath('fields/field[@name="StripAnno"]')
if len(fields) and (fields[0].text).startswith("1"):
retval = kref.rpartition(".")[0]
else:
r, _, a = kref.rpartition('.')
retval = '{}.{}'.format(r,int(a) - ma)
# print('strip: {} -> {}'.format(kref,retval))
return retval
# ----------
# do the whole thing
parser = argparse.ArgumentParser(
description="Process Kicad schematic netlist into LinuxCNC HAL configuration file"
)
parser.add_argument("netlist", help="input: Kicad XML netlist file describing HAL configuration")
parser.add_argument("hal", help="output: LinuxCNC HAL configuration file")
args = parser.parse_args()
xmlfn = Path(args.netlist)
if not xmlfn.exists():
print("** No such file: {!s}".format(xmlfn))
exit()
print("Opening XML file: {!s}".format(xmlfn))
Netlist = etree.parse(xmlfn.name)
halfn = Path(args.hal)
if halfn is None:
halfn = xmlfn.with_name(xmlfn.stem + ".hal")
print("Writing HAL file: {!s}".format(halfn))
halfile = open(halfn, "w")
design = Netlist.xpath("//design")[0]
print("XML date: {}".format(design.xpath("date")[0].text))
libraries = Netlist.xpath("//libraries")[0]
print("Libraries:")
for l in libraries:
print(" {}".format(l.xpath("uri")[0].text))
components = Netlist.xpath("//components")[0]
print("Components: {:.0f}".format(components.xpath("count(comp)")))
libparts = Netlist.xpath("//libparts")[0]
print("Library parts: {:.0f}".format(libparts.xpath("count(libpart)")))
nets = Netlist.xpath("//nets")[0]
print("Nets: {:.0f}".format(nets.xpath("count(net)")))
halfile.write("# LinuxCNC HAL file\n\n# Kicad netlist: {}\n".format(xmlfn))
halfile.write("# {}\n\n".format(design.xpath("date")[0].text))
# -----
# find smallest reference number
comps = components.xpath('comp')
minanno = sys.maxsize
for comp in comps:
ref = comp.attrib["ref"]
anno = ref.rpartition('.')[2]
if int(anno) < minanno:
minanno = int(anno)
print('Minimum Kicad annotation: {}'.format(minanno))
halfile.write("# Minimum Kicad annotation: {}\n".format(minanno))
# -----
# load realtime modules
# LOADRT components
comps = components.xpath('comp[value="LOADRT"]')
comps.sort(key=lambda r: r.attrib["ref"])
#print(f'LRT sort: {comps=}')
llist = []
for comp in comps:
sname = comp.xpath('sheetpath')[0].attrib['names']
ref = comp.attrib["ref"]
fld = comp.xpath('fields/field[@name="LoadRT"]')[0]
#print(f' cfg: {ref=} -> {fld.text=}')
llist += ["loadrt {}\t\t# {}{}".format(fld.text, sname, ref)]
if len(llist):
llist += ["\n"]
# collect all other components with a LoadRT field
# a leading + indicates a component using Kicad reference counting
# concatenate rest of field in order of ref sequence
rtfs = components.xpath('comp[value!="LOADRT"]/fields/field[@name="LoadRT"]')
#print(f'LRT flds: {rtfs=}')
rtfs.sort(key=lambda f: f.xpath("ancestor::comp")[0].attrib["ref"])
modules = {}
for f in rtfs:
comp = f.xpath("ancestor::comp")[0]
sname = comp.xpath('sheetpath')[0].attrib['names']
ref = comp.attrib["ref"]
mod = comp.xpath("libsource")[0].attrib["part"]
#print(f'LRT {ref=} {mod=}')
if f.text.startswith("+"):
if mod in modules:
modules[mod][0] += 1
modules[mod][1] += f.text.lstrip("+ ")
else:
modules.update({mod: [1, f.text.lstrip("+ ")]})
#print(f" added {mod=} {modules[mod]=}")
else:
llist += ["loadrt {}\t{}\t\t# {}{}".format(mod, f.text, sname, ref)]
if len(modules):
#print(f'modules: {modules=}')
for mod, v in sorted(modules.items(), key=lambda kv: kv[0]):
llist += ["loadrt {}\t\tcount={} {}".format(mod.lower(), v[0], v[1])]
if len(llist):
halfile.write("\n#------\n# LoadRT modules\n\n")
halfile.write("\n".join(llist) + "\n")
# -----
# collect LoadUsr fields from components
llist = []
ufs = components.xpath('comp/fields/field[@name="LoadUsr"]')
#print(f'Flds: {ufs=}')
for f in ufs:
comp = f.xpath("ancestor::comp")[0]
sname = comp.xpath('sheetpath')[0].attrib['names']
ref = comp.attrib["ref"]
if len(f.text):
#print(f' {ref=} {f.text=}')
llist += ["loadusr {}\t\t# {}{}".format(f.text, sname, ref)]
if len(llist):
halfile.write("\n#------\n# LoadUsr modules\n\n")
halfile.write("\n".join(llist) + "\n")
# -----
# collect functions from power-input pins into addf statements
halfile.write("\n#------\n# Function hookups\n\n")
addflist = []
# find library THREAD part to get pins for addf sequencing
tpart = libparts.xpath('libpart[@part="THREAD"]')[0]
tpins = tpart.xpath("pins/pin")
#print(f'Fns: {tpart=}')
#print(f' tpins: {tpins=}')
# step through all THREAD components
tcomps = components.xpath('comp[value="THREAD"]')
#print(f' {tcomps=}')
for tcomp in tcomps:
tcref = tcomp.attrib["ref"]
cleantcr = cleanHALref(tcref,minanno)
#print(f' {tcomp=} {tcref=} {cleantcr=}')
for tpin in tpins:
pnum = tpin.attrib["num"]
pname = tpin.attrib["name"]
# use pin number to find other nodes in net
pnode = nets.xpath('net/node[@ref="' + tcref + '" and @pin="' + pnum + '"]')[0]
nodes = pnode.xpath("preceding-sibling::node")
nodes += pnode.xpath("following-sibling::node")
#print(f' {nodes=}')
if len(nodes) == 0:
continue
nlist = []
#print(f' {pname=}')
for node in nodes:
ref = node.attrib["ref"]
cleanref = cleanHALref(ref,minanno)
pin = node.attrib["pin"]
#print(f' {node=} {ref=} = {cleanref=} {pin=}')
dcomp = components.xpath('comp[@ref="' + ref + '"]')[0]
sname = dcomp.xpath('sheetpath')[0].attrib['names']
# look up destination pin name to weed out "_" defaults
# and find "/" prefix indicating no ref prefix
dval = dcomp.xpath("value")[0]
#print(f' {dval=} {dval.text=}')
dsrc = dcomp.xpath("libsource")[0]
dpart = dsrc.attrib["part"]
#print(f' {dsrc=} {dpart=}')
ldparts = libparts.xpath('libpart[@part="' + dpart + '"]')
#print(f' {ldparts=}')
if len(ldparts):
ldpart = ldparts[0]
ldpin = ldpart.xpath('pins/pin[@num="' + pin + '"]')[0]
ldpname = ldpin.attrib["name"]
#print(f' {ldpin=} {ldpname=} {dpart=}')
if ldpname == "_":
nlist += ["addf {}\t\t{}\t\t# {}{}".format(cleanref, cleantcr, sname, ref)]
else:
if ldpname.startswith("/"):
nlist += [
"addf {}\t\t{}\t\t# {}{}".format(ldpname.removeprefix("/"), cleantcr, sname, ref)
]
else:
nlist += ["addf {}.{}\t\t{}\t\t# {}{}".format(cleanref, ldpname, cleantcr,sname, ref)]
if pname == "_":
nlist = sorted(nlist,key = lambda k: k.rpartition("/")[2])
addflist += ["# Position: " + pname + "\n"] + nlist + ["\n"]
if len(addflist):
halfile.write("\n".join(addflist) + "\n")
# -----
# set parameter values
# trace through nets to find other nodes to set
params = 0
parlist = []
for comp in components:
sname = comp.xpath('sheetpath')[0].attrib['names']
ref = comp.attrib["ref"]
# ignore non-parameter components
if not ref.startswith("parameter."):
continue
params += 1
value = comp.xpath("value")[0].text
#print(f'param {ref=} {value=}')
pnode = nets.xpath('net/node[@ref="' + ref + '"]')[0]
nodes = pnode.xpath("preceding-sibling::node") + pnode.xpath("following-sibling::node")
for node in nodes:
nref = node.attrib["ref"]
npin = node.attrib["pin"]
dref = cleanHALref(nref,minanno)
#print(f' {ref=} {dref=} {npin=}')
ncomp = components.xpath('comp[@ref="' + nref + '"]')[0]
nls = ncomp.xpath("libsource")[0]
nname = nls.attrib["part"]
lpart = libparts.xpath('libpart[@part="' + nname + '"]')[0]
lpin = lpart.xpath('pins/pin[@num="' + npin + '"]')[0]
#print(f' {ref=} {dref=} {npin=} {lpin=}')
parlist += [
"setp {}.{} {}\t\t# {}{}".format(dref, lpin.attrib["name"], value, sname, ref)
]
if len(parlist):
halfile.write("\n#------\n# Parameters\n\n")
# better sorted in order of target pin, not annotation
# p = sorted(parlist,key = lambda k: k.rpartition("#")[2])
p = sorted(parlist,key = lambda k: k.split(" ")[1])
halfile.write("\n".join(p) + "\n")
print("Parameters: {}".format(params))
# -----
# set constant parameters
# the .value pin is hardcoded here to keep the schematic part tidy
consts = 0
conlist = []
for comp in components:
sname = comp.xpath('sheetpath')[0].attrib['names']
ref = comp.attrib["ref"]
# ignore non-constant components
if not ref.startswith("constant."):
continue
consts += 1
value = comp.xpath("value")[0].text
#print(' {ref=} = {value=}')
pval = cleanHALref(ref,minanno) + ".value"
conlist += ["setp {} {}\t\t# {}{}".format(pval, value, sname, ref)]
if len(conlist):
halfile.write("\n#------\n# Constants\n\n")
c = sorted(conlist,key = lambda k: k.rpartition("#")[2])
halfile.write("\n".join(c) + "\n")
print("Constants: {}".format(consts))
# -----
# generate HAL net connections
halfile.write("\n#------\n# Nets\n\n")
hallist = []
single = 0
multi = 0
netID = 1
for net in nets:
name = net.attrib["name"]
# skip special net for unconnected addf functions handled later
if name == "_":
multi += 1
continue
#print(f'{net.attrib=}')
nodes = net.xpath("node")
# skip single-pin nets
# suppress error for pin names starting with *
if len(nodes) < 2:
if not (name.startswith("Net-") or name.startswith("*")):
hallist += [
"#* Named net with single pin: {} {}\n".format(nodes[0].attrib["ref"], name)
]
single += 1
continue
nameclean = name.translate(name.maketrans("/ ", "__", "()"))
#print(f' {name=} {nameclean=}')
multi += 1
halstr = "net "
halsrc = "\t\t# "
halsinks = []
outputs = 0
for node in nodes:
ref = node.attrib["ref"]
cleanref = cleanHALref(ref,minanno)
pnum = node.attrib["pin"]
#print(f' {node.attrib=}')
comp = components.xpath('comp[@ref="' + ref + '"]')[0]
sname = comp.xpath('sheetpath')[0].attrib['names']
ls = comp.xpath("libsource")[0]
#print(f' {ls.attrib=}')
lpart = libparts.xpath('libpart[@part="' + ls.attrib["part"] + '"]')[0]
#print(f' {lpart.attrib=}')
lpin = lpart.xpath('pins/pin[@num="' + pnum + '"]')[0]
pname = lpin.attrib["name"].lstrip("*")
ptype = lpin.attrib["type"]
#print(f' {ptype=} {pname=}')
if ptype == "output":
if name.startswith("Net-"):
halstr += "N_{:0>3d} <= {}.{} => ".format(netID, cleanref, pname)
netID += 1
else:
halstr += "{} <= {}.{} => ".format(nameclean, cleanref, pname)
halsrc += sname + ref
outputs += 1
else:
halsinks += [cleanref + "." + pname]
halstr += " ".join(sorted(halsinks)) + halsrc
if "parameter" in halstr or "-thread" in halstr: # discard parameters and threads
#print(f' discard: {halstr=}')
multi -= 1
continue
elif outputs == 0:
halstr = "#* No output pins: {}\n".format(halstr)
elif outputs > 1:
halstr = "#* Multiple output pins: {}\n".format(halstr)
#print(f' {halstr=}')
hallist += [halstr]
if len(hallist):
hallist = sorted(hallist,key = lambda k: k.split(" ")[1])
halfile.write("\n".join(hallist) + "\n")
print('HAL nets: {:d}'.format(multi))
halfile.write("\n#------\n# Done!\n")
halfile.close()
view raw Kicad-to-HAL.py hosted with ❤ by GitHub
EESchema-DOCLIB Version 2.0
#
$CMP AND2
F https://linuxcnc.org/docs/2.8/html/man/man9/and2.9.html
$ENDCMP
#
$CMP COMP
F https://linuxcnc.org/docs/2.8/html/man/man9/comp.9.html
$ENDCMP
#
$CMP CONSTANT
F https://linuxcnc.org/docs/2.8/html/man/man9/constant.9.html
$ENDCMP
#
$CMP CONV_FLOAT_S32
F https://linuxcnc.org/docs/2.8/html/man/man9/conv_float_s32.9.html
$ENDCMP
#
$CMP CONV_FLOAT_U32
F https://linuxcnc.org/docs/2.8/html/man/man9/conv_float_u32.9.html
$ENDCMP
#
$CMP DBOUNCE
F https://linuxcnc.org/docs/2.8/html/man/man9/dbounce.9.html
$ENDCMP
#
$CMP FLIPFLOP
F https://linuxcnc.org/docs/2.8/html/man/man9/flipflop.9.html
$ENDCMP
#
$CMP HALUI
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_AXIS
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_AXIS_L
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_AXIS_SELECTED
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_ESTOP
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_FEED_OVERRIDE
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_FLOOD
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_JOINT
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_JOINT_N
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_JOINT_SELECTED
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_LUBE
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_MACHINE
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_MAX_VELOCITY
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_MIST
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_MODE
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_PROGRAM
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_RAPID_OVERRIDE
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_SPINDLE_N
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HALUI_TOOL
F https://linuxcnc.org/docs/2.8/html/man/man1/halui.1.html
$ENDCMP
#
$CMP HAL_MANUALTOOLCHANGE
F https://linuxcnc.org/docs/2.8/html/man/man1/hal_manualtoolchange.1.html
$ENDCMP
#
$CMP HM2_BOARD
F https://linuxcnc.org/docs/2.8/html/man/man9/hostmot2.9.html
$ENDCMP
#
$CMP HM2_GPIO
F https://linuxcnc.org/docs/2.8/html/man/man9/hostmot2.9.html
$ENDCMP
#
$CMP HM2_PWMGEN
F https://linuxcnc.org/docs/2.8/html/drivers/hostmot2.html#_pwmgen
$ENDCMP
#
$CMP HM2_PWMGEN_N
F https://linuxcnc.org/docs/2.8/html/drivers/hostmot2.html#_pwmgen
$ENDCMP
#
$CMP HM2_STEPGEN
F https://linuxcnc.org/docs/2.8/html/man/man9/hostmot2.9.html
$ENDCMP
#
$CMP IOCONTROL
F https://linuxcnc.org/docs/2.8/html/man/man1/iocontrol.1.html
$ENDCMP
#
$CMP JOINT_N
F https://linuxcnc.org/docs/2.8/html/man/man9/motion.9.html
$ENDCMP
#
$CMP LOADRT
F https://linuxcnc.org/docs/2.8/html/hal/basic-hal.html#_loadrt
$ENDCMP
#
$CMP LOADUSR
F https://linuxcnc.org/docs/2.8/html/hal/basic-hal.html#_loadusr
$ENDCMP
#
$CMP LOGIC
F https://linuxcnc.org/docs/2.8/html/man/man9/logic.9.html
$ENDCMP
#
$CMP LOGITECH_GAMEPAD_GUF13A
F https://wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_Remote_Pendant
$ENDCMP
#
$CMP MOTION
F https://linuxcnc.org/docs/2.8/html/man/man9/motion.9.html
$ENDCMP
#
$CMP MUX2
F https://linuxcnc.org/docs/2.8/html/man/man9/mux2.9.html
$ENDCMP
#
$CMP MUX4
F https://linuxcnc.org/docs/2.8/html/man/man9/mux4.9.html
$ENDCMP
#
$CMP MUX8
F https://linuxcnc.org/docs/2.8/html/man/man9/mux8.9.html
$ENDCMP
#
$CMP NOT
F https://linuxcnc.org/docs/2.8/html/man/man9/not.9.html
$ENDCMP
#
$CMP OR2
F https://linuxcnc.org/docs/2.8/html/man/man9/or2.9.html
$ENDCMP
#
$CMP PARAMETER
F https://linuxcnc.org/docs/2.8/html/hal/basic-hal.html#_setp
$ENDCMP
#
$CMP PID
F https://linuxcnc.org/docs/2.8/html/man/man9/pid.9.html
$ENDCMP
#
$CMP SCALE
F https://linuxcnc.org/docs/2.8/html/man/man9/scale.9.html
$ENDCMP
#
$CMP SPINDLE
F https://linuxcnc.org/docs/2.8/html/man/man9/motion.9.html
$ENDCMP
#
$CMP THREAD
F https://linuxcnc.org/docs/2.8/html/hal/basic-hal.html#_addf
$ENDCMP
#
$CMP TIMEDELAY
F https://linuxcnc.org/docs/2.8/html/man/man9/timedelay.9.html
$ENDCMP
#
$CMP TOGGLE
F https://linuxcnc.org/docs/2.8/html/man/man9/toggle.9.html
$ENDCMP
#
$CMP XOR2
F https://linuxcnc.org/docs/2.8/html/man/man9/xor2.9.html
$ENDCMP
#
#End Doc Library
view raw LinuxCNC-HAL.dcm hosted with ❤ by GitHub
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# AND2
#
DEF AND2 and2. 0 0 N Y 1 F N
F0 "and2." 0 200 50 H V C CNN
F1 "AND2" 0 0 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
A 0 0 150 0 900 0 1 0 f 150 0 0 150
A 0 0 150 0 -900 0 1 0 f 150 0 0 -150
P 4 0 1 0 0 150 -150 150 -150 -150 0 -150 f
X in0 1 -300 100 150 R 50 50 1 1 I
X in1 2 -300 -100 150 R 50 50 1 1 I
X out 3 300 0 150 L 50 50 1 1 O
X _ 4 -250 0 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# COMP
#
DEF COMP comp. 0 20 N Y 1 F N
F0 "comp." -50 300 50 H V C CNN
F1 "COMP" -50 200 50 H V C CNN
F2 "" 300 -50 50 H I C CNN
F3 "" 300 -50 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
T 0 -100 -50 50 0 0 0 + Normal 0 C C
T 0 -100 50 50 0 0 0 - Normal 0 C C
S 200 150 -300 250 0 1 0 f
S -300 150 200 -350 1 1 0 N
X in0 1 -400 50 100 R 50 50 1 1 I
X out 2 300 50 100 L 50 50 1 1 O
X in1 3 -400 -50 100 R 50 50 1 1 I
X hyst 4 -400 -250 154 R 50 50 1 1 I I
X _ 5 -400 -150 100 R 50 50 1 1 W NC
X equal 6 300 -50 100 L 50 50 1 1 O
ENDDRAW
ENDDEF
#
# CONSTANT
#
DEF CONSTANT constant. 0 0 N N 1 F N
F0 "constant." 0 100 50 H I C CNN
F1 "CONSTANT" 200 0 50 H V R CNN
F2 "" 250 -250 50 H I C CNN
F3 "" 250 -250 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
P 4 0 1 0 -400 50 250 50 250 -50 -400 -50 N
X out 1 350 0 100 L 50 50 1 1 O
X _ 2 -500 0 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# CONV_FLOAT_S32
#
DEF CONV_FLOAT_S32 conv-float-s32. 0 20 N Y 1 F N
F0 "conv-float-s32." 0 300 50 H V C CNN
F1 "CONV_FLOAT_S32" 0 200 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
F4 "+" 0 100 50 H I C CNN "LoadRT"
DRAW
S 400 150 -400 250 0 1 0 f
S -400 150 400 -150 1 1 0 N
X in 1 -500 100 100 R 50 50 1 1 I
X clamp 2 -500 -100 157 R 50 50 1 1 I I
X out-of-range 3 500 0 100 L 50 50 1 1 O
X out 4 500 100 100 L 50 50 1 1 O
X _ 5 -500 0 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# CONV_FLOAT_U32
#
DEF CONV_FLOAT_U32 conv-float-u32. 0 40 N Y 1 F N
F0 "conv-float-u32." 0 300 50 H V C CNN
F1 "CONV_FLOAT_U32" 0 200 50 H V C CNN
F2 "" 0 50 50 H I C CNN
F3 "" 0 50 50 H I C CNN
F4 "+" 0 100 50 H I C CNN "LoadRT"
DRAW
S -400 150 400 -150 1 1 0 N
S 400 150 -400 250 1 1 0 f
X in 1 -500 100 100 R 50 50 1 1 I
X clamp 2 -500 -100 157 R 50 50 1 1 I I
X out-of-range 3 500 0 100 L 50 50 1 1 O
X out 4 500 100 100 L 50 50 1 1 O
X _ 5 -500 0 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# DBOUNCE
#
DEF DBOUNCE dbounce. 0 20 N Y 1 F N
F0 "dbounce." 0 300 50 H V C CNN
F1 "DBOUNCE" 0 200 50 H V C CNN
F2 "" 600 -350 50 H I C CNN
F3 "" 600 -350 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
S 200 150 -200 250 0 1 0 f
S -200 150 200 -150 1 1 0 N
X in 1 -300 100 100 R 50 50 1 1 I
X out 2 300 100 100 L 50 50 1 1 O
X delay 3 -300 -100 100 R 50 50 1 1 I
X _ 4 -300 0 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# FLIPFLOP
#
DEF FLIPFLOP flipflop. 0 20 N Y 1 F N
F0 "flipflop." 0 450 50 H V C CNN
F1 "FLIPFLOP" 0 350 50 H V C CNN
F2 "" 400 -150 50 H I C CNN
F3 "" 400 -150 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
S 200 300 -200 400 0 1 0 f
S -200 300 200 -300 1 1 0 N
X data 2 -300 200 100 R 50 50 1 0 I
X out 5 300 0 100 L 50 50 1 0 O
X reset 1 -300 -200 100 R 50 50 1 1 I
X clk 3 -300 100 100 R 50 50 1 1 I
X set 4 -300 -100 100 R 50 50 1 1 I
X _ 6 -300 0 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# HALUI
#
DEF HALUI halui. 0 40 N Y 1 F N
F0 "halui." 0 500 59 H V C CNN
F1 "HALUI" 0 400 50 H V C CNN
F2 "" -150 300 50 H I C CNN
F3 "" -150 300 50 H I C CNN
F4 "1" 350 400 50 H V C CNN "StripAnno"
DRAW
S -400 -300 400 350 0 1 0 N
S -400 450 400 350 0 1 0 f
X abort 1 -500 250 100 R 0 50 1 0 I
X home-all 2 -500 100 100 R 50 50 1 1 I
X mdi-command-00 ~ -500 -100 100 R 50 50 1 1 I
X mdi-command-01 ~ -500 -200 100 R 50 50 1 1 I
ENDDRAW
ENDDEF
#
# HALUI_AXIS
#
DEF HALUI_AXIS halui.axis. 0 40 N Y 1 F N
F0 "halui.axis." 0 400 50 H V C CNN
F1 "HALUI_AXIS" 0 300 50 H V C CNN
F2 "" 450 400 50 H I C CNN
F3 "" 450 400 50 H I C CNN
F4 "1" 500 300 50 H V C CNN "StripAnno"
DRAW
S -550 -50 550 250 0 1 0 N
S 550 350 -550 250 0 1 0 f
X jog-deadband 1 -650 50 100 R 50 50 1 1 I
X jog-speed 2 -650 150 100 R 50 50 1 1 I
X selected 3 650 150 100 L 50 50 1 1 O
ENDDRAW
ENDDEF
#
# HALUI_AXIS_L
#
DEF HALUI_AXIS_L halui.axis.x. 0 40 N Y 1 F N
F0 "halui.axis.x." 0 400 50 H V C CNN
F1 "HALUI_AXIS_L" 0 300 50 H V C CNN
F2 "" -100 350 50 H I C CNN
F3 "" -100 350 50 H I C CNN
F4 "1" 600 300 50 H V C CNN "StripAnno"
DRAW
S -650 350 650 250 0 1 0 f
S 650 250 -650 -600 0 1 0 N
X analog 1 -750 50 100 R 50 50 1 1 I
X pos-relative 10 750 -150 100 L 50 50 1 1 O
X select 11 -750 200 100 R 50 50 1 1 I
X increment 2 -750 -100 100 R 50 50 1 1 I
X increment-minus 3 -750 -200 100 R 50 50 1 1 I
X increment-plus 4 -750 -300 100 R 50 50 1 1 I
X is-selected 5 750 200 100 L 50 50 1 1 O
X minus 6 -750 -450 100 R 50 50 1 1 I
X plus 7 -750 -550 100 R 50 50 1 1 I
X pos-commanded 8 750 50 100 L 50 50 1 1 O
X pos-feedback 9 750 -50 100 L 50 50 1 1 O
ENDDRAW
ENDDEF
#
# HALUI_AXIS_SELECTED
#
DEF HALUI_AXIS_SELECTED halui.axis.selected. 0 40 N Y 1 F N
F0 "halui.axis.selected." 50 400 50 H V C CNN
F1 "HALUI_AXIS_SELECTED" 50 300 50 H V C CNN
F2 "" 1200 850 50 H I C CNN
F3 "" 1200 850 50 H I C CNN
F4 "1" 550 300 50 H V C CNN "StripAnno"
DRAW
S -500 -500 600 250 1 1 0 N
S 600 350 -500 250 1 1 0 f
X increment 1 -600 150 100 R 50 50 1 1 I
X increment-minus 2 -600 0 100 R 50 50 1 1 I
X increment-plus 3 -600 -100 100 R 50 50 1 1 I
X minus 4 -600 -300 100 R 50 50 1 1 I
X plus 5 -600 -400 100 R 50 50 1 1 I
ENDDRAW
ENDDEF
#
# HALUI_ESTOP
#
DEF HALUI_ESTOP halui.estop. 0 40 N Y 1 F N
F0 "halui.estop." 0 300 50 H V C CNN
F1 "HALUI_ESTOP" 0 200 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
F4 "1" 300 200 50 H V C CNN "StripAnno"
DRAW
S -350 -150 350 150 0 1 0 N
S 350 150 -350 250 0 1 0 f
X activate 1 -450 100 100 R 0 50 1 1 I
X is-activated 2 450 0 100 L 0 50 1 1 O
X reset 3 -450 -100 100 R 0 50 1 1 I
ENDDRAW
ENDDEF
#
# HALUI_FEED_OVERRIDE
#
DEF HALUI_FEED_OVERRIDE halui.feed-override. 0 40 N Y 1 F N
F0 "halui.feed-override." 0 450 50 H V C CNN
F1 "HALUI_FEED_OVERRIDE" 0 350 50 H V C CNN
F2 "" 200 50 50 H I C CNN
F3 "" 200 50 50 H I C CNN
F4 "1" 500 350 50 H V C CNN "StripAnno"
DRAW
S -450 -400 450 300 0 1 0 N
S 450 300 -450 400 0 1 0 f
X count-enable 1 -550 250 100 R 0 50 1 1 I
X counts 2 -550 150 100 R 0 50 1 1 I
X decrease 3 -550 -100 100 R 0 50 1 1 I
X direct-value 4 -550 -250 100 R 0 50 1 1 I
X increase 5 -550 0 100 R 0 50 1 1 I
X scale 6 -550 -350 100 R 0 50 1 1 I
X value 7 550 250 100 L 0 50 1 1 O
ENDDRAW
ENDDEF
#
# HALUI_FLOOD
#
DEF HALUI_FLOOD halui.flood. 0 40 N Y 1 F N
F0 "halui.flood." 0 250 50 H V C CNN
F1 "HALUI_FLOOD" 0 150 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
F4 "1" 350 150 50 H V C CNN "StripAnno"
DRAW
S -300 100 300 -100 1 1 0 N
S -300 200 300 100 1 1 0 f
X is-on 1 400 0 100 L 0 50 1 1 O
X off 2 -400 -50 100 R 0 50 1 1 I
X on 3 -400 50 100 R 0 50 1 1 I
ENDDRAW
ENDDEF
#
# HALUI_JOINT
#
DEF HALUI_JOINT halui.joint. 0 40 N Y 1 F N
F0 "halui.joint." 0 200 50 H V C CNN
F1 "HALUI_JOINT" 0 100 50 H V C CNN
F2 "" 750 150 50 H I C CNN
F3 "" 750 150 50 H I C CNN
F4 "1" 400 100 50 H V C CNN "StripAnno"
DRAW
S 450 50 -450 -250 1 1 0 N
S 450 50 -450 150 1 1 0 f
X jog-deadband 1 -550 -150 100 R 50 50 1 1 I
X selected 2 550 -50 100 L 50 50 1 1 O
X jog-speed 3 -550 -50 100 R 50 50 1 1 I
ENDDRAW
ENDDEF
#
# HALUI_JOINT_N
#
DEF HALUI_JOINT_N halui.joint.0. 0 40 N Y 1 F N
F0 "halui.joint.0." 0 300 50 H V C CNN
F1 "HALUI_JOINT_N" 0 200 50 H V C CNN
F2 "" 400 300 50 H I C CNN
F3 "" 400 300 50 H I C CNN
F4 "1" 700 200 50 H V C CNN "StripAnno"
DRAW
S -800 -1050 750 150 0 1 0 N
S 750 150 -800 250 0 1 0 f
X minus 1 -900 -850 100 R 50 50 1 1 I
X analog 10 -900 -350 100 R 50 50 1 1 I
X is-selected 11 850 50 100 L 50 50 1 1 O
X is-homed 12 850 -100 100 L 50 50 1 1 O
X increment-plus 13 -900 -700 100 R 50 50 1 1 I
X increment-minus 14 -900 -600 100 R 50 50 1 1 I
X increment 15 -900 -500 100 R 50 50 1 1 I
X home 16 -900 -100 100 R 50 50 1 1 I
X has-fault 17 850 -950 100 L 50 50 1 1 O
X unhome 2 -900 -200 100 R 50 50 1 1 I
X select 3 -900 50 100 R 50 50 1 1 I
X plus 4 -900 -950 100 R 50 50 1 1 I
X override-limits 5 850 -850 100 L 50 50 1 1 O
X on-soft-min-limit 6 850 -700 100 L 50 50 1 1 O
X on-soft-max-limit 7 850 -600 100 L 50 50 1 1 O
X on-hard-min-limit 8 850 -450 100 L 50 50 1 1 O
X on-hard-max-limit 9 850 -350 100 L 50 50 1 1 O
ENDDRAW
ENDDEF
#
# HALUI_JOINT_SELECTED
#
DEF HALUI_JOINT_SELECTED halui.joint.selected. 0 40 N Y 1 F N
F0 "halui.joint.selected." 0 500 50 H V C CNN
F1 "HALUI_JOINT_SELECTED" 0 400 50 H V C CNN
F2 "" 150 450 50 H I C CNN
F3 "" 150 450 50 H I C CNN
F4 "1" 700 400 50 H V C CNN "StripAnno"
DRAW
S 750 350 -800 -550 0 1 0 N
S 750 350 -800 450 0 1 0 f
X is-homed 1 850 250 100 L 50 50 1 1 O
X increment-plus 10 -900 -200 100 R 50 50 1 1 I
X increment-minus 11 -900 -100 100 R 50 50 1 1 I
X increment 12 -900 0 100 R 50 50 1 1 I
X home 13 -900 250 100 R 50 50 1 1 I
X has-fault 14 850 150 100 L 50 50 1 1 O
X unhome 2 -900 150 100 R 50 50 1 1 I
X plus 3 -900 -450 100 R 50 50 1 1 I
X override-limits 4 850 -450 100 L 50 50 1 1 O
X on-soft-min-limit 5 850 -350 100 L 50 50 1 1 O
X on-soft-max-limit 6 850 -250 100 L 50 50 1 1 O
X on-hard-min-limit 7 850 -100 100 L 50 50 1 1 O
X on-hard-max-limit 8 850 0 100 L 50 50 1 1 O
X minus 9 -900 -350 100 R 50 50 1 1 I
ENDDRAW
ENDDEF
#
# HALUI_LUBE
#
DEF HALUI_LUBE halui.lube. 0 40 N Y 1 F N
F0 "halui.lube." 0 250 50 H V C CNN
F1 "HALUI_LUBE" -50 150 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
F4 "1" 250 150 50 H V C CNN "StripAnno"
DRAW
S -300 100 300 -100 1 1 0 N
S -300 200 300 100 1 1 0 f
X is-on 1 400 0 100 L 0 50 1 1 O
X off 2 -400 -50 100 R 0 50 1 1 I
X on 3 -400 50 100 R 0 50 1 1 I
ENDDRAW
ENDDEF
#
# HALUI_MACHINE
#
DEF HALUI_MACHINE halui.machine. 0 40 N Y 1 F N
F0 "halui.machine." 0 300 50 H V C CNN
F1 "HALUI_MACHINE" 0 200 50 H V C CNN
F2 "" 2450 1450 50 H I C CNN
F3 "" 2450 1450 50 H I C CNN
F4 "1" 400 200 50 H V C CNN "StripAnno"
DRAW
S -400 -250 450 150 0 1 0 N
S 450 150 -400 250 0 1 0 f
X is-on 1 550 50 100 L 0 50 1 1 O
X off 2 -500 -50 100 R 0 50 1 1 I
X on 3 -500 50 100 R 0 50 1 1 I
X units-per-mm 4 550 -150 100 L 50 50 1 1 O
ENDDRAW
ENDDEF
#
# HALUI_MAX_VELOCITY
#
DEF HALUI_MAX_VELOCITY halui.max-velocity. 0 40 N Y 1 F N
F0 "halui.max-velocity." 0 550 50 H V C CNN
F1 "HALUI_MAX_VELOCITY" -50 450 50 H V C CNN
F2 "" 1350 900 50 H I C CNN
F3 "" 1350 900 50 H I C CNN
F4 "1" 450 450 50 H V C CNN "StripAnno"
DRAW
S -500 -400 500 400 0 1 0 N
S 500 400 -500 500 0 1 0 f
X direct-value 1 -600 -200 100 R 50 50 0 0 I
X count 2 -600 200 100 R 0 50 1 1 I
X count-enable 3 -600 300 100 R 0 50 1 1 I
X decrease 4 -600 50 100 R 0 50 1 1 I
X increase 5 -600 -50 100 R 0 50 1 1 I
X scale 6 -600 -300 100 R 0 50 1 1 I
X value 7 600 200 100 L 0 50 1 1 O
ENDDRAW
ENDDEF
#
# HALUI_MIST
#
DEF HALUI_MIST halui.mist. 0 40 N Y 1 F N
F0 "halui.mist." 0 250 50 H V C CNN
F1 "HALUI_MIST" 0 150 50 H V C CNN
F2 "" 0 -50 50 H I C CNN
F3 "" 0 -50 50 H I C CNN
F4 "1" 300 150 50 H V C CNN "StripAnno"
DRAW
S -300 100 350 -100 0 1 0 N
S -300 200 350 100 0 1 0 f
X is-on 1 450 0 100 L 0 50 1 1 O
X off 2 -400 -50 100 R 0 50 1 1 I
X on 3 -400 50 100 R 0 50 1 1 I
ENDDRAW
ENDDEF
#
# HALUI_MODE
#
DEF HALUI_MODE halui.mode. 0 40 N Y 1 F N
F0 "halui.mode." 0 500 50 H V C CNN
F1 "HALUI_MODE" 0 400 50 H V C CNN
F2 "" 900 750 50 H I C CNN
F3 "" 900 750 50 H I C CNN
F4 "1" 350 400 50 H V C CNN "StripAnno"
DRAW
S -400 -650 400 350 0 1 0 N
S 400 350 -400 450 0 1 0 f
X auto 1 -500 250 100 R 0 50 1 1 I
X teleop 10 -500 -550 100 R 0 50 1 1 I
X is-auto 2 500 250 100 L 0 50 1 1 O
X is-joint 3 500 50 100 L 0 50 1 1 O
X is-manual 4 500 -150 100 L 0 50 1 1 O
X is-mdi 5 500 -350 100 L 0 50 1 1 O
X is-teleop 6 500 -550 100 L 0 50 1 1 O
X joint 7 -500 50 100 R 0 50 1 1 I
X manual 8 -500 -150 100 R 0 50 1 1 I
X mdi 9 -500 -350 100 R 0 50 1 1 I
ENDDRAW
ENDDEF
#
# HALUI_PROGRAM
#
DEF HALUI_PROGRAM halui.program. 0 40 N Y 1 F N
F0 "halui.program." -50 550 50 H V C CNN
F1 "HALUI_PROGRAM" -50 450 50 H V C CNN
F2 "" 50 300 50 H I C CNN
F3 "" 50 300 50 H I C CNN
F4 "1" 400 450 50 H V C CNN "StripAnno"
DRAW
S -500 400 450 -950 0 1 0 N
S 450 400 -500 500 0 1 0 f
X block-delete.is-on 1 550 -750 100 L 0 50 1 1 O
X pause 10 -600 -50 100 R 0 50 1 1 I
X resume 11 -600 -150 100 R 0 50 1 1 I
X run 12 -600 300 100 R 0 50 1 1 I
X step 13 -600 200 100 R 0 50 1 1 I
X stop 14 -600 100 100 R 0 50 1 1 I
X block-delete.off 2 -600 -850 100 R 0 50 1 1 I
X block-delete.on 3 -600 -650 100 R 0 50 1 1 I
X is-idle 4 550 200 100 L 0 50 1 1 O
X is-paused 5 550 -50 100 L 0 50 1 1 O
X is-running 6 550 300 100 L 0 50 1 1 O
X optional-stop.is-on 7 550 -400 100 L 0 50 1 1 O
X optional-stop.off 8 -600 -500 100 R 0 50 1 1 I
X optional-stop.on 9 -600 -300 100 R 0 50 1 1 I
ENDDRAW
ENDDEF
#
# HALUI_RAPID_OVERRIDE
#
DEF HALUI_RAPID_OVERRIDE halui.rapid-override. 0 40 N Y 1 F N
F0 "halui.rapid-override." 0 450 50 H V C CNN
F1 "HALUI_RAPID_OVERRIDE" -50 350 50 H V C CNN
F2 "" 1050 750 50 H I C CNN
F3 "" 1050 750 50 H I C CNN
F4 "1" 500 350 50 H V C CNN "StripAnno"
DRAW
S -550 -500 550 300 1 1 0 N
S 550 300 -550 400 1 1 0 f
X count-enable 1 -650 200 100 R 0 50 1 1 I
X counts 2 -650 100 100 R 0 50 1 1 I
X decrease 3 -650 -150 100 R 0 50 1 1 I
X direct-value 4 -650 -300 100 R 0 50 1 1 I
X increase 5 -650 -50 100 R 0 50 1 1 I
X scale 6 -650 -400 100 R 0 50 1 1 I
X value 7 650 200 100 L 0 50 1 1 O
ENDDRAW
ENDDEF
#
# HALUI_SPINDLE_N
#
DEF HALUI_SPINDLE_N halui.spindle.0. 0 40 N Y 1 F N
F0 "halui.spindle.0." 0 900 50 H V C CNN
F1 "HALUI_SPINDLE_N" 0 800 50 H V C CNN
F2 "" -50 1450 50 H I C CNN
F3 "" -50 1450 50 H I C CNN
F4 "1" 550 800 50 H V C CNN "StripAnno"
DRAW
S -650 -950 600 750 0 1 0 N
S 600 750 -650 850 0 1 0 f
X override.direct-value 11 -750 -850 100 R 50 50 0 0 I
X override.counts 1 -750 -550 100 R 0 50 1 1 I
X override.decrease 10 -750 -650 100 R 0 50 1 1 I
X override.count-enable 12 -750 -450 100 R 0 50 1 1 I
X is-on 13 700 -100 100 L 0 50 1 1 O
X increase 14 -750 150 100 R 0 50 1 1 I
X forward 15 -750 400 100 R 0 50 1 1 I
X decrease 16 -750 50 100 R 0 50 1 1 I
X brake.off 17 -750 550 100 R 0 50 1 1 I
X brake-on 18 -750 650 100 R 0 50 1 1 I
X brake-is-on 19 700 650 100 L 0 50 1 1 O
X stop 2 -750 -200 100 R 0 50 1 1 I
X start 3 -750 -100 100 R 0 50 1 1 I
X runs-forward 4 700 400 100 L 0 50 1 1 O
X runs-backwards 5 700 300 100 L 0 50 1 1 O
X reverse 6 -750 300 100 R 0 50 1 1 I
X override.value 7 700 -350 100 L 0 50 1 1 O
X override.scale 8 -750 -350 100 R 0 50 1 1 I
X override.increase 9 -750 -750 100 R 0 50 1 1 I
ENDDRAW
ENDDEF
#
# HALUI_TOOL
#
DEF HALUI_TOOL halui.tool. 0 40 N Y 1 F N
F0 "halui.tool." -50 750 50 H V C CNN
F1 "HALUI_TOOL" -50 650 50 H V C CNN
F2 "" -50 300 50 H I C CNN
F3 "" -50 300 50 H I C CNN
F4 "1" 250 650 50 H V C CNN "StripAnno"
DRAW
S -400 600 300 700 0 1 0 f
S 300 600 -400 -800 0 1 0 N
X diameter 1 400 400 100 L 0 50 1 1 O
X length-offset.z 10 400 -700 100 L 0 50 1 1 O
X number 11 400 500 100 L 0 50 1 1 O
X length-offset.a 2 400 250 100 L 0 50 1 1 O
X length-offset.b 3 400 150 100 L 0 50 1 1 O
X length-offset.c 4 400 50 100 L 0 50 1 1 O
X length-offset.u 5 400 -150 100 L 0 50 1 1 O
X length-offset.v 6 400 -250 100 L 0 50 1 1 O
X length-offset.w 7 400 -350 100 L 0 50 1 1 O
X length-offset.x 8 400 -500 100 L 0 50 1 1 O
X length-offset.y 9 400 -600 100 L 0 50 1 1 O
ENDDRAW
ENDDEF
#
# HAL_MANUALTOOLCHANGE
#
DEF HAL_MANUALTOOLCHANGE hal_manualtoolchange. 0 40 Y Y 1 F N
F0 "hal_manualtoolchange." -50 300 59 H V C CNN
F1 "HAL_MANUALTOOLCHANGE" -100 200 50 H V C CNN
F2 "" 0 -100 50 H I C CNN
F3 "" 0 -100 50 H I C CNN
F4 "1" 450 200 50 H V C CNN "StripAnno"
F5 "-W hal_manualtoolchange" -50 100 50 H V C CNN "LoadUsr"
DRAW
S -600 -450 500 50 1 1 0 N
S 500 50 -600 250 1 1 0 f
X change 1 -700 -50 100 R 0 50 1 0 I
X change_button 2 -700 -200 100 R 0 50 1 0 I
X changed 3 600 -50 100 L 0 50 1 0 O
X number 4 -700 -350 100 R 0 50 1 0 I
ENDDRAW
ENDDEF
#
# HM2_BOARD
#
DEF HM2_BOARD [HM2](C0). 0 20 N Y 1 F N
F0 "[HM2](C0)." 0 500 50 H V C CNN
F1 "HM2_BOARD" 0 400 50 H V C CNN
F2 "" 550 -200 50 H I C CNN
F3 "" 550 -200 50 H I C CNN
F4 "1" 400 400 50 H V C CNN "StripAnno"
DRAW
S -450 350 450 -550 0 1 0 N
S 450 350 -450 450 0 1 0 f
X watchdog.timeout_ns 8 -550 50 157 R 50 50 1 0 I I
X watchdog.has_bit 1 550 -50 100 L 50 50 1 1 O
X led.CR01 2 -550 300 100 R 50 50 1 1 I
X led.CR02 3 -550 200 100 R 50 50 1 1 I
X read 4 -550 -150 100 R 50 50 1 1 W C
X *read_gpio 5 -550 -350 100 R 50 50 1 1 W NC
X write 6 -550 -250 100 R 50 50 1 1 W C
X *write_gpio 7 -550 -450 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# HM2_GPIO
#
DEF HM2_GPIO [HM2](C0).gpio.000. 0 40 N Y 1 F N
F0 "[HM2](C0).gpio.000." 0 300 50 H V C CNN
F1 "HM2_GPIO" -50 200 50 H V C CNN
F2 "" 150 -250 50 H I C CNN
F3 "" 150 -250 50 H I C CNN
F4 "1" 350 200 50 H V C CNN "StripAnno"
DRAW
S -400 150 400 250 0 1 0 f
S 400 150 -400 -350 0 1 0 N
X in 1 500 100 100 L 50 50 1 1 O
X in_not 2 500 0 100 L 50 50 1 1 O
X invert_output 3 -500 -200 157 R 50 50 1 1 I I
X is_opendrain 4 -500 -300 157 R 50 50 1 1 I I
X is_output 5 -500 -100 157 R 50 50 1 1 I I
X out 6 -500 100 100 R 50 50 1 1 I
ENDDRAW
ENDDEF
#
# HM2_PWMGEN
#
DEF HM2_PWMGEN [HM2](C0).pwmgen. 0 40 N Y 1 F N
F0 "[HM2](C0).pwmgen." 0 550 50 H V C CNN
F1 "HM2_PWMGEN" 0 450 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
F4 "1" 450 450 50 H V C CNN "StripAnno"
DRAW
S -450 400 500 100 1 1 0 N
S -450 500 500 400 1 1 0 f
X pdm_frequency 1 -550 200 157 R 50 50 1 1 I I
X pwm_frequency 2 -550 300 157 R 50 50 1 1 I I
ENDDRAW
ENDDEF
#
# HM2_PWMGEN_N
#
DEF HM2_PWMGEN_N [HM2](C0).pwmgen.00. 0 40 N Y 1 F N
F0 "[HM2](C0).pwmgen.00." 0 650 50 H V C CNN
F1 "HM2_PWMGEN_N" 0 550 50 H V C CNN
F2 "" 0 -250 50 H I C CNN
F3 "" 0 -250 50 H I C CNN
F4 "1" 450 550 50 H V C CNN "StripAnno"
DRAW
S -450 500 500 -700 1 1 0 N
S -450 600 500 500 1 1 0 f
X value 1 -550 400 100 R 50 50 1 1 I
X enable 2 -550 300 100 R 50 50 1 1 I
X scale 3 -550 150 157 R 50 50 1 1 I I
X output-type 4 -550 0 157 R 50 50 1 1 I I
X out0.invert_output 5 -550 -250 157 R 50 50 1 1 I I
X out1.invert_output 6 -550 -500 157 R 50 50 1 1 I I
X offset-mode 7 -550 -100 157 R 50 50 1 1 I I
X out0.is_opendrain 8 -550 -350 157 R 50 50 1 1 I I
X out1.is_opendrain 9 -550 -600 157 R 50 50 1 1 I I
ENDDRAW
ENDDEF
#
# HM2_STEPGEN
#
DEF HM2_STEPGEN [HM2](C0).stepgen.00. 0 20 N Y 1 F N
F0 "[HM2](C0).stepgen.00." -50 900 50 H V C CNN
F1 "HM2_STEPGEN" -50 800 50 H V C CNN
F2 "" 0 500 50 H I C CNN
F3 "" 0 500 50 H I C CNN
F4 "1" 400 800 50 H V C CNN "StripAnno"
DRAW
S -500 750 450 -1250 0 1 0 N
S -500 850 450 750 0 1 0 f
X control-type 1 -600 500 100 R 50 50 1 1 I
X position-scale 10 -600 -50 157 R 50 50 1 1 I I
X step_type 11 -600 -1150 157 R 50 50 1 1 I I
X steplen 12 -600 -200 157 R 50 50 1 1 I I
X stepspace 13 -600 -300 157 R 50 50 1 1 I I
X step.invert_output 14 -600 -400 157 R 50 50 1 1 I I
X direction.invert_output 15 -600 -750 157 R 50 50 1 1 I I
X velocity-cmd 16 -600 200 100 R 50 50 1 1 I
X velocity-fb 17 550 100 100 L 50 50 1 1 O
X counts 2 550 650 100 L 50 50 1 1 O
X dirhold 3 -600 -650 157 R 50 50 1 1 I I
X dirsetup 4 -600 -550 157 R 50 50 1 1 I I
X enable 5 -600 650 100 R 50 50 1 1 I
X maxaccel 6 -600 -1000 157 R 50 50 1 1 I I
X maxvel 7 -600 -900 157 R 50 50 1 1 I I
X position-cmd 8 -600 400 100 R 50 50 1 1 I
X position-fb 9 550 300 100 L 50 50 1 1 O
ENDDRAW
ENDDEF
#
# IOCONTROL
#
DEF IOCONTROL iocontrol.0. 0 40 N Y 1 F N
F0 "iocontrol.0." 0 700 59 H V C CNN
F1 "IOCONTROL" 0 600 50 H V C CNN
F2 "" -100 200 50 H I C CNN
F3 "" -100 200 50 H I C CNN
F4 "1" 650 600 50 H V C CNN "StripAnno"
DRAW
S -750 550 700 650 1 1 0 f
S 700 550 -750 -950 1 1 0 N
X coolant-flood 1 800 -50 100 L 0 50 1 0 O
X tool-prep-pocket 10 800 -750 100 L 0 50 1 0 O
X tool-prepare 11 800 -550 100 L 0 50 1 0 O
X tool-prepared 12 -850 -550 100 R 0 50 1 0 I
X user-enable-out 13 800 450 100 L 0 50 1 0 O
X user-request-enable 14 800 350 100 L 0 50 1 0 O
X coolant-mist 2 800 -150 100 L 0 50 1 0 O
X emc-enable-in 3 -850 450 100 R 0 50 1 0 I
X lube 4 800 150 100 L 0 50 1 0 O
X lube-level 5 -850 150 100 R 0 50 1 0 I
X tool-change 6 800 -850 100 L 0 50 1 0 O
X tool-changed 7 -850 -850 100 R 0 50 1 0 I
X tool-number 8 800 -350 100 L 0 50 1 0 O
X tool-prep-number 9 800 -650 100 L 0 50 1 0 O
X tool-prep-index 15 800 -450 157 L 50 50 1 1 O I
ENDDRAW
ENDDEF
#
# JOINT_N
#
DEF JOINT_N joint.0. 0 40 N Y 1 F N
F0 "joint.0." 0 800 50 H V C CNN
F1 "JOINT_N" 0 700 50 H V C CNN
F2 "" 1050 150 50 H I C CNN
F3 "" 1050 150 50 H I C CNN
F4 "1" 700 700 50 H V C CNN "StripAnno"
DRAW
S -700 650 750 -1500 0 1 0 N
S -700 650 750 750 0 1 0 f
X jog-enable 1 -800 -950 100 R 50 50 1 1 I
X motor-pos-cmd 10 850 550 100 L 50 50 1 1 O
X jog-vel-mode 11 -800 -1150 100 R 50 50 1 1 I
X jog-scale 12 -800 -1050 100 R 50 50 1 1 I
X active 13 850 50 100 L 50 50 1 1 O
X jog-counts 14 -800 -850 100 R 50 50 1 1 I
X jog-accel-fraction 15 -800 -750 100 R 50 50 1 1 I
X is-unlocked 16 -800 -600 100 R 50 50 1 1 I
X index-enable 17 -800 -450 100 R 50 50 1 1 B
X homing 18 850 -450 100 L 50 50 1 1 O
X homed 19 850 -350 100 L 50 50 1 1 O
X unlock 2 850 -600 100 L 50 50 1 1 O
X home-sw-in 20 -800 -350 100 R 50 50 1 1 I
X faulted 21 850 -150 100 L 50 50 1 1 O
X error 22 850 -50 100 L 50 50 1 1 O
X amp-fault-in 23 -800 -150 100 R 50 50 1 1 I
X amp-enable-out 24 850 450 100 L 50 50 1 1 O
X pos-lim-sw-in 3 -800 -1400 100 R 50 50 1 1 I
X pos-hard-limit 4 850 -1400 100 L 50 50 1 1 O
X pos-fb 5 850 200 100 L 50 50 1 1 O
X pos-cmd 6 850 300 100 L 50 50 1 1 O
X neg-lim-sw-in 7 -800 -1300 100 R 50 50 1 1 I
X neg-hard-limit 8 850 -1300 100 L 50 50 1 1 O
X motor-pos-fb 9 -800 550 100 R 50 50 1 1 I
ENDDRAW
ENDDEF
#
# LOADRT
#
DEF LOADRT loadrt.0. 0 0 N N 1 F N
F0 "loadrt.0." 0 250 50 H V C CNN
F1 "LOADRT" -50 150 50 H V C CNN
F2 "" 800 -500 50 H I C CNN
F3 "" 800 -500 50 H I C CNN
F4 "Component + options go here" -250 50 50 H V L CNN "LoadRT"
F5 "1" 250 150 50 H V C CNN "StripAnno"
DRAW
P 2 0 0 0 300 100 950 100 N
P 2 0 0 0 300 200 300 100 N
P 3 0 0 0 -300 100 -300 0 950 0 N
P 4 0 1 0 300 200 -300 200 -300 100 300 100 f
ENDDRAW
ENDDEF
#
# LOADUSR
#
DEF LOADUSR loadusr.0. 0 0 N N 1 F N
F0 "loadusr.0." 0 250 50 H V C CNN
F1 "LOADUSR" -50 150 50 H V C CNN
F2 "" 850 -500 50 H I C CNN
F3 "" 850 -500 50 H I C CNN
F4 "Module + options go here" -250 50 50 H V L CNN "LoadUsr"
F5 "1" 250 150 50 H V C CNN "StripAnno"
DRAW
P 2 1 1 0 300 100 850 100 N
P 2 1 1 0 300 200 300 100 N
P 3 1 1 0 -300 100 -300 0 850 0 N
P 4 1 1 0 300 200 -300 200 -300 100 300 100 f
ENDDRAW
ENDDEF
#
# LOGIC
#
DEF LOGIC logic.0. 0 20 N Y 1 F N
F0 "logic.0." 0 650 50 H V C CNN
F1 "LOGIC" 0 550 50 H V C CNN
F2 "" 350 -200 50 H I C CNN
F3 "" 350 -200 50 H I C CNN
F4 "1" 300 550 50 H V C CNN "StripAnno"
F5 "+ personality=0x108" -50 -550 50 H V C CNN "LoadRT"
DRAW
T 0 -50 400 50 0 0 0 " 100" Normal 0 L C
T 0 -50 300 50 0 0 0 " 200" Normal 0 L C
T 0 -50 200 50 0 0 0 " 400" Normal 0 L C
T 0 -50 100 50 0 0 0 " 800" Normal 0 L C
T 0 -50 0 50 0 0 0 1000 Normal 0 L C
S 350 500 -400 600 0 1 0 f
S -400 500 350 -500 1 1 0 N
X in-00 1 -500 400 100 R 50 50 1 1 I
X or 10 450 300 100 L 50 50 1 1 O
X xor 11 450 200 100 L 50 50 1 1 O
X nand 12 450 100 100 L 50 50 1 1 O
X nor 13 450 0 100 L 50 50 1 1 O
X _ 14 -500 -400 100 R 50 50 1 1 W NC
X in-01 2 -500 300 100 R 50 50 1 1 I
X in-02 3 -500 200 100 R 50 50 1 1 I
X in-03 4 -500 100 100 R 50 50 1 1 I
X in-04 5 -500 0 100 R 50 50 1 1 I
X in-05 6 -500 -100 100 R 50 50 1 1 I
X in-06 7 -500 -200 100 R 50 50 1 1 I
X in-07 8 -500 -300 100 R 50 50 1 1 I
X and 9 450 400 100 L 50 50 1 1 O
ENDDRAW
ENDDEF
#
# LOGITECH_GAMEPAD_GUF13A
#
DEF LOGITECH_GAMEPAD_GUF13A input.0. 0 40 N Y 2 L N
F0 "input.0." 0 1850 50 H V C CNN
F1 "LOGITECH_GAMEPAD_GUF13A" -50 1750 50 H V C CNN
F2 "" 5500 3600 50 H I C CNN
F3 "" 5500 3600 50 H I C CNN
F4 "1" 550 1750 50 H V C CNN "StripAnno"
F5 "-W hal_input -KA Dual" -50 1650 50 H V C CNN "LoadUsr"
DRAW
T 0 -350 1400 59 0 2 1 1 Normal 0 L B
T 0 -400 -1300 59 0 2 1 10 Normal 0 L B
T 0 -350 1100 59 0 2 1 2 Normal 0 L B
T 0 -350 800 59 0 2 1 3 Normal 0 L B
T 0 -350 500 59 0 2 1 4 Normal 0 L B
T 0 -350 200 59 0 2 1 5 Normal 0 L B
T 0 -350 -100 59 0 2 1 6 Normal 0 L B
T 0 -350 -400 59 0 2 1 7 Normal 0 L B
T 0 -350 -700 59 0 2 1 8 Normal 0 L B
T 0 -350 -1000 59 0 2 1 9 Normal 0 L B
T 0 -550 -1600 59 0 2 1 "L Push" Normal 0 L B
T 0 -550 -1900 59 0 2 1 "R Push" Normal 0 L B
S -850 -1400 750 1600 1 1 0 N
S 750 1600 -850 1800 1 1 0 f
S -650 1600 600 1800 2 1 0 f
S 600 -1950 -650 1600 2 1 0 N
X abs-z-offset 1 -950 -500 100 R 0 50 1 1 I
X abs-z-is-pos 11 850 -700 100 L 0 50 1 1 O
X abs-z-is-neg 12 850 -800 100 L 0 50 1 1 O
X abs-z-fuzz 13 -950 -800 100 R 0 50 1 1 I
X abs-z-flat 14 -950 -700 100 R 0 50 1 1 I
X abs-z-counts 15 850 -500 100 L 0 50 1 1 O
X abs-y-scale 16 -950 -100 100 R 0 50 1 1 I
X abs-y-position 17 850 -100 100 L 0 50 1 1 O
X abs-y-offset 18 -950 0 100 R 0 50 1 1 I
X abs-y-is-pos 28 850 -200 100 L 0 50 1 1 O
X abs-hat0y-flat 37 -950 800 100 R 0 50 1 1 I
X abs-rz-flat 38 -950 -1200 100 R 0 50 1 1 I
X abs-rz-counts 39 850 -1000 100 L 0 50 1 1 O
X abs-hat0y-scale 40 -950 900 100 R 0 50 1 1 I
X abs-hat0y-position 41 850 900 100 L 0 50 1 1 O
X abs-hat0y-offset 42 -950 1000 100 R 0 50 1 1 I
X abs-hat0y-is-pos 43 850 800 100 L 0 50 1 1 O
X abs-hat0y-is-neg 44 850 700 100 L 0 50 1 1 O
X abs-hat0y-fuzz 45 -950 700 100 R 0 50 1 1 I
X abs-rz-fuzz 46 -950 -1300 100 R 0 50 1 1 I
X abs-hat0y-counts 47 850 1000 100 L 0 50 1 1 O
X abs-hat0x-scale 48 -950 1400 100 R 0 50 1 1 I
X abs-hat0x-position 49 850 1400 100 L 0 50 1 1 O
X abs-hat0x-offset 50 -950 1500 100 R 0 50 1 1 I
X abs-hat0x-is-pos 51 850 1300 100 L 0 50 1 1 O
X abs-hat0x-is-neg 52 850 1200 100 L 0 50 1 1 O
X abs-hat0x-fuzz 53 -950 1200 100 R 0 50 1 1 I
X abs-hat0x-flat 54 -950 1300 100 R 0 50 1 1 I
X abs-x-is-neg 55 850 200 100 L 0 50 1 1 O
X abs-y-is-neg 56 850 -300 100 L 0 50 1 1 O
X abs-y-fuzz 57 -950 -300 100 R 0 50 1 1 I
X abs-y-flat 58 -950 -200 100 R 0 50 1 1 I
X abs-y-counts 59 850 0 100 L 0 50 1 1 O
X abs-x-scale 60 -950 400 100 R 0 50 1 1 I
X abs-x-position 61 850 400 100 L 0 50 1 1 O
X abs-x-offset 62 -950 500 100 R 0 50 1 1 I
X abs-x-is-pos 63 850 300 100 L 0 50 1 1 O
X abs-hat0x-counts 64 850 1500 100 L 0 50 1 1 O
X abs-x-fuzz 65 -950 200 100 R 0 50 1 1 I
X abs-x-flat 66 -950 300 100 R 0 50 1 1 I
X abs-x-counts 67 850 500 100 L 0 50 1 1 O
X abs-rz-scale 68 -950 -1100 100 R 0 50 1 1 I
X abs-rz-position 69 850 -1100 100 L 0 50 1 1 O
X abs-rz-offset 70 -950 -1000 100 R 0 50 1 1 I
X abs-rz-is-pos 71 850 -1200 100 L 0 50 1 1 O
X abs-rz-is-neg 72 850 -1300 100 L 0 50 1 1 O
X abs-z-scale 8 -950 -600 100 R 0 50 1 1 I
X abs-z-position 9 850 -600 100 L 0 50 1 1 O
X btn-base4 10 700 -1200 100 L 0 50 2 1 O
X btn-pinkie-not 19 700 -100 100 L 0 50 2 1 O
X btn-base3-not 2 700 -1000 100 L 0 50 2 1 O
X btn-top2-not 20 700 200 100 L 0 50 2 1 O
X btn-top2 21 700 300 100 L 0 50 2 1 O
X btn-top-not 22 700 500 100 L 0 50 2 1 O
X btn-top 23 700 600 100 L 0 50 2 1 O
X btn-thumb2-not 24 700 800 100 L 0 50 2 1 O
X btn-thumb2 25 700 900 100 L 0 50 2 1 O
X btn-thumb-not 26 700 1100 100 L 0 50 2 1 O
X btn-thumb 27 700 1200 100 L 0 50 2 1 O
X btn-pinkie 29 700 0 100 L 0 50 2 1 O
X btn-base3 3 700 -900 100 L 0 50 2 1 O
X btn-joystick-not 30 700 1400 100 L 0 50 2 1 O
X btn-joystick 31 700 1500 100 L 0 50 2 1 O
X btn-base6-not 32 700 -1900 100 L 0 50 2 1 O
X btn-base6 33 700 -1800 100 L 0 50 2 1 O
X btn-base5-not 34 700 -1600 100 L 0 50 2 1 O
X btn-base5 35 700 -1500 100 L 0 50 2 1 O
X btn-base4-not 36 700 -1300 100 L 0 50 2 1 O
X btn-base2-not 4 700 -700 100 L 0 50 2 1 O
X btn-base2 5 700 -600 100 L 0 50 2 1 O
X btn-base-not 6 700 -400 100 L 0 50 2 1 O
X btn-base 7 700 -300 100 L 0 50 2 1 O
ENDDRAW
ENDDEF
#
# MOTION
#
DEF MOTION motion. 0 40 N Y 1 F N
F0 "motion." 0 1550 59 H V C CNN
F1 "MOTION" 0 1450 50 H V C CNN
F2 "" 0 350 50 H I C CNN
F3 "" 0 350 50 H I C CNN
F4 "1" 600 1450 50 H V C CNN "StripAnno"
DRAW
S -600 1400 650 -1100 1 1 0 N
S 650 1400 -600 1500 1 1 0 f
X feed-hold 1 -700 1000 100 R 0 50 1 0 I
X coord-mode 10 750 950 100 L 0 50 1 0 O
X distance-to-go 11 750 350 100 L 0 50 1 0 O
X probe-input 12 -700 600 100 R 0 50 1 0 I
X in-position 13 750 1300 100 L 0 50 1 0 O
X adaptive-feed 14 -700 800 100 R 0 50 1 0 I
X enable 15 -700 1300 100 R 0 50 1 0 I
X digital-out-03 16 750 -750 100 L 0 50 1 0 O
X digital-out-02 17 750 -650 100 L 0 50 1 0 O
X digital-out-01 18 750 -550 100 L 0 50 1 0 O
X digital-out-00 19 750 -450 100 L 0 50 1 0 O
X homing-inhibit 2 -700 450 100 R 0 50 1 0 I
X analog-out-00 20 750 -200 100 L 0 50 1 0 O
X analog-out-01 21 750 -300 100 L 0 50 1 0 O
X digital-in-03 22 -700 -750 100 R 0 50 1 0 I
X digital-in-02 23 -700 -650 100 R 0 50 1 0 I
X digital-in-01 24 -700 -550 100 R 0 50 1 0 I
X analog-in-00 25 -700 -200 100 R 0 50 1 0 I
X analog-in-01 26 -700 -300 100 R 0 50 1 0 I
X digital-in-00 27 -700 -450 100 R 0 50 1 0 I
X feed-inhibit 3 -700 900 100 R 0 50 1 0 I
X on-soft-limit 30 750 -50 100 L 0 50 1 0 O
X requested-vel 31 750 500 100 L 0 50 1 0 O
X teleop-mode 32 750 750 100 L 0 50 1 0 O
X motion-type 4 750 1100 100 L 0 50 1 0 O
X motion-enabled 5 750 1200 100 L 0 50 1 0 O
X offset-limited 6 750 100 100 L 0 50 1 0 O
X current-vel 7 750 600 100 L 0 50 1 0 O
X coord-error 8 750 850 100 L 0 50 1 0 O
X offset-active 9 750 200 100 L 0 50 1 0 O
X /motion-controller 28 -700 -1000 100 R 50 50 1 1 W C
X /motion-command-handler 29 -700 -900 100 R 50 50 1 1 W C
ENDDRAW
ENDDEF
#
# MUX2
#
DEF MUX2 mux2. 0 20 N Y 1 F N
F0 "mux2." 0 300 50 H V C CNN
F1 "MUX2" 0 200 50 H V C CNN
F2 "" 350 -150 50 H I C CNN
F3 "" 350 -150 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
S -150 150 150 -250 0 1 0 N
S 150 150 -150 250 0 1 0 f
X in0 1 -250 100 100 R 50 50 1 1 I
X in1 2 -250 0 100 R 50 50 1 1 I
X sel 3 -250 -200 100 R 50 50 1 1 I
X out 4 250 100 100 L 50 50 1 1 O
X _ 5 -250 -100 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# MUX4
#
DEF MUX4 mux4. 0 20 N Y 1 F N
F0 "mux4." 0 450 50 H V C CNN
F1 "MUX4" 0 350 50 H V C CNN
F2 "" 400 -100 50 H I C CNN
F3 "" 400 -100 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
S 150 300 -150 400 0 1 0 f
S -150 300 150 -400 1 1 0 N
X in0 1 -250 250 100 R 50 50 1 1 I
X in1 2 -250 150 100 R 50 50 1 1 I
X in2 3 -250 50 100 R 50 50 1 1 I
X in3 4 -250 -50 100 R 50 50 1 1 I
X sel0 5 -250 -250 100 R 50 50 1 1 I
X sel1 6 -250 -350 100 R 50 50 1 1 I
X out 7 250 250 100 L 50 50 1 1 O
X _ 8 -250 -150 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# MUX8
#
DEF MUX8 mux8. 0 20 N Y 1 F N
F0 "mux8." 0 750 50 H V C CNN
F1 "MUX8" 0 650 50 H V C CNN
F2 "" 350 -100 50 H I C CNN
F3 "" 350 -100 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
S 150 600 -150 700 0 1 0 f
S -150 600 150 -600 1 1 0 N
X in0 1 -250 550 100 R 50 50 1 1 I
X sel1 10 -250 -450 100 R 50 50 1 1 I
X sel2 11 -250 -550 100 R 50 50 1 1 I
X _ 12 -250 -250 100 R 50 50 1 1 W NC
X in1 2 -250 450 100 R 50 50 1 1 I
X in2 3 -250 350 100 R 50 50 1 1 I
X in3 4 -250 250 100 R 50 50 1 1 I
X in4 5 -250 150 100 R 50 50 1 1 I
X in5 6 -250 50 100 R 50 50 1 1 I
X in6 7 -250 -50 100 R 50 50 1 1 I
X out 7 250 550 100 L 50 50 1 1 O
X in7 8 -250 -150 100 R 50 50 1 1 I
X sel0 9 -250 -350 100 R 50 50 1 1 I
ENDDRAW
ENDDEF
#
# NOT
#
DEF NOT not. 0 0 N N 1 F N
F0 "not." 100 150 50 H V C CNN
F1 "NOT" 0 0 50 H V C CNN
F2 "" 350 -250 50 H I C CNN
F3 "" 350 -250 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
C 225 0 25 0 1 0 f
P 4 1 0 10 -100 150 -100 -150 200 0 -100 150 f
X in 1 -250 0 150 R 50 50 1 1 I
X out 2 450 0 197 L 50 50 1 1 O
X _ 3 -200 -100 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# OR2
#
DEF OR2 or2. 0 0 N N 1 F N
F0 "or2." 0 200 50 H V C CNN
F1 "OR2" 0 0 50 H V C CNN
F2 "" 50 0 50 H I C CNN
F3 "" 50 0 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
A -360 0 258 354 -354 1 1 10 N -150 150 -150 -150
A -47 -52 204 150 837 1 1 10 f 150 0 -24 150
A -47 52 204 -150 -837 1 1 10 f 150 0 -24 -150
P 2 1 1 10 -150 -150 -25 -150 f
P 2 1 1 10 -150 150 -25 150 f
P 12 1 1 -1000 -25 150 -150 150 -150 150 -140 134 -119 89 -106 41 -103 -10 -109 -59 -125 -107 -150 -150 -150 -150 -25 -150 f
X in0 1 -300 100 177 R 50 50 1 1 I
X in1 2 -300 -100 177 R 50 50 1 1 I
X out 3 300 0 150 L 50 50 1 1 O
X _ 4 -200 0 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# PARAMETER
#
DEF PARAMETER parameter. 0 0 N N 1 F N
F0 "parameter." 0 100 50 H I C CNN
F1 "PARAMETER" 200 0 50 H V R CNN
F2 "" 300 0 50 H I C CNN
F3 "" 300 0 50 H I C CNN
DRAW
P 4 1 1 0 -350 50 300 50 300 -50 -350 -50 N
X out 1 400 0 154 L 50 50 1 0 O I
ENDDRAW
ENDDEF
#
# PID
#
DEF PID pid.0. 0 40 N Y 1 F N
F0 "pid.0." 0 1400 50 H V C CNN
F1 "PID" 0 1300 50 H V C CNN
F2 "" 750 600 50 H I C CNN
F3 "" 750 600 50 H I C CNN
F4 "1" 600 1300 50 H V C CNN "StripAnno"
DRAW
S -550 1250 650 -1750 0 0 0 N
S 650 1250 -550 1350 0 0 0 f
X do-pid-calcs 1 -650 -1650 100 R 0 50 1 0 I C
X maxerrorD 10 -650 -1000 100 R 0 50 1 0 I
X maxerror 11 -650 -900 100 R 0 50 1 0 I
X maxcmdDDD 12 -650 -1450 100 R 0 50 1 0 I
X maxcmdDD 13 -650 -1350 100 R 0 50 1 0 I
X maxcmdD 14 -650 -1250 100 R 0 50 1 0 I
X index-enable 15 -650 600 100 R 0 50 1 0 I
X Igain 16 -650 100 100 R 0 50 1 0 I
X FF3 17 -650 -450 100 R 0 50 1 0 I
X FF2 18 -650 -350 100 R 0 50 1 0 I
X FF1 19 -650 -250 100 R 0 50 1 0 I
X command 2 -650 950 100 R 0 50 1 0 I
X FF0 20 -650 -150 100 R 0 50 1 0 I
X feedback-deriv 21 -650 1100 100 R 0 50 1 0 I
X feedback 22 -650 1200 100 R 0 50 1 0 I
X error-previous-target 23 -650 -650 100 R 0 50 1 0 I
X error 24 750 850 100 L 0 50 1 0 O
X enable 25 -650 700 100 R 0 50 1 0 I
X Dgain 26 -650 0 100 R 0 50 1 0 I
X deadband 27 -650 350 100 R 0 50 1 0 I
X command-deriv 28 -650 850 100 R 0 50 1 0 I
X bias 29 -650 450 100 R 0 50 1 0 I
X saturated-s 3 750 600 100 L 0 50 1 0 O
X saturated-count 4 750 500 100 L 0 50 1 0 O
X saturated 5 750 700 100 L 0 50 1 0 O
X Pgain 6 -650 200 100 R 0 50 1 0 I
X output 7 750 950 100 L 0 50 1 0 O
X maxoutput 8 -650 -750 100 R 0 50 1 0 I
X maxerrorI 9 -650 -1100 100 R 0 50 1 0 I
ENDDRAW
ENDDEF
#
# SCALE
#
DEF SCALE scale. 0 20 N Y 1 F N
F0 "scale." 0 300 50 H V C CNN
F1 "SCALE" 0 200 50 H V C CNN
F2 "" 550 -350 50 H I C CNN
F3 "" 550 -350 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
S 150 150 -150 250 0 1 0 f
S -150 150 150 -250 1 1 0 N
X in 1 -250 100 100 R 50 50 1 1 I
X gain 2 -250 -100 100 R 50 50 1 1 I
X offset 3 -250 -200 100 R 50 50 1 1 I
X out 4 250 100 100 L 50 50 1 1 O
X _ 5 -250 0 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# SPINDLE
#
DEF SPINDLE spindle.0. 0 40 N Y 1 F N
F0 "spindle.0." -50 900 50 H V C CNN
F1 "SPINDLE" -50 800 50 H V C CNN
F2 "" -50 100 50 H I C CNN
F3 "" -50 100 50 H I C CNN
F4 "1" 550 800 50 H V C CNN "StripAnno"
DRAW
S -650 750 600 -1000 1 1 0 N
S 600 750 -650 850 1 1 0 f
X at-speed 1 -750 -650 100 R 0 50 1 1 I
X index-enable 10 -750 200 100 R 0 50 1 1 B
X amp-fault-in 11 -750 -200 100 R 0 50 1 1 I
X speed-out-abs 12 700 -700 100 L 0 50 1 1 O
X speed-out-rps-abs 13 700 -900 100 L 0 50 1 1 O
X speed-out-rps 14 700 -800 100 L 0 50 1 1 O
X speed-cmd-rps 15 700 -450 100 L 0 50 1 1 O
X orient-mode 16 700 -200 100 L 0 50 1 1 O
X orient-angle 17 700 -100 100 L 0 50 1 1 O
X speed-in 18 -750 -550 100 R 0 50 1 1 I
X revs 19 -750 -300 100 R 0 50 1 1 I
X speed-out 2 700 -550 100 L 0 50 1 1 O
X orient-fault 20 -750 -50 100 R 0 50 1 1 I
X is-oriented 21 -750 50 100 R 0 50 1 1 I
X orient 3 700 0 100 L 0 50 1 1 O
X locked 4 700 200 100 L 0 50 1 1 O
X reverse 5 700 450 100 L 0 50 1 1 O
X on 6 700 650 100 L 0 50 1 1 O
X forward 7 700 550 100 L 0 50 1 1 O
X brake 8 700 350 100 L 0 50 1 1 O
X inhibit 9 -750 650 100 R 0 50 1 1 I
ENDDRAW
ENDDEF
#
# THREAD
#
DEF THREAD name-thread. 0 40 N Y 1 F N
F0 "name-thread." 0 550 59 H V C CNN
F1 "THREAD" 0 450 50 H V C CNN
F2 "" 100 100 50 H I C CNN
F3 "" 100 100 50 H I C CNN
F4 "1" 400 450 50 H V C CNN "StripAnno"
DRAW
T 0 300 350 50 0 0 0 "First in thread" Normal 0 R C
T 0 250 -350 50 0 0 0 "Last in thread" Normal 0 R C
T 0 300 0 50 0 0 0 "Sorted by ref" Normal 0 R C
S -450 400 450 500 0 1 0 f
S 450 -450 -450 400 0 1 0 N
X 1 1 550 350 100 L 0 50 1 0 w C
X 2 2 550 250 100 L 0 50 1 0 w C
X 3 3 550 150 100 L 0 50 1 0 w C
X _ 4 550 0 100 L 0 50 1 0 w C
X -3 5 550 -150 100 L 0 50 1 0 w C
X -2 6 550 -250 100 L 0 50 1 0 w C
X -1 7 550 -350 100 L 0 50 1 0 w C
ENDDRAW
ENDDEF
#
# TIMEDELAY
#
DEF TIMEDELAY timedelay. 0 20 N Y 1 F N
F0 "timedelay." 0 350 50 H V C CNN
F1 "TIMEDELAY" 0 250 50 H V C CNN
F2 "" 0 150 50 H I C CNN
F3 "" 0 150 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
S 250 200 -250 300 0 1 0 f
S -250 200 250 -200 1 1 0 N
X in 1 -350 150 100 R 50 50 1 1 I
X on-delay 2 -350 -50 100 R 50 50 1 1 I
X off-delay 3 -350 -150 100 R 50 50 1 1 I
X out 4 350 150 100 L 50 50 1 1 O
X elapsed 5 350 50 100 L 50 50 1 1 O
X _ 6 -350 50 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# TOGGLE
#
DEF TOGGLE toggle. 0 20 N Y 1 F N
F0 "toggle." 0 300 50 H V C CNN
F1 "TOGGLE" 0 200 50 H V C CNN
F2 "" 300 -50 50 H I C CNN
F3 "" 300 -50 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
S 250 150 -200 250 0 1 0 f
S -200 150 250 -150 1 1 0 N
X in 1 -300 100 100 R 50 50 1 1 I
X out 2 350 100 100 L 50 50 1 1 O
X debounce 4 -250 -100 100 R 50 50 1 1 I I
X _ 5 -300 0 100 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
# XOR2
#
DEF XOR2 xor2. 0 0 N N 1 F N
F0 "xor2." -50 200 50 H V C CNN
F1 "XOR2" 25 0 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
F4 "+" 0 0 50 H I C CNN "LoadRT"
DRAW
A -385 0 258 354 -354 1 1 10 N -175 150 -175 -150
A -360 0 258 354 -354 1 1 10 N -150 150 -150 -150
A -47 -52 204 150 837 1 1 10 f 150 0 -24 150
A -47 52 204 -150 -837 1 1 10 f 150 0 -24 -150
P 2 1 1 10 -150 -150 -25 -150 f
P 2 1 1 10 -150 150 -25 150 f
P 12 1 1 -1000 -25 150 -150 150 -150 150 -140 134 -119 89 -106 41 -103 -10 -109 -59 -125 -107 -150 -150 -150 -150 -25 -150 f
X in0 1 -350 100 228 R 50 50 1 1 I
X in1 2 -350 -100 228 R 50 50 1 1 I
X out 3 300 0 150 L 50 50 1 1 O
X _ 4 -250 0 150 R 50 50 1 1 W NC
ENDDRAW
ENDDEF
#
#End Library
view raw LinuxCNC-HAL.lib hosted with ❤ by GitHub