Anastasios Moraitis

Confused by the CPU12 Reference Manual

Discussion created by Anastasios Moraitis on Feb 20, 2006
Latest reply on Feb 21, 2006 by Steve Mcaslan
Hello all,

I am trying to write a fuzzy controller and I have noticed an ambiguity in the CPU12 Reference Manual. In Section 6(Instruction Glossary) of the RM, page 243, in the "MEM" instruction it writes:

"a 4-byte data structure that describes a trapezoidal
membership function. The data structure consists of:
• Point_1 — The x-axis starting point for the leading side (at MX)
• Slope_1 — The slope of the leading side (at MX+1)
• Point_2 — The x-axis position of the rightmost point (at MX+2)
• Slope_2 — The slope of the trailing side (at MX+3); the right side
slopes up and to the left from point_2 "

And in Section 9(fuzzy logic support) of the RM, page 341, it writes (figure 9-4)

"ADDR $40 X-POSITION OF point_1
ADDR+1 $D0 X-POSITION OF point_2
ADDR+2 $08 slope_1 ($FF/(X-POS OF SATURATION – point_1))
ADDR+3 $04 slope_2 ($FF/(point_2 – X-POS OF SATURATION))"

So what is the right format for the membership function's data structure,


Thank you all in advance,