- Posts: 12170
- Thank you received: 4153
gearchange
- rodw
- Offline
- Platinum Member
-
Less
More
2 months 3 weeks ago #348650
by rodw
Replied by rodw on topic gearchange
Sometimes a custom component simplifies your hal file. Here is my solution for a similar problem where there are two belts each with 4 positions. But because it's not possible for both belts to use the same position, it comes down to the same problem you have. For the ratios, I just ran the spindle on each belt combination and read the actual rpm with a cheap laser tacho and did some maths. But I did not have levers, and made a panel for qtdragon which Chris "borrowed" for the qtdragon docs.
github.com/rodw-au/vmnmillqt/blob/main/scalebelts.comp
github.com/rodw-au/vmnmillqt/blob/main/scalebelts.comp
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
1 month 3 weeks ago #349489
by andypugh
Replied by andypugh on topic gearchange
Rather than LUT5 look at using a match_8 for each gear.
Alternatively, a mux_generic with 6 bit inputs could provide the gear number, or a pair of them could provide the speed limits.
Your HAL file would only need to define inputs for the valid gear positions, not for all 64 possibilities.
Alternatively, a mux_generic with 6 bit inputs could provide the gear number, or a pair of them could provide the speed limits.
Code:
loadrt mux_generic config="ff64,ff64,ff64" names="gear,max,min"
Please Log in or Create an account to join the conversation.
Time to create page: 1.322 seconds