M1 Build Questions

Support forum for users of the M1 Build

M1 Build Questions

Postby Fast_Moto on Tue Dec 10, 2013 10:06 am

I had a couple of questions and suggestions re M1 Build and noticed a possible bug. I could have answered some questions myself if the example build were available as an M1 Tune example.

(1) Possible Bug
“Mode Value” Selection in Properties Window. When I select “Constant” as the “Mode Input Object” for the following modules, the mode selection window does not appear in the “Properties” section.
i. Input: Normalized with Tracking
ii. Input: Sensor

(2) Assigned Default Values For Groups
a. I noticed that a group can be assigned the output of a child object as a default. If that is done, the group can be logged.
Question: If a default value is assigned, is the Group visible in M1 Tune just like a channel?

b. I noticed that in the example build, the developer created a group for the coolant temperature called “Coolant.Temperature”. However, rather than assigning the “Sensor” output as the default value for the “Temperature” sub-group, the developer created a “Value” channel, updates it with a function to contain the “Sensor” value, and then assigns the “Value” channel as the default value for the “Temperature” sub-group.
Question: Assuming that a group with an assigned default is visible just like a channel in M1 Tune, what is the advantage of going through these steps instead of just assigning the “Sensor” as the default value in this case?

(3) Sensors
a. Update Events
The Motec “Sensor” Module has two updates, a voltage event and an event.
Question 1: What is the difference between the two?
Question 2: Does one affect the other?

b. Fixed Update Events
I noticed that the Speed Sensor Update Events (Period update and calculation) are fixed to 100Hz.
Question: Is it possible to increase that to a higher frequency?

c. Multiple use of a resource
In some instances (engine speed for example), there will be an object (e.g., reference speed) using a IO resource as an input. For diagnostic purposes, a UDIG Voltage and Universal Digital Input object are assigned to use the reference as their resource object.
Question: In that case, is the update rate of the object that is assigned the IO resource (here “Reference”) an implicit maximum limit on the update rates of other classes that are merely assigned the other object (here: “Reference”) as their “resource Object” (instead of the IO)??

(4) Ref-Sync
I would like to have some more clarity regarding the ref-sync setup. For the “Camshaft” and “Alternate Reference” objects located under “Hardware, Digital Input” objects, there is no way to configure the active edge, threshold, hysteresis, and debounce in that particular object. In the example build file, these appear to be configured by the “Universal Digital Input” object located under “Hardware, Configuration.”
Question 1: Is that the correct way of configuring all digital inputs? It would have helped me if this had been more clear in the documentation (or at least the description of the camshaft/reference) object.
Question 2: Why are the Digital Inputs handled differently from other inputs (like AT/AV)?

(5) General
Question: What does the “get statistics event” refer to?

(6) Logging
I understand that the diagnostic logging can only be activated using a channel of the “data type” “logging mode.”
Question: Does the M1 interface still allow you to select any “active” channel to activate a logging system? Or do you also need to use a channel of the “data type” “logging mode”?

(7) Table Lookup
I would like to do a Table Lookup as part of a Offset Calibration. The problem is that the Calibration function cannot perform a Lookup (or reverse lookup on a "parent" table). This also applies to schedule functions. Is there a way around that?

(8) Derivatives
I would like to derive velocity from suspension position.
Question: Which derivative function do you recommend for that purpose? (Adaptive, filtered, or normal)?
Fast_Moto
 
Posts: 111
Joined: Mon Apr 19, 2010 12:49 pm

Re: M1 Build Questions

Postby Fast_Moto on Wed Dec 11, 2013 5:04 am

Another possible bug report.

When creating a function, I have been unable to assign a value to a channel on the same hierarchy level (i.e. under the same group). The function did not see the channel. I move the function below (not into) another group (on the same hierarchy level). The function then saw the channel and I could perform the function. This was true even if I moved the function back to its original position.
Fast_Moto
 
Posts: 111
Joined: Mon Apr 19, 2010 12:49 pm

Re: M1 Build Questions

Postby YuriK on Wed Dec 11, 2013 9:44 am

Thank you for your input! We'll investigate the bugs and will post our thoughts.
YuriK
 
Posts: 78
Joined: Fri Nov 26, 2010 8:16 am

Re: M1 Build Questions

Postby YuriK on Thu Dec 12, 2013 3:34 pm

Hi,
here are some answers to the question you've raised :
1. “Mode Value” Selection in Properties Window - when you select Constant it means the mode is "Enabled" and there is no way to change it later in the tune, so there is no reason to enable the dropdown list.
2. Assigned Default Values For Groups
a. You are right a group can be assigned a value and then it looks like a channel in M1 Tune
b. The way it is done in the example is what we consider a good coding practice that makes code more flexible and structural. You can read more about this in the "M1 Build example project" help document
3.Sensors
a. Update events : "Voltage Event" is the when the actual voltage in the pin is measured
"Event" is when the actual voltage is converted into the channel value

b. Fixed Update Events": Speed Sensor update rate is fixed at 100Hz because this should be sufficient for this
type of sensor. If there is a need to increase this rate the appropriate request with should
be submitted to MoTeC and we'll discuss the options.
c. Multiple use of the resource: In the Engine Speed example Pin update rate is implicitly limited by Reference
update rate because Pin performs lookup in Hysteresis and Debounce tables
based on Engine Speed value which is a property of Reference object.
Voltage update rate however is not limited by the Reference update rate.

4. Ref - Sync : This functionality is explained in the "M1 Build example project" help document starting form page 7
5. Get statistics event is used for calculating Minimum and Maximum values.
6. Logging functionality is described in M1 Development Manual (Help -> Manuals)starting from page 68.
7.Table lookup is not possible in the calibration function. Reverse lookup may be possible (sort of), depending on what exactly you have in mind.
8. Normal derivative is just a derivative. Filtered derivative is an average of current value and previous value. Adaptive derivative is filtered derivative, calculated using minimum delta and maximum time before derivative update.


Regarding the possible bug when you were unable to assign value to a channel on the same hierarchy level: could you send us an example code for this to support@motec.com.au ?

Regards!
YuriK
 
Posts: 78
Joined: Fri Nov 26, 2010 8:16 am

Re: M1 Build Questions

Postby Fast_Moto on Fri Dec 13, 2013 5:13 am

Yuri:
Thank you very much for your help. The documentation for M1 Build is really good, but it still takes a bit of effort to put it all together. There are just a lot of different references to rely upon.

Unfortunately, I cannot remember which of the scheduled functions suffered from the assignment issue. If you want, I could send you my build file in its current state. In any event, if I see the issue again, I will forward the code.

I have a couple of additional follow up questions.

Accessing Diagnostics of Pre-Built Sensor Modules
If I attempt to call the sensor diagnostics of a Motec Sensor Module (Normalised tracking) from a function contained in a different parent group, I get a 1337 Error: “Access to Normalised Tracking ‘Twistgrip.Sensor’ is not allowed.” I can access the diagnostics from a function contained in the same group as the sensor, however. Is this an intentional limitation of the system?

CAN Communications
Do you recommend receiving all CAN messages across the various addresses used in a single function? Or is it ok to use separate functions? If I can use separate functions, would each be called at the composite CAN receive rate described on page 48 of the manual?
Would it be possible to get a code example for receiving and transmitting a compound message?

Domain of Integral Function
Can you confirm that the domain of the integral.normal library function is the interval between the first time the integration function was called or reset?

Engine Build Example code:
The example code includes: Fuel.Pump.Update(turning, Run Switch eq Run Switch.On). The explanation in M1 is that the first argument (request) primes the pump and the second (enable) will request the pump to run. If that is accurate, should the two values not be switched over?

Follow up regarding previous question about using lookup in a calibration function
I want to be able to calibrate the output of a custom sensor (radiometric voltage) with an offset and offset target. The sensor calibration may or may not be linear. In order to be able to allow the user to make manual adjustment, I want to be able to display the offset in the same “value quantity” as the calibrated output (e.g., distance).
This is not difficult to do if I can lookup and reverse lookup the calibration table in the Q function. It can also be done in a scheduled function as long as I calibrate the offset as a sensor voltage in M1 tune rather than the calibrated value (e.g., distance). That makes it difficult to manually set and offset, however. What am I missing? Is this still possible? This used to be the means of calibrating certain sensors (suspension and load sensors) in older M1 Tune packages (without resorting to a scale method) .
Fast_Moto
 
Posts: 111
Joined: Mon Apr 19, 2010 12:49 pm

Re: M1 Build Questions

Postby Fast_Moto on Tue Dec 17, 2013 3:09 pm

After largely finishing with the project (subject to clarification of the questions above), I had a couple of final questions. I hope my questions are also helpful to other people that may be thinking of using the M1 build software.

(1) In my project, I am using 20 possible throttle translation tables for 2 throttle bodies. These are chosen based on gear and track sector. However, at any given time, only two tables are actually used – one for each throttle body. I am wondering whether it makes sense to assign 20 dual rate events so that each table is evaluated at a high frequency if active (100-200Hz) and at a low rate (10Hz) if inactive. Or is the overhead required by the ECU to analyze an if/when statement and the dual rate event roughly equivalent to update a table at the same frequency? Does table size impact this calculus?
(2) In a function, Is it a lot more efficient to address a foreign object directly in a function or should we just always assign a local variable that is assigned the value of that object. Are there any guidelines on when the two options make sense?
(3) Lambda compensation. Can we use the Lambda compensation module even if we use throttle opening as a substitute for engine efficiency rather than an efficiency estimation? This is for a motorcycle engine so using map sensors presents some difficulties and there is otherwise no need for our application. Unfortunately, after checking the help provided in the module and in the sample engine build manual, it is not entirely clear how the module calculates the closed loop compensation so I cannot make that determination myself. P.S. I realize that Motec uses a MAP estimation table in its modules, but it would be preferable if we did not have to do that.
Fast_Moto
 
Posts: 111
Joined: Mon Apr 19, 2010 12:49 pm

Re: M1 Build Questions

Postby YuriK on Fri Jan 03, 2014 12:44 pm

Hi,
Please see answers to your questions below:
1. Accessing Diagnostics of Pre-Built Sensor Modules - we were unable to replicate this issue. Would you be able to send us an example code with the explanation ?
2. CAN Communications - various addresses can be received in a single function or in separate functions. You need to keep in mind that number of communication handles is limited (to approximately 60) so opening too many handles may result in missed messages. Each functions needs to be called at the combined rate of the messages to be received. here is a code example, you've asked about

/* An example for receiving 16 CAN UDs with a single handle. The script
need to run fast enough to receive all messages,
as only one message is received each time */

local h = CanComms.RxOpenStandard(0, 0x5E0, 0x00f, true); // receive 0x5E0 to 0x40f, big endian (normal) byte order

local received = CanComms.RxMessage(h);
local timeout = Delay.Rising(received eq false, 1.0);
if (received)
{
local id = CanComms.GetID(h) & 0x00f;
if (id eq 0x0)
{
Channel 1 = CanComms.GetUnsignedInteger(h, 0, 16) * 1.0e-3;
// etc
}
else if (id eq 0x1)
{
Channel 2 = CanComms.GetUnsignedInteger(h, 0, 16) * 1.0e-3;
// etc
}
...
else if (id eq 0xf)
{
Channel 3 = CanComms.GetUnsignedInteger(h, 0, 16) * 1.0e-3;
// etc
}
}

3. Domain of Integral Function - You are correct, the domain of the integral function is between the first time the function was called and the current function call.
4. Engine Build Example code - The arguments in the Help need to be the other way around: enable - for priming the pump and request - for requesting the pump to run. The Help will be fixed in the next release
5. Lookup in calibration tables - The reverse lookup is not possible in M1 Tune. Can you please specify the old M1 Tune package you've said reverse lookup was possible?
6. Throttle translation tables - You can try using one four-dimensional table rather than multiple three-dimensional tables, however, as you've mentioned the table size does impact the calculation time. Regarding dual rate events they basically trigger at their default rate and, if Idle() method had been called, their rate changes to idle. Normally there is another functions that runs at some rate that checks a certain condition and decides whether to switch the dual rate event to idle or default. This functionality results in a "slow start" first time the event need to switch to one of its rates, because normally the regulating function runs in low event rate. See Engine.Capture Dual Rate event as an example.
7. Local or global object - there is currently no difference in performance between calling an object directly or assigning it to a local variable.
8 . Lambda compensation - you can use lambda compensation without the actual MAP sensor. GPA and GPR projects are designed to use MAP sensor or MAP estimate table, so you need to use MAP estimate table in this model. In general, however, you can use throttle position instead (see the Build Engine example)

Regards!
YuriK
 
Posts: 78
Joined: Fri Nov 26, 2010 8:16 am

Re: M1 Build Questions

Postby Fast_Moto on Tue Jan 21, 2014 1:21 pm

Thank you Yuri. Your support has been really great!

(1) Accessing Diagnostics of Pre-built modules
If you pm me an email address, I can send you a project that demonstrates the issue with accessing diagnostics of the pre-built sensor module. I could also do a call to walk you through it once you have the project.

(2) Lookup in calibration table
I am not entirely sure whether this was done a different way, but if you take a look at the January 2013 Kawasaki ZX10R 2011 Attack Performance firmware, version 01.24.0006, system version 01.02.20, you can see what I mean with regard to the setup of the suspension and shift force sensors. In particular, the suspension position allows you to set a zero target and offset based on the calibrated value (mm as opposed to voltage). I assumed this was done with reverse look-up tables, but maybe there is a different way of doing this.
Fast_Moto
 
Posts: 111
Joined: Mon Apr 19, 2010 12:49 pm

Re: M1 Build Questions

Postby HermannH on Wed Jan 29, 2014 2:41 pm

Hi,

to your questions:
1) Access objects inside of pre-built classes: This is possible from anywhere in the project. However, if a group has a default value and you are inside of this group, you can only access the default value. If you are outside of this group, you can only access the value by using the group object.
If you try to access the default value from outside the group you get the error code as you described in a previous post.
Internally both values are identical though, they use the same memory.

2) Table lookups in calibration methods. In calibration methods you can only use the methods that are mentioned in the M1 Development Manual. Lookup or reverse lookup methods cannot be used in calibration methods. The example you mentioned does not do a table lookup either. It just reads the current table value and assigns the offset accordingly.

I hope this could help you.
If new questions arise, we will be happy to help but we would suggest to open a new thread in the forum for each topic to make it easier to navigate in the forum.

Regards,

Hermann
User avatar
HermannH
 
Posts: 3
Joined: Fri Jun 07, 2013 1:37 pm
Location: Melbourne, Victoria

Re: M1 Build Questions

Postby Fast_Moto on Thu Jan 30, 2014 8:59 am

Thanks for the response. If you want, please feel free to separate the individual questions into separate threads.
Fast_Moto
 
Posts: 111
Joined: Mon Apr 19, 2010 12:49 pm


Return to M1 Build

Who is online

Users browsing this forum: No registered users and 2 guests