FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [August 2017 Threads] Arduino FreeRTOS Servo problemPosted 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 problemPosted 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 problemPosted 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 problemPosted 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 problemPosted 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 problemPosted 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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|