Electronics > FPGA

How to drive wheel on FPGA?

(1/2) > >>

NobikaNg:
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?

pcprogrammer:
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.

NobikaNg:
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.

pcprogrammer:

--- Quote from: NobikaNg 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.

--- End quote ---

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.

NobikaNg:
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?

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod