You are not logged in.
Pages: 1
Topic closed
Hello,
I am using Rexduino (*.mdl file and three *.ino files from github) in Rexygen and I have problem with counter. I set the pinmode2 to Encoder A, pinmode4 to Encoder B and connected CNB with state on to CNT2E. The incremental encoder is connected to Arduino UNO board, measuring the DC motor. When I set the PWM for motor to constant value, it runs quite constantly. But the output from Arduino UNO mask, CNT2, is updating irregularly.
I checked comm_status, it is 3 without changes. I also tried to increase baudrate from 57600 to 115200 (in REX and Arduino), but without any help. The program runs on Raspberry Pi 1 B+, ticks 0.005 and ntick0 for used task is 2 (so periode of mz task is 10 ms).
Thanks for your help.
Offline
Hi Bodie,
thanks for the detailed description of the problem. Three questions on my mind:
Did you also check the err_code and err_subcode outputs? I guess there will be some nonzero values.
Can you try rotating the encoder with your hand to avoid noise generated by the motor? Does the problem still occur in such a case?
What is the average and maximum execution time of your task?
Kind regards,
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hi Jaroslav,
I checked err_code and err_subcode and there were zeros.
I tried to rotate it manually, but i am not sure if I was able to rotate it with constant speed. Still problems with counter value, see attached picture.
I also attached diagnostic window screen, average time was 3.59 ms and maximum 6.87 ms.
Regards
Bodie
Offline
Hi Bodie,
just to be sure: did you check trend of err_code and err_subcode? Can you also check userRecv output of Arduino subsystem? It should show Arduino internal time.
Regards, Tomas
Offline
Hi Tomas,
Yes, as you wrote, I checked it in trend.
The userRecv trend is attached, looks like it is rising linearly.
Regards
Bodie
Offline
Hi Bodie,
this will need a thorough analysis, at the moment I do not see any potential cause of the problem. Can you please try running your algorithm on a Raspberry Pi 3 and check if the problem persists?
Best regards,
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Pages: 1
Topic closed