Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

Arduino FreeRTOS Servo problem

Posted by adrigt11 on August 13, 2017

Hello

I'm using the FreeRTOS in an Arduino Mega and I want to control some Servos using task for each servo. All is working good but I notice that very often the Servos make strange movements because the PWM signal is not good. I tested a similar code but without the FreeRTOS and there aren't any strange movements on the Servos.

I think that there is a conflict within the FreeRTOS and the Interrupts that controll de PWM siganl of the Servos.

Can anyone help me?

Thanks a lot


Arduino FreeRTOS Servo problem

Posted by rtel on August 13, 2017

I think the AVR part and therefore the RTOS port are quite simple, and interrupt nesting is not supported. I suspect your PWM signal is quite high frequency and the RTOS tick could be adding jitter into its timing - just a guess. Making the RTOS tick slower (configTICKRATEHZ) would lessen but not remove that issue.


Arduino FreeRTOS Servo problem

Posted by adrigt11 on August 13, 2017

The PWM signal is 50Hz to controll the Servo, is not very high frequency. Are you saying that I can modifie de configTICKRATEHZ to improve that?


Arduino FreeRTOS Servo problem

Posted by richard_damon on August 13, 2017

Is the Servo PWM being generated by built in hardware, or by software toggling a bit? 50 Hz is 20ms period, so even a 1ms disturbance is 5% of the signal. Even a much smaller disturbance can make a significant 'kick' to the servo. If you are generating it with a precisely timed interrupt to a ISR that is toggling the bit, that interrupt must not be blocked for any significant time for any reason. If you can not get that interrupt to interrupt the tick interrupt, you are going to have problems.


Arduino FreeRTOS Servo problem

Posted by adrigt11 on August 14, 2017

The PWM signal being generated by the Servo library by ISR. How can I not block the interrupt for the Servos in FreeRTOS?


Arduino FreeRTOS Servo problem

Posted by rtel on August 14, 2017

That port does not support interrupt nesting, so even if you didn't disable the servo interrupt, I'm not sure how the system would behave. If the servo interrupt is not using any FreeRTOS functions then it might work, but I would have to study the code to know for sure.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS