Scale & offset values in Micromod configuration Sw

Universal I/O Module with CAN Interface
Laurent
Posts: 13
Joined: Fri 5. Jun 2015, 10:10

Scale & offset values in Micromod configuration Sw

Post by Laurent » Tue 23. Aug 2016, 17:26

Hi all,
I'm trying to use the output frequency of a Micromod Module to drive a basic servo controller. As it requires a 20ms period signal, I set the options to PWM8Bits with a 50Hz frequency.
My main issue is that RC ON signal needs to be between 1 and 2 ms (out of 20 ms). So I wanted to use the scale and offset parameters to adjust my inputs (between 0 and 255 in decimal) to the rignt values, ie dividing by 20 (scale 0.05 in decimal) and adding +1 (offset +1 in decimal).

The online documentation says:
Scale / Offset
Multiplier and offset for the data contents. These may be positive or negative floating point values.
Calculation: Output = (MsgValue * Scale) + Offset, where MsgValue is a 16-bit value [0..65535]

What should be the "Scale" and "Offset" range?
Are these values 8 or 16 bits?
Does the module accept scales values between 0 and 1(decimal)?

Thanks for your help;
Laurent

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1173
Joined: Fri 10. Sep 2010, 19:34

Re: Scale & offset values in Micromod configuration Sw

Post by U.Wilhelm » Wed 24. Aug 2016, 12:03

first of all we need to know which MicroMod Module you use?
only the CPU with your own board, or one of our boards - if yes - part number?
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

Laurent
Posts: 13
Joined: Fri 5. Jun 2015, 10:10

Re: Scale & offset values in Micromod configuration Sw

Post by Laurent » Wed 24. Aug 2016, 12:24

Good afternoon,
I have most of your micromod modules but for this test I wanted to use a Micromod Digital 1 or 2 with the Fout0 output. My remark was more on the configuration sw and the way to use it.
If the HW doesn't fit, is it possible to use any other module for this test (Micromod demo board, Mix 1 or Mix 3)?
Regards,
Laurent

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1173
Joined: Fri 10. Sep 2010, 19:34

Re: Scale & offset values in Micromod configuration Sw

Post by U.Wilhelm » Wed 24. Aug 2016, 13:18

Yes, but the configuration is depending on the used baseboards - you need to select the profile for the different base boards. The Offset is a simple Addition to the Result Value of the scaling calculation. The scale is a multiplication - as you wrote :
(MsgValue * Scale) + Offset

the Message Value is the data that you send on the defibned CAN ID
Intel or Motorola, 8 or 16 Bit - this is up to you
Also the Startposition of Byte and Bit.

The Frequenzy output is a LowSide driver with max. 10 KHz, the max. current is 0.75A
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

Laurent
Posts: 13
Joined: Fri 5. Jun 2015, 10:10

Re: Scale & offset values in Micromod configuration Sw

Post by Laurent » Wed 24. Aug 2016, 13:31

I undestand these informations but then what should I put into the scale field (as the offset is already 1) to make my calculation look like Output=(MsgValue*0.05)+1?
0.05 is decimal and the float value is not the same in 8 or 16bits...
Here is a screenshot of the interface in attachment
Frequency output configuration
Frequency output configuration
2016-08-24_13h31_13.png (11.8 KiB) Viewed 5169 times
As a complement of information, 2.75 coded with a 8 bits format will correspond to 0110 1011 in binay and 0x6B as described in the example below...
Last edited by Laurent on Wed 24. Aug 2016, 13:56, edited 1 time in total.

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1173
Joined: Fri 10. Sep 2010, 19:34

Re: Scale & offset values in Micromod configuration Sw

Post by U.Wilhelm » Wed 24. Aug 2016, 13:39

what do you need frequenzy or PWM ? I was talking about frequenzy, you about PWM.
Unbenannt.JPG
Unbenannt.JPG (31.38 KiB) Viewed 5168 times
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

Laurent
Posts: 13
Joined: Fri 5. Jun 2015, 10:10

Re: Scale & offset values in Micromod configuration Sw

Post by Laurent » Wed 24. Aug 2016, 13:57

I used the Frequency output (Fout0) configurated in 8 bits PWM mode...

Laurent
Posts: 13
Joined: Fri 5. Jun 2015, 10:10

Re: Scale & offset values in Micromod configuration Sw

Post by Laurent » Wed 24. Aug 2016, 14:01

The example I just mentionned was not included, sorry...
Attachments
8 bits float example
8 bits float example
2016-08-24_13h51_50.png (7.4 KiB) Viewed 5168 times

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1173
Joined: Fri 10. Sep 2010, 19:34

Re: Scale & offset values in Micromod configuration Sw

Post by U.Wilhelm » Thu 25. Aug 2016, 12:38

8Bit PWM is a usignedByte not a 8Bit Float (which is not common)
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

G.Lang
Support
Support
Posts: 139
Joined: Wed 22. Sep 2010, 14:58

Re: Scale & offset values in Micromod configuration Sw

Post by G.Lang » Thu 25. Aug 2016, 16:04

Hello Lauren,

the possible values for scale and offset are decimal values between -65535 and 65536
micromod_values.JPG
micromod_values.JPG (48.99 KiB) Viewed 5143 times
Below an example for a 50Hz PWM Output with scale =1 (note: the logic is inverted because it´s a lowside driver)
8Bit PWM Out -> 0..100%
FFh = 255 = 0%
00h = 0 = 100%
3Fh = 63 = 75%
pwm_out_scale1.JPG
pwm_out_scale1.JPG (212.51 KiB) Viewed 5143 times
And here the same with a scale =2
pwm_out_scale2.JPG
pwm_out_scale2.JPG (197.12 KiB) Viewed 5143 times
Hope this helps.

best regards
Gunther

Post Reply