Amazing Ball problems

Forum related to the FLEX boards

Moderator: paolo.gai

sergifern
Newbie
Posts: 11
Joined: Thu Sep 23, 2010 1:13 pm

Amazing Ball problems

Post by sergifern » Thu Oct 07, 2010 12:51 pm

Hello,
I tried to run the amazing ball and I have a little problem. I have all devices and the "pid_ctrl_usbudp_codegen" complied with the scicos 4.4b7. I think the problem is in the calibrations as it doesn't place the ball in 4 corners before keeping it in balance, the ball located in 7 corners before the center. I guess because of this the control of the ball is not correct, and is always in a corner. What could be the solution?

PS: There is a part of the touch screen doesn't detect the ball once calibrated, is it possible because of incorrect calibration?

Thanks,
Sergi

sergifern
Newbie
Posts: 11
Joined: Thu Sep 23, 2010 1:13 pm

Re: Amazing Ball problems

Post by sergifern » Thu Oct 07, 2010 3:34 pm

sergifern wrote: I upload a video on youtube to show how it works. http://www.youtube.com/watch?v=6DRU-2DRqr0

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Amazing Ball problems

Post by paolo.gai » Thu Oct 07, 2010 8:17 pm

Hi sergi,

If I'm not wrong that is the ball & plate we gave to Pau and Manel, which was disassembled and mounted again in Barcelona... I guess the system was tried when in Barcelona, and it was working fine. So first question: has the system ever worked once reassembled in Barcelona?

Then, I have a few hypothesis:

- please check if the left and right motor connector have been swapped
- putting the rubber back on the borders could help making the system less noisy :-)
- are you getting anything on the UDP channel? you should try to show it using Scicoslab.
- it could be a problem in the touch. To see if the system is getting the data you could make a scicoslab design which just sends the touchscreen information to the UDP, to see if everything is working fine
- what happens if you take the ball away once done the calibration, and then you place it in another place in the touchscreen? You can also try to touch the touchscreen with something to see how it reacts. I see in the video the led in the board is blinking, this because the touchscreen is somehow working. I guess the ball in the video is bouncing so the led is blinking irregularly.
- could you please send us the .cof file you are programming in the system so that we can check it on a working ball and plate system we have here in Pisa?

Ciao,

Paolo

sergifern
Newbie
Posts: 11
Joined: Thu Sep 23, 2010 1:13 pm

Re: Amazing Ball problems

Post by sergifern » Fri Oct 08, 2010 1:55 pm

Hello,
correct, this is the ball & plate you gave to Pau and Manel. I'll talk to Pau to know if the system works before dismounting again.

As for the hypothesis:
- I verified that the motor connector haven't been swapped.
- If once the calibration placed the ball on the other side of the plate, the system does nothing, as if the ball is not detected.
- I'm working to receive UDP data channel.
- Finally, I sent the .cof file by email.

Thank,
Sergi

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Amazing Ball problems

Post by paolo.gai » Sat Oct 09, 2010 8:00 pm

Just a note... Dario noted me that you programmed using an application which has the USB blocks on it (at least from the name...).

Please note that the USB blocks works only if you have a FLEX Full 8and if you programmed also the PIC18 with the FLEX Full).

Since you have a Flex light with the ball & plate, it may be that the USB code (without the USB hardware) may give some problem.

For that, I suggest removing the USB blocks from the diagram, and try again... In the meantime Dario will try the cof you sent us on a ball & plate.

Ciao,

PJ

erikadds
Newbie
Posts: 45
Joined: Wed May 12, 2010 9:41 am

Re: Amazing Ball problems

Post by erikadds » Mon Oct 11, 2010 12:30 pm

Dear Sergi, I did some tests.
In the diagram "flex_ctrl_usbudp_codegen" is missing a red connection on the block PIDy. Sorry...
However, it is not advisable to use the diagrams using the USB communication on the FLEX light board.

Thanks for the tip.
Regards.
Dario

erikadds
Newbie
Posts: 45
Joined: Wed May 12, 2010 9:41 am

Re: Amazing Ball problems

Post by erikadds » Mon Oct 11, 2010 3:11 pm

Dear Sergi,
I tried your pic30.cof on a Flex-full like that you used in the video.
The program that you loaded on the dsPIC is not what you wrote above.
The program that you loaded is "pid_ctrl_codegen_usbudp_tuning_square_circle.cos"
and this only works if the PC sends the PID parameters via USB (see "pc_pid_usbudp_tuning.cos).
I sent data and everything works.
I saw the board, however, behaves in a way different from mine.
The led blinks and servos are intermittent.
I do not exclude that it is a problem related to power-supply...
please use a power-supply capable to erogate at least 2A.

Regards,
Dario

sergifern
Newbie
Posts: 11
Joined: Thu Sep 23, 2010 1:13 pm

Re: Amazing Ball problems

Post by sergifern » Tue Oct 12, 2010 1:06 pm

Dear Dario,
thanks for your help. I tried to correct the error you found in PIDy block in the file "flex_ctrl_usbudp_codegen" and I have removed the USB blocks from the diagram, but the board still doesn't work correctly. Related to the .cof file that I send, I think I'm wrong, but using the file "flex_ctrl_usbudp_codegen" or another example, the behavior of the ball&plate is exactly the same.

I will try to change the power-supply as you told me.

Thank you for your attention,
Sergi

sergifern
Newbie
Posts: 11
Joined: Thu Sep 23, 2010 1:13 pm

Re: Amazing Ball problems

Post by sergifern » Fri Oct 15, 2010 12:18 pm

Hello,
after changing the power supply the ball&plate still doesn't work correctly. I checked the operation of the touch screen by sending the value of X and Y through the serial port.

I have seen that the readings are incorrect. There is a 1/4 part of the screen does not detect anything. And also on the block Y the values start at 119 at one end of the screen, and half is 0 (and maintained at 0 to the other end). In the X block value starts at 89 (from where the screen works) and before the end is 0 (and maintained).

I don't know if the readings are incorrect as result of a bad calibration, as part of the screen appears don't be working. What could be the problem?

I upload a video on youtube to show how it works. http://www.youtube.com/watch?v=Dqd8W3KC8KY

Thanks,
Sergi

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Amazing Ball problems

Post by paolo.gai » Sat Oct 16, 2010 9:52 am

Quite strange. It seems the touchscreen is broken.

From the video, in fact, it seems that the control algorithm works when the part of touchscreen which gives good readings is touched. I remember we gave to Pau a working system, so I guess something must have happened when moving it to Barcelona... I'm going to send a mail to Pau to understand how to fix the thing...

Ciao,

PJ

gina.torres
Newbie
Posts: 16
Joined: Fri Apr 13, 2012 1:15 pm

Amazing Ball problems-UDP Communication

Post by gina.torres » Wed May 09, 2012 12:48 pm

Hello,

I have some problems testing the Amazing Ball Control System: An example of PID control and UDP communication, i have done all the first five steps of http://erika.tuxfamily.org /wiki/index.php?title=Amazing_Ball_Control_System:_An_example_of_PID_control_and_UDP_communication, and i have programmed my flex light base board with the code generated from pid_ctrl_codegen_udp_tuning_square_circle.cos, but for the step 6 i am not sure what to do exactly, it says i should open the PC-side file “pc_pid_tuning.cos" which is useful to monitorize the UDP data received and sends data to the Flex Board, but the question is how all the next windows appear as shown in your Figure 8?, I have tried Run of the Menu Simulate and they appear but i dont know if it is correct. Please tell me the next steps after opening “pc_pid_tuning.cos".

Other question is about Step 7, where says:Release the reset to run the demo (refer Fig.9); Initially the application calibrates the touch screen (refer Fig. 11), followed by rest of the demo (refer Fig.12). , I don´t know what it means and it is not clear because it seems that i should program something else in my flex board as you show in your Figure 10 - MPLAB IDE: Target released from reset ?. After the step 7 i have got lost.

I have just programmed pid_ctrl_codegen_udp_tuning_square_circle.cos and the amazing ball first do a calibration, but it doesnt make any control after this, maybe i am doing something bad, please advice me. And about the data received it shows that i am not receiving or sending anything because the signals are invariable. So i think the steps are not correct.

Should i program something in the Flex Demo2 Daughter Board? These steps dont talk about that.....

Thank you!!.

Gina Torres G,

erikadds
Newbie
Posts: 45
Joined: Wed May 12, 2010 9:41 am

Re: Amazing Ball problems

Post by erikadds » Wed May 09, 2012 4:41 pm

Hi,
first of all, program the AmazingBall using the executable obtained from this diagram
"pid_ctrl_codegen_udp_tuning_square_circle.cos".
Program the AmazingBall but do not start the system in MPLAB IDE.
To send and receive data, and calibrate the AmazingBall controller use this diagram
"PCside_AmazingBall_UDP_PIDtuning.cos"
Sorry, the wiki contains the old name of the file.
I will correct the wiki as soon as possible.
At this point ,you can run the simulation of this diagram and then start the AmazingBall system.
You have to program only the FLEX board. If the PC-side diagram simulation is not running, the AmazingBall stops after the touch panel calibration.

Thanks for using the forum.
Let me know.

DDS

gina.torres
Newbie
Posts: 16
Joined: Fri Apr 13, 2012 1:15 pm

Re: Amazing Ball problems

Post by gina.torres » Tue May 15, 2012 12:50 pm

Hey All,

I am having the same problems, i have done all what you have said: i'll programmed de generated program of "pid_ctrl_codegen_udp_tuning_square_circle.cos" on my Flex board, then i started "PCside_AmazingBall_UDP_PIDtuning.cos" i run the simulation and as i said in my last post but i dont know exactly what to do next , i have done a reset pressing the two buttons in the daughter board and it starts calibrating, but then it just stop. Looking at the state of the connection i see that i am sending data but i don't receive data. So please help me!!!.

Gina Torres G.

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Amazing Ball problems

Post by paolo.gai » Wed May 16, 2012 9:21 am

Dear Gina,

I think we should separate two problems:

First of all, we need to be sure that the system is working properly, and that the programming of the microcontroller is successfully. For this reason, please use the pid_ctrl_udp_codegen.cos example. Please connect the ethernet cable, and verify that Scicos is getting the data using the demo "PCside_AmazingBall_UDP_Monitor.cos" . In fact, this demo tests:
- that the hardware is working properly (that is, the ball should go to the center)
- that teh UDP sending is working (when connected the led on the ethernet plug should blink.

If that works, and if you are seeing the data plotted on the ScicosLab diagram in simulation, then you can pass to the demo you were referring to.

If the control works but you cannot display the data, then it means that there are some issues in the ethernet packet delivery.

1) Be sure to set the IP address as specified in the diagram
2) if unsure, try to see if your PC is currently receiving the packets. I typically use WireShark for this (http://www.wireshark.org/)

Btw, if you are coming to Pisa for the ECRTS than we can make a few trials together!

Ciao,

PJ

gina.torres
Newbie
Posts: 16
Joined: Fri Apr 13, 2012 1:15 pm

Re: Amazing Ball problems

Post by gina.torres » Mon May 21, 2012 10:15 am

Hello,

Thanks for your reply.

I have realized that i havent programmed my flex board correctly, i have been programming all time the code generated by pid_ctrl_usbudp_codegen.cos not the pid_ctrl_udp_codegen.cos , it was a mistake with MPLAB X. When i realized about that then i have this problem: I try to create a project with MPLAB X, for the code generated by pid_ctrl_udp_codegen.cos and it can't create the project because pic30.cof is 29Mb, i realized about that because the other examples: The code generated by Led_sin.cos and pid_ctrl_usbudp_codegen.cos are very less than this one (3 Mb and 9Mb) so MPLAB X is unable to create the project for 29Mb. The question is: Is possible that i should use another version of MPLAB for example MPLAB IDE v8.84?. Why is the pic30.cof of this pid_ctrl_udp_codegen.cos of that size (29Mb)?. How do i program my flex board with MPLAB IDE for a prebuilt code?.

Thanks again and i hope i could come to Pisa for ECTRS, now i have to solve the most that i can with the Amazing Ball.

Gina Torres G.

Locked