Jack Gassett Posted April 14, 2015 Report Share Posted April 14, 2015 Hey everyone, I was looking through OpenCores for some interesting libraries to port to DesignLab and I came across this Robot Control Library:http://opencores.org/project,robot_control_library It has:PWM EncoderQuadrature DecoderStepper ControlPIDPlaystation 2 JoypadDocumentationC DriversIt seems like a very useful library to bring into DesignLab. I know there is overlap with other projects but this has some interesting features such as: 8 Quad encoders with Pulse Count, Revolution count, Speed, and acceleration output.16 PWM with 2 Phase chopping, 1 Phase chopping, and enable chopping8 PID instances with Programmable sample time.The project is targeted for the Xilinx ODB bus but after looking at the code it looks like the core IP is easy to connect to the wishbone bus instead. I spoke with the author in email and he has given us permission to use the core IP code, which he wrote, in any way that we want. He said to apply any license that we prefer to it. Originally I was thinking GPL, but maybe FreeBSD like the ZPUino license is better... Any thoughts?Jack. Quote Link to comment Share on other sites More sharing options...
nilrods Posted April 14, 2015 Report Share Posted April 14, 2015 Jack,You know I saw that one out there also. I had not had a chance to look it over it in depth though. I think those types of functions would definitely be useful as they are common functions for those interfacing with hardware for maker types. I am not sure if they are built all tied together or separate modules. I would think separate modules would be best to only use what a person needs. I do have it in my plan to look over that one and a couple others I bookmarked with similar functionality. But I don't think it can hurt to have that as a designlab library myself. Just my thoughts. Thanks,Chris Quote Link to comment Share on other sites More sharing options...
Filip Posted April 14, 2015 Report Share Posted April 14, 2015 It seems like a very useful library to bring into DesignLab. I know there is overlap with other projects but this has some interesting features such as:.. Originally I was thinking GPL, but maybe FreeBSD like the ZPUino license is better... Any thoughts?Jack.Jack,+1 from me. I think more Libraries is better even if they have overlapping parts. As fo the license maybe be like the ZPUno, but I guess it really depends how free you want to make it. . I am not sure if they are built all tied together or separate modules. I would think separate modules would be best to only use what a person needs. Thanks,ChrisChris, I think they are both but at the end you take only what you select.... (this are thoughts from 5 min. code looking ) Filip Quote Link to comment Share on other sites More sharing options...
Jack Gassett Posted April 14, 2015 Author Report Share Posted April 14, 2015 I just got a single instance of the Quad Decoder working:https://github.com/GadgetFactory/DesignLab_Examples/tree/Robot-Control-Library/libraries/Robot_Control_Library I'm thinking that the schematic symbols will be separate modules, for example: Quad_Decoder, Quad_Decoder_x4, Quad_Decoder_x16, PWM, PWM_x4, PWM_x16 ... etc.The c code will all be in a single Robot_Control_Library file. Jack. Quote Link to comment Share on other sites More sharing options...
nilrods Posted April 15, 2015 Report Share Posted April 15, 2015 Jack,that makes sense to me. Sounds like a great addition. Quote Link to comment Share on other sites More sharing options...
Jack Gassett Posted April 15, 2015 Author Report Share Posted April 15, 2015 I ran into a roadblock with this library when trying to add multiple instances. We have Wishbone_to_Registers_x10 but that is not enough registers for multiple instances. I made a Wishbone_to_Registers_n.vhd file that lets us specify exactly how many registers are needed in a generic when you instantiate the component. You just set register_count to how many registers you need and there you have it... This only works in VHDL because the input and output ports for the registers is an array of 32-bit vectors and the schematic editor does not have support for that structure. It does make it much more convenient to make larger Wishbone_to_Register_x30 symbols for the schematic editor though. Jack. Quote Link to comment Share on other sites More sharing options...
nilrods Posted April 15, 2015 Report Share Posted April 15, 2015 Jack,That is great! I can see that would be useful if the number of registers was more than 10. I had wondered what would need to be done if more than 10 registers were needed. Thanks,Chris Quote Link to comment Share on other sites More sharing options...
Jack Gassett Posted April 16, 2015 Author Report Share Posted April 16, 2015 Ok, PWM is working as it should, just need to do the stepper and PID modules next. I don't have any way to test the PID module at the moment. I have a balancing robot that is not built yet, but that will take some time to get up and running. Jack. Quote Link to comment Share on other sites More sharing options...
Filip Posted April 16, 2015 Report Share Posted April 16, 2015 thanks Jack, I can test the PID, will look into it tomorrow + the pwm since I will probably use it in my project later .. Filip. Quote Link to comment Share on other sites More sharing options...
Jack Gassett Posted April 16, 2015 Author Report Share Posted April 16, 2015 Well, here is a copy of the library folder as it stands now. I haven't turned the PID into a wishbone library yet, I need to take a break from this library for a while and take care of other things for a bit... Jack.Robot_Control_Library-150416a.zip Quote Link to comment Share on other sites More sharing options...
Filip Posted April 17, 2015 Report Share Posted April 17, 2015 (edited) Hello,the PID is a wishbone library now, but I'm not sure how to implement a easy changeable 'Sample clk' signal (its used as a timer - when to execute the PID) without adding a separate module, to the PID lib., who will generate the 'Sample clk' rate ... Actually I think I just have to use the code from the source : (pid_sample is later the Sample clk signal) if slv_reg_write_select = To_StdLogicVector(reg_select) then -- freq write freq_register <= Bus2IP_Data(C_DWIDTH-C_FREQ_DIV to C_DWIDTH-1); pid_sample <= not pid_sample; end if; if clk_count(C_FREQ_DIV-1 downto 0)=freq_register then clk_count := (others => '0'); -- Update clk -- pid_sample <= not pid_sample; end if;But may there is a better way... Filip Edited April 17, 2015 by Filip Quote Link to comment Share on other sites More sharing options...
Jack Gassett Posted April 17, 2015 Author Report Share Posted April 17, 2015 Well, we have the programmable pll module that Alvie made for the VGA module. But the pll only works for Spartan 6 devices, we need to make one using a DCM so it works with all devices. I'd just expose the clock to the top level of the symbol for now until we work out a good solution. https://github.com/alvieboy/ZPUino-HDL/blob/work-0200/zpu/hdl/zpuino/wbpll.vhdhttp://hamsterworks.co.nz/mediawiki/index.php/FreqSwitch Jack. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.