How to adjust Transition Parameters in Light example

lHi,

MeshSDK v5

Hardware: Devboard and custom 2*2 panel light

Running a light server with lightness and ctl control.

I wanted to know how to adjust the light transition parameters. The 2*2 panel light we are working on is showing huge amounts of flickering. As a beginner, I am confused on where in the code parameters such as transition step size, step time and transition time and assigned/calculated. Wanted to know where in the code the next step is calculated so I can adjust the parameters which eliminate the flicker.

The types of flicker are:

- Light shows flicker/abrupt change when transitioning from highest to lowest brightness

- Transition changes abruptly when a change in temperature is made while another transition(in the lightness) is ongoing.

I have noticed some parameters in model_common files but there is no documentation on what those macros are.

Thank you

  • Hello,

    Wanted to know where in the code the next step is calculated so I can adjust the parameters which eliminate the flicker

    Is it possible to either send your project, or if you can tell me what example you started developing on? I suspect it is the SDK_for_Mesh\examples\light_ctl, but please correct me if I am wrong. 

    Assuming this is what you are using, it looks like the light level is controlled using PWM, is that correct?

    I see that out of the box, this example uses the app_pwm library. This is a fairly simple library that uses a timer and PPI together with GPIOTE to toggle GPIOs to generate PWM signals. The GPIO toggling doesn't require the CPU, so you shouldn't see flickering when the PWM duty cycle is stable.

    Can you describe the flickering that you see? Does it turn off and on, or is it the gradual motion from level a to level b that stops at some point (remains at a constant brightness for a short amount of time)?

    Best regards,

    Edvin

  • Hi,

    Thanks for the reply 

    Our application is based on light_ctl example. The lights are controlled using PWMs, its a 2 channel PWM signal, one for warm and other for cool.

    The flickering I see is when transitioning from level A to B, the transition is pretty evident. This was solved after reducing the TRANSITION_STEP_MIN in model_common.h

    But there are other issues like:

    • The light while transitioning from higher to lowest brightness shows a sudden stop at the lowest brightness. It looks like the brightness overshoots to a lower brightness then comes back to the actual target lightness
    • There is a sudden change in colour when the colour is changed during a lightness transition

    I wanted to know how to change parameters like the step size and whatever changes the transition behaviour. I noticed certain macros in model_common.c like TRANSITION_STEP_MASK and TRANSITION_STEP_RESOLUTION but there is no documentation on what it does to the transition behaviour

  • Rohan George Zacharia said:
    The light while transitioning from higher to lowest brightness shows a sudden stop at the lowest brightness. It looks like the brightness overshoots to a lower brightness then comes back to the actual target lightness

    Do they though? Or is it an optical illusion? Did you try to analyze the PWM pins using a digital analyzer?

    The same goes for your second question. Can you please try to analyze the PWM pins? what does the signals look like when this happens? And does the nRF log say anything? It should post something when the lights are dimming or changing color. 

    Try to compare it to the project files. Perhaps it doesn't take cases like this into account, if you are starting to change color when the devices are in the middle of a dimming procedure.

    Best regards,

    Edvin

Related