Author Topic: How to drive wheel on FPGA?  (Read 1152 times)

0 Members and 2 Guests are viewing this topic.

Offline NobikaNgTopic starter

  • Newbie
  • Posts: 4
  • Country: hk
    • none
How to drive wheel on FPGA?
« on: April 30, 2024, 10:17:59 am »
hello all, I am a beginner of VHDL, and I would like to implement a obstacal detection car by using ZedBoard.

Now, the biggesr problem that I encouter is drving the wheels and IP block design.

Let me describe my project first:

The car detect the obstacle by RCWL-1601​(a ultrasonic sensor) and the car will detemine to turn direction or go forward by checking whether the distance between the car and obstacle is larger than certain value. I would like to implement these by using ARM visit because I think C code should more easy to do this but I feel confused about the ip block desgin and don't know how to start it.

Moreover, based on my knowledge from other embedded system, I need control the signal of the servo so that I can control the wheels, but I don't know how to do this in FPGA.

Also, I am using ZedBoard which can only supply 3.3 V, so I would like to know is there any suitable servo that can be used?
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3805
  • Country: nl
Re: How to drive wheel on FPGA?
« Reply #1 on: April 30, 2024, 10:59:47 am »
Hi and welcome to the forum.

Why would you want to do this project on a ZedBoard that has way to much resources for this small task that is best run on a simple microcontroller.

But to get you started with this on the ZedBoard you have to understand what the hardware offers you. Besides the FPGA it has a dual core ARM Cortex-A9 to run your code on. To use this core you will have to either dive into the manuals or search for projects that do this and use them as examples.

Search for "linux on zynq 7020" to get loads of information. Or take a look at the resources on this site.

For driving a servo you can easily use a level converter to boost the control signal to 5V, but modern servos might even work with 3.3V levels on the signal line. All it needs is a PWM signal with a 10-30ms interval and a pulse width varying between 1 and 2 ms to control the position from 0 to 90 degrees. (May vary based on the servo used.)

For learning VHDL or verilog for that matter I would advice to start with something different, like blinking LED's or make a counter on a display, and work your way up to more complex hardware.

Offline NobikaNgTopic starter

  • Newbie
  • Posts: 4
  • Country: hk
    • none
Re: How to drive wheel on FPGA?
« Reply #2 on: May 01, 2024, 12:12:10 pm »
Thank you for your reply. Actually, I am taking a VHDL course that requires me to define a topic and apply the FPGA knowledge I have learned in this course. I have also done experiments like controlling the blinking of LEDs. I initially chose the obstacle avoidance car as the topic because I had some knowledge of electronics and detectors from another embedded systems course, and I wanted to try to apply it in this course. However, I am finding this problem to be much more difficult than I imagined, but it should also be very interesting to complete.
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3805
  • Country: nl
Re: How to drive wheel on FPGA?
« Reply #3 on: May 01, 2024, 12:29:44 pm »
Thank you for your reply. Actually, I am taking a VHDL course that requires me to define a topic and apply the FPGA knowledge I have learned in this course. I have also done experiments like controlling the blinking of LEDs. I initially chose the obstacle avoidance car as the topic because I had some knowledge of electronics and detectors from another embedded systems course, and I wanted to try to apply it in this course. However, I am finding this problem to be much more difficult than I imagined, but it should also be very interesting to complete.

It certainly is. To obtain your goal try to compartmentalize it into smaller sections.

First think of how you could do distance measurement in hardware. It depends on the ultrasound sensor if it is smart or dumb. With that I mean if it returns a digital distance value or just pulses of which the delay determine the distance. If it it the latter you can use a counter in your FPGA to time the space between the start pulse and the end pulse. You can then use this value in your C code running on the ARM core to base decisions on.

Similar for the servo. You can have the ARM core write a value into a register setup in the FPGA and use that to send out the needed pulse for steering the servo.

But for this you have to read up on how the Zynq device works with the processor side and the FPGA side.

Offline NobikaNgTopic starter

  • Newbie
  • Posts: 4
  • Country: hk
    • none
Re: How to drive wheel on FPGA?
« Reply #4 on: May 01, 2024, 12:53:44 pm »
My ultrasonic sensor is "dumb" sensor, but I have used this module before so I roughly know how to calculate the corresponding distance. The more troublesome problem now is that I am not very good at using Vivado to do IP block design. My course did not explain Vivado and Visit in detail, so I still don’t understand how to use them. I just simply understand IP block design as providing an interface for VHDL and C code to communicate. |O
Can you suggest some good tutorial that can help me?
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3805
  • Country: nl
Re: How to drive wheel on FPGA?
« Reply #5 on: May 01, 2024, 01:15:02 pm »
I have not used it much myself, but maybe this site can get you started.

You are writing about IP block design, and that is somewhat irrelevant. IP stands for intellectual property and in FPGA world refers mostly to small parts that are created by the manufacturer to aid with making your own designs. Some are free and some you have to pay for when you want to use it. The things you want to do are techniques that are widely used, so best just to talk about making a design or in terms of Vivado a project.

If you have the board and the software around to play with I would suggest to start with some simple example projects to get a feel for both the software and the board.

Focus on the FPGA side first and try to have that do some simple things for you. Then try to incorporate one of the processors and have it interface with the FPGA. I know it is easy to write this, but I would have to dive into it and play with it too, to get something running, which also takes time. It is on my list for sure. Have some boards with Zynq 7010's on them.  8)

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 27040
  • Country: nl
    • NCT Developments
Re: How to drive wheel on FPGA?
« Reply #6 on: May 05, 2024, 03:15:18 pm »
Thank you for your reply. Actually, I am taking a VHDL course that requires me to define a topic and apply the FPGA knowledge I have learned in this course. I have also done experiments like controlling the blinking of LEDs. I initially chose the obstacle avoidance car as the topic because I had some knowledge of electronics and detectors from another embedded systems course, and I wanted to try to apply it in this course. However, I am finding this problem to be much more difficult than I imagined, but it should also be very interesting to complete.
A problem like this is easier to solve through software. If you want to stay close to FPGA design, you could consider using the Picoblaze / Pacoblaze programmable statemachines. I have used these in the past with much succes.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline NobikaNgTopic starter

  • Newbie
  • Posts: 4
  • Country: hk
    • none
Re: How to drive wheel on FPGA?
« Reply #7 on: May 11, 2024, 08:59:58 am »
What is Picoblaze / Pacoblaze? I have no idea about these two, could you introduce how to use them?
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 27040
  • Country: nl
    • NCT Developments
Re: How to drive wheel on FPGA?
« Reply #8 on: May 11, 2024, 07:02:19 pm »
What is Picoblaze / Pacoblaze? I have no idea about these two, could you introduce how to use them?
These are programmable statemachines. Just enter into Google and you'll find out more.

First Google hit: https://bleyer.org/pacoblaze/
« Last Edit: May 11, 2024, 07:40:50 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf